Changeset 1936

Show
Ignore:
Timestamp:
02/15/08 14:04:45 (9 months ago)
Author:
jjarrett
Message:

Refined rough implementation on MLS Setting property page.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mls/framework-plugin/src/com/tresys/framework/compiler/mls/MLSLevel.java

    r1910 r1936  
    3434public class MLSLevel 
    3535{ 
     36        private static final String COLOR_ATTRIBUTE_NAME = "color"; 
     37 
     38        private static final String EMPTY_STRING = ""; 
     39 
     40        private static final String LEVEL_ELEMENT_NAME = "level"; 
     41 
     42        private static final String NAME_ATTRIBUTE_NAME = "name"; 
     43 
     44        private static final String ORDER_ATTRIBUTE_NAME = "order"; 
     45 
     46        private static final String RANGE_ATTRIBUTE_NAME = "range"; 
     47 
    3648        // The Name of the Level 
    37         protected String _name = ""
     49        protected String _name = MLSLevel.EMPTY_STRING
    3850         
    3951        // The Color used to represent this level in the diagram 
     
    4153         
    4254        // The Range used to specify the level in the generated Policy 
    43         protected String _range = ""
     55        protected String _range = MLSLevel.EMPTY_STRING
    4456         
    4557        // The Order with the Configuration Panel 
     
    5567        MLSLevel(Element e) 
    5668        { 
    57                 _name = e.getAttribute ("name"); 
    58                 _color = e.getAttribute ("color"); 
    59                 _range = e.getAttribute ("range"); 
    60                  
    61                 String sOrder = e.getAttribute ("order"); 
     69                _name = e.getAttribute (MLSLevel.NAME_ATTRIBUTE_NAME); 
     70                _color = e.getAttribute (MLSLevel.COLOR_ATTRIBUTE_NAME); 
     71                _range = e.getAttribute (MLSLevel.RANGE_ATTRIBUTE_NAME); 
     72                 
     73                String sOrder = e.getAttribute (MLSLevel.ORDER_ATTRIBUTE_NAME); 
    6274                 
    6375                try 
     
    197209        Element toXML(Document doc) 
    198210        { 
    199                 Element retValue = doc.createElement ("level"); 
    200                  
    201                 retValue.setAttribute ("name", _name); 
    202                 retValue.setAttribute ("color", _color); 
    203                 retValue.setAttribute ("range", _range); 
    204                 retValue.setAttribute ("order", "" + _order); 
     211                Element retValue = doc.createElement (MLSLevel.LEVEL_ELEMENT_NAME); 
     212                 
     213                retValue.setAttribute (MLSLevel.NAME_ATTRIBUTE_NAME, _name); 
     214                retValue.setAttribute (MLSLevel.COLOR_ATTRIBUTE_NAME, _color); 
     215                retValue.setAttribute (MLSLevel.RANGE_ATTRIBUTE_NAME, _range); 
     216                retValue.setAttribute (MLSLevel.ORDER_ATTRIBUTE_NAME, MLSLevel.EMPTY_STRING + _order); 
    205217                 
    206218                return retValue; 
  • branches/mls/framework-plugin/src/com/tresys/framework/compiler/mls/MLSSupport.java

    r1910 r1936  
    2121package com.tresys.framework.compiler.mls; 
    2222 
     23import java.io.BufferedOutputStream; 
    2324import java.io.File; 
    2425import java.io.FileInputStream; 
     
    2627import java.io.IOException; 
    2728import java.io.InputStream; 
    28 import java.util.ArrayList
     29import java.io.OutputStream
    2930import java.util.Collection; 
    3031import java.util.Enumeration; 
    3132import java.util.Hashtable; 
    3233import java.util.Iterator; 
    33 import java.util.List; 
    34  
    3534import javax.xml.parsers.DocumentBuilder; 
    3635import javax.xml.parsers.DocumentBuilderFactory; 
    3736import javax.xml.parsers.ParserConfigurationException; 
    38 import javax.xml.stream.XMLOutputFactory; 
    39 import javax.xml.stream.XMLStreamWriter; 
    4037import javax.xml.transform.OutputKeys; 
    4138import javax.xml.transform.Transformer; 
     
    5148import org.xml.sax.InputSource; 
    5249import org.xml.sax.SAXException; 
    53  
    54 //import com.sun.org.apache.xml.internal.serialize.OutputFormat; 
    55 //import com.sun.org.apache.xml.internal.serialize.XMLSerializer; 
    5650 
    5751/** 
     
    7569public class MLSSupport implements Collection 
    7670{ 
     71         
     72        private static final String XML_OUTPUT_TRANSFORMATION = "xml"; 
     73 
     74        private static final String INDENT_VALUE = "yes"; 
     75         
     76        private static final String STANDALONE_VALUE = "yes"; 
     77 
     78        private static final String MLS_ELEMENT_NAME = "mls"; 
     79 
     80        private static final String LEVEL_ELEMENT_NAME = "level"; 
     81 
    7782        // The file  
    7883        private File _file = null; 
     
    142147                // Prepare to iterate through the defined MLS Configuration data 
    143148                Element mls = doc.getDocumentElement (); 
    144                 NodeList nl = mls.getElementsByTagName ("level"); 
     149                NodeList nl = mls.getElementsByTagName (MLSSupport.LEVEL_ELEMENT_NAME); 
    145150                 
    146151                // iterate through the level definitions. 
     
    213218                         
    214219                        // Create the Document Element and assign it into the Document Object 
    215                         Element mls = doc.createElement ("mls"); 
     220                        Element mls = doc.createElement (MLSSupport.MLS_ELEMENT_NAME); 
    216221                        doc.appendChild (mls); 
    217222                         
     
    233238                        TransformerFactory tf = TransformerFactory.newInstance (); 
    234239                        Transformer t = tf.newTransformer (); 
    235                         t.setOutputProperty (OutputKeys.STANDALONE, "yes"); 
    236                         t.setOutputProperty (OutputKeys.METHOD, "xml");          
    237                         StreamResult sr = new StreamResult(_file);               
     240                        t.setOutputProperty (OutputKeys.STANDALONE, MLSSupport.STANDALONE_VALUE); 
     241                        t.setOutputProperty (OutputKeys.METHOD, MLSSupport.XML_OUTPUT_TRANSFORMATION); 
     242                        t.setOutputProperty (OutputKeys.INDENT, MLSSupport.INDENT_VALUE); 
     243                        if (!_file.exists ()) 
     244                        { 
     245                                _file.createNewFile (); 
     246                        } 
     247                        StreamResult sr = new StreamResult(_file); 
     248                        sr.setOutputStream (new FileOutputStream(_file, false)); 
    238249                        DOMSource ds = new DOMSource(doc); 
    239250                         
     
    241252                        t.transform (ds, sr); 
    242253                         
    243                         sr.getWriter ().close (); 
     254                        sr.getOutputStream ().close (); 
    244255                } 
    245256                catch (ParserConfigurationException pce) 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/DomainShape.java

    r1825 r1936  
    1919import org.eclipse.jface.wizard.Wizard; 
    2020import org.eclipse.swt.graphics.Image; 
     21import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor; 
    2122import org.eclipse.ui.views.properties.IPropertyDescriptor; 
    2223import org.eclipse.ui.views.properties.PropertyDescriptor; 
     
    4849        implements IDomainShape 
    4950{ 
     51        private static final String MLS_LEVEL_PROPERTY_NAME = "MLS Level"; 
     52 
    5053        private IPropertyDescriptor[] m_descriptors; 
    5154         
     
    118121                if (m_descriptors == null) 
    119122                { 
    120                         final int nStatPropCount = 1
     123                        final int nStatPropCount = 2
    121124                         
    122125                        Dictionary dictionary = getPolicy().getDictionary(); 
     
    163166                        myDescriptors[0].setAlwaysIncompatible(true); 
    164167                        myDescriptors[0].setCategory(PROP_SECTION_BASE); 
     168                         
     169                        // Fetch project to get the current MLS Level configuration definitions 
     170                        String [] values = new String [] { "mls-low", "mls-high"}; 
     171//                      myDescriptors[1] = new TextPropertyDescriptor(DomainShape.MLS_LEVEL_PROPERTY_NAME, Messages.mls_level); 
     172                        myDescriptors[1] = new ComboBoxPropertyDescriptor(DomainShape.MLS_LEVEL_PROPERTY_NAME, Messages.mls_level, values); 
     173                        myDescriptors[1].setCategory (PROP_SECTION_BASE); 
    165174         
    166175                        {                
     
    286295                { 
    287296                        return ((PathRdefEditContainer) propertyId).getPath((Domain) getComponent()); 
     297                } 
     298                 
     299                if (DomainShape.MLS_LEVEL_PROPERTY_NAME.equals (propertyId)) 
     300                { 
     301                        return "mls-low"; 
    288302                } 
    289303 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/Messages.java

    r1825 r1936  
    7070        public static String backflow_prop_description; 
    7171        public static String default_prop_description; 
     72         
     73        public static String mls_level; 
    7274} 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/messages.properties

    r1825 r1936  
    5555backflow_prop_description=Indicates how likely there is to be reverse information flow 
    5656default_prop_description=Indicates if this is using the default or selected access 
     57 
     58mls_level=MLS Level 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSSettingsProjProperties.java

    r1910 r1936  
    2222 
    2323 
     24import java.io.File; 
    2425import java.util.Arrays; 
    2526import java.util.Iterator; 
    2627 
     28import org.eclipse.core.resources.IFile; 
    2729import org.eclipse.core.resources.IProject; 
    2830import org.eclipse.core.resources.IResource; 
     
    3032import org.eclipse.core.runtime.IAdaptable; 
    3133import org.eclipse.core.runtime.CoreException; 
     34import org.eclipse.core.runtime.IPath; 
    3235import org.eclipse.core.runtime.preferences.IEclipsePreferences; 
    3336import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    3538import org.eclipse.jface.viewers.CellEditor; 
    3639import org.eclipse.jface.viewers.ColorCellEditor; 
     40import org.eclipse.jface.viewers.ComboViewer; 
    3741import org.eclipse.jface.viewers.ICellModifier; 
    38 import org.eclipse.jface.viewers.ILabelProviderListener
     42import org.eclipse.jface.viewers.ISelection
    3943import org.eclipse.jface.viewers.ITableLabelProvider; 
     44import org.eclipse.jface.viewers.LabelProvider; 
     45import org.eclipse.jface.viewers.StructuredSelection; 
    4046import org.eclipse.jface.viewers.TableViewer; 
    4147import org.eclipse.jface.viewers.TextCellEditor; 
     
    5359import org.eclipse.swt.layout.GridLayout; 
    5460import org.eclipse.swt.widgets.Button; 
    55 import org.eclipse.swt.widgets.Combo; 
    5661import org.eclipse.swt.widgets.Composite; 
    5762import org.eclipse.swt.widgets.Control; 
     
    8691{ 
    8792 
     93        private static final int LEVEL_DEFINITION_CONTROL_VERTICAL_SPACING = 2; 
     94        private static final int LEVEL_DEFINITION_CONTROL_COLUMN_LAYOUT = 4; 
     95        private static final int PAGE_VERTICAL_SPACING = 3; 
     96        private static final int PAGE_LAYOUT_COLUMNS = 1; 
     97        private static final int RANGE_COLUMN_WIDTH = 200; 
     98        private static final int NAME_COLUMN_WIDTH = 200; 
     99        private static final int COLOR_COLUMN_WIDTH = 200; 
     100        private static final String DEFAULT_MLS_SYSTEM_HIGH_RANGE = "mls-systemhigh"; 
     101        private static final String DEFAULT_MLS_HIGH_COLOR_VALUE = "0xff0000"; 
     102        private static final String DEFAULT_MLS_HIGH_LEVEL_NAME = "mls-high"; 
     103        private static final String DEFAULT_MLS_LOW_COLOR_VALUE = "0xffffff"; 
     104        private static final String DEFAULT_MLS_SYSTEM_LOW_RANGE = "mls-systemlow"; 
     105        private static final String DEFAULT_MLS_LOW_LEVEL_NAME = "mls-low"; 
    88106        protected Table _table = null; 
    89107        protected TableViewer _ctv = null; 
     
    91109        protected Button _shiftUp = null; 
    92110        protected Button _shiftDown = null; 
    93         protected Combo _levelsDefault = null;  
     111        protected Button _removeLevel = null; 
     112//      protected Combo _levelsDefault = null;  
     113        protected ComboViewer _levelsDefault = null;  
    94114        protected IEclipsePreferences projPrefs = null; 
    95115 
     
    164184                setTitle (Messages.mls_settings); 
    165185                Composite composite = new Composite (parent, SWT.NONE); 
    166                 GridLayout layout = new GridLayout (1, false); 
    167                 layout.verticalSpacing = 3
     186                GridLayout layout = new GridLayout (MLSSettingsProjProperties.PAGE_LAYOUT_COLUMNS, false); 
     187                layout.verticalSpacing = MLSSettingsProjProperties.PAGE_VERTICAL_SPACING
    168188                composite.setLayout (layout); 
    169189                 
     
    185205                                        _shiftDown.setEnabled ((j + 1) != _levels.size ()); 
    186206                                         
     207                                        _removeLevel.setEnabled (true); 
    187208                                        return; 
    188209                                } 
     
    192213                // information within the table control 
    193214                TableColumn c2 = new TableColumn (_table, SWT.CENTER); 
    194                 c2.setText ("Color"); 
    195                 c2.setWidth (200); 
     215                c2.setText (Messages.color_column_header); 
     216                c2.setWidth (MLSSettingsProjProperties.COLOR_COLUMN_WIDTH); 
    196217 
    197218                TableColumn c3 = new TableColumn (_table, SWT.LEFT); 
    198                 c3.setText ("Name"); 
    199                 c3.setWidth (200); 
     219                c3.setText (Messages.name_column_header); 
     220                c3.setWidth (MLSSettingsProjProperties.NAME_COLUMN_WIDTH); 
    200221                 
    201222                TableColumn c4 = new TableColumn (_table, SWT.LEFT); 
    202                 c4.setText ("Range"); 
    203                 c4.setWidth (200); 
     223                c4.setText (Messages.range_column_header); 
     224                c4.setWidth (MLSSettingsProjProperties.RANGE_COLUMN_WIDTH); 
    204225                 
    205226                // Prepare to load the MLS Level configuration from the  
     
    216237                        { 
    217238                                // Establish a minimal MLS configuration  
    218                                 // if it can't be loaded from the file system.  
    219                                 _levels = new MLSSupport(fn.getSupportFolder ().getFile (FrameworkNature.MLS_CONFIGURATION_FILE).getFullPath ().toFile ().getAbsolutePath ()); 
    220          
    221                                 MLSLevel mls = new MLSLevel("mls-low"); 
    222                                 mls.setColor ("0xffffff"); 
    223                                 mls.setRange ("mls-system-low"); 
    224                                 mls.setOrder (0);                
     239                                // if it can't be loaded from the file system. 
     240                                IFile _if = fn.getSupportFolder ().getFile (FrameworkNature.MLS_CONFIGURATION_FILE); 
     241                                IPath ipFull = _if.getLocation (); 
     242                                File file = ipFull.toFile ();   
     243                                _levels = new MLSSupport(file.getAbsolutePath ()); 
     244         
     245                                MLSLevel mls = new MLSLevel(MLSSettingsProjProperties.DEFAULT_MLS_LOW_LEVEL_NAME); 
     246                                mls.setColor (MLSSettingsProjProperties.DEFAULT_MLS_LOW_COLOR_VALUE); 
     247                                mls.setRange (MLSSettingsProjProperties.DEFAULT_MLS_SYSTEM_LOW_RANGE); 
     248                                mls.setOrder (_levels.size ());          
    225249                                _levels.add (mls); 
    226250                                 
    227                                 mls = new MLSLevel("mls-high"); 
    228                                 mls.setColor ("0xff0000"); 
    229                                 mls.setRange ("mls-system-high"); 
    230                                 mls.setOrder (1);              
     251                                mls = new MLSLevel(MLSSettingsProjProperties.DEFAULT_MLS_HIGH_LEVEL_NAME); 
     252                                mls.setColor (MLSSettingsProjProperties.DEFAULT_MLS_HIGH_COLOR_VALUE); 
     253                                mls.setRange (MLSSettingsProjProperties.DEFAULT_MLS_SYSTEM_HIGH_RANGE); 
     254                                mls.setOrder (_levels.size ());                
    231255                                _levels.add (mls);                               
    232256                        } 
     
    239263                 
    240264                // Define the Column headers 
    241                 String[] names = new String[] { "Color", "Name", "Range" }; 
     265                String[] names = new String[] { Messages.color_column_header,  
     266                                                                                Messages.name_column_header,  
     267                                                                                Messages.range_column_header }; 
    242268                _ctv.setColumnProperties (names); 
    243269                 
     
    254280                // by the editors are reflected back in the data model  
    255281                // (Input object) 
    256                 _ctv.setCellModifier (new roleCellModifier ()); 
     282                _ctv.setCellModifier (new MLSCellModifier ()); 
    257283                 
    258284                // Define the objects which display the data within a cell 
    259                 _ctv.setLabelProvider (new TableLabelProvider()); 
     285                _ctv.setLabelProvider (new MLSTableLabelProvider()); 
    260286                 
    261287                // Define the object which knows how to convert the data model 
     
    280306                // associated with managing the MLS configuration 
    281307                Composite LevelControls = new Composite(composite, SWT.BORDER); 
    282                 GridLayout gl2 = new GridLayout(4, false); 
    283                 gl2.verticalSpacing = 2
     308                GridLayout gl2 = new GridLayout(MLSSettingsProjProperties.LEVEL_DEFINITION_CONTROL_COLUMN_LAYOUT, false); 
     309                gl2.verticalSpacing = MLSSettingsProjProperties.LEVEL_DEFINITION_CONTROL_VERTICAL_SPACING
    284310                LevelControls.setLayout (gl2); 
    285311                LevelControls.setLayoutData (new GridData (GridData.FILL_HORIZONTAL)); 
     
    291317                 
    292318                // Select the user's currently defined Default MLS Level  
    293                 String defaultMLSLevel = projPrefs.get (SEFPreferencePage.DEFAULT_MLS_LEVEL, "mls-low"); 
    294                 String[] levels = new String[_levels.size ()]; 
    295                  
    296                 // Define the list of possible levels to be selected as a default 
    297                 Iterator _iter = _levels.iterator (); 
    298                 int i = 0;               
    299                 while (_iter.hasNext ()) 
    300                 { 
    301                         levels[i++] =  ((MLSLevel)_iter.next ()) .getName (); 
    302                 } 
    303                                  
    304                 _levelsDefault = new Combo(LevelControls, SWT.DROP_DOWN | SWT.READ_ONLY);                
    305                 _levelsDefault.setItems (levels); 
    306                 _levelsDefault.select (_levelsDefault.indexOf (defaultMLSLevel)); 
     319                String defaultMLSLevel = projPrefs.get (SEFPreferencePage.DEFAULT_MLS_LEVEL, MLSSettingsProjProperties.DEFAULT_MLS_LOW_LEVEL_NAME); 
     320                                 
     321                _levelsDefault = new ComboViewer(LevelControls); 
     322                _levelsDefault.setLabelProvider (new MLSComboLabelProvider()); 
     323                _levelsDefault.setContentProvider (new ArrayContentProvider ()); 
     324                _levelsDefault.setInput (_levels); 
     325                _levelsDefault.setSelection (new StructuredSelection(_levels.getLevel (defaultMLSLevel))); 
    307326                 
    308327                // Define the controls for Adding a new MLS level 
     
    321340                                         
    322341                                        // Reset the Data Set for the table 
    323                                         _ctv.setInput (_levels);                                 
     342                                        _ctv.refresh (); 
     343                                        _levelsDefault.refresh (); 
    324344                                 
    325345                                        // Select it 
     
    333353                                        _shiftDown.setEnabled (false); 
    334354                                         
     355                                        _removeLevel.setEnabled (true); 
     356                                         
    335357                                        return; 
    336358                                } 
     
    340362                _shiftUp = new Button(LevelControls, SWT.BORDER); 
    341363                _shiftUp.setText (Messages.shift_up); 
     364                _shiftUp.setEnabled (false); 
    342365                _shiftUp.addSelectionListener (new SelectionAdapter()  
    343366                        { 
     
    355378                                         
    356379                                        // Reset the Data Set for the table 
    357                                         _ctv.setInput (_levels);                                 
     380                                        _ctv.refresh (); 
     381                                        _levelsDefault.refresh (); 
    358382                                 
    359383                                        // Reselect the level with which the user is working  
     
    370394                 
    371395                // Define a Button to allow the user to remove a MLS Level 
    372                 Button removeLevel = new Button(LevelControls, SWT.BORDER); 
    373                 removeLevel.setText (Messages.remove_level); 
    374                 removeLevel.addSelectionListener (new SelectionAdapter () 
     396                _removeLevel = new Button(LevelControls, SWT.BORDER); 
     397                _removeLevel.setText (Messages.remove_level); 
     398                _removeLevel.setEnabled (false); 
     399                _removeLevel.addSelectionListener (new SelectionAdapter () 
    375400                        { 
    376401                                public void widgetSelected(SelectionEvent e) 
     
    388413                                         
    389414                                        // Compress the ordering if necessary 
    390                                         MLSLevel[] lvls = new MLSLevel[_levels.size ()]; 
    391                                         _levels.toArray (lvls);                                  
    392                                         Arrays.sort (lvls, new MLSOrderingViewerComparator()); 
    393                                          
    394                                         for (j = 1; j < lvls.length; j++) 
     415                                        Iterator _iter = _levels.iterator (); 
     416                                         
     417                                        while (_iter.hasNext ()) 
    395418                                        { 
    396                                                 // Check if the adjacent pair of  
    397                                                 // levels are in consecutive order 
    398                                                 if (lvls[j-1].getOrder () != (lvls[j].getOrder () - 1)) 
     419                                                MLSLevel current = (MLSLevel)_iter.next (); 
     420                                                 
     421                                                if (current.getOrder () > mls.getOrder ()) 
    399422                                                { 
    400                                                         lvls[j].setOrder (lvls[j].getOrder () - 1); 
     423                                                        current.setOrder (current.getOrder () - 1); 
    401424                                                } 
    402425                                        } 
    403                                                                                          
     426                                         
     427                                        // Clean up the removed element 
     428                                        mls = null; 
     429                                         
    404430                                        // Reset the Data Set for the table 
    405                                         _ctv.setInput (_levels);                                 
     431                                        _ctv.refresh (); 
     432                                        _levelsDefault.refresh (); 
    406433                                 
    407434                                        return; 
     
    412439                _shiftDown = new Button(LevelControls, SWT.BORDER); 
    413440                _shiftDown.setText (Messages.shift_down); 
     441                _shiftDown.setEnabled (false); 
    414442                _shiftDown.addSelectionListener (new SelectionAdapter()  
    415443                        { 
     
    427455                                         
    428456                                        // Reset the Data Set for the table 
    429                                         _ctv.setInput (_levels);                                 
     457                                        _ctv.refresh (); 
     458                                        _levelsDefault.refresh (); 
    430459                                 
    431460                                        // Reselect the level with which the user is working  
     
    502531                try 
    503532                { 
    504                         // Define the User selected Default level 
    505                         this.projPrefs.put (SEFPreferencePage.DEFAULT_MLS_LEVEL, this._levelsDefault.getItem (this._levelsDefault.getSelectionIndex ())); 
    506                         projPrefs.flush (); 
    507                          
    508                         // Persist any changes to the configuration changes. 
    509                         this._levels.save (); 
     533                        ISelection is = this._levelsDefault.getSelection (); 
     534                        if (!is.isEmpty ()) 
     535                        { 
     536                                StructuredSelection ss = (StructuredSelection)is;                                
     537                                MLSLevel mls = (MLSLevel)ss.getFirstElement (); 
     538                                 
     539                                // Define the User selected Default level 
     540                                this.projPrefs.put (SEFPreferencePage.DEFAULT_MLS_LEVEL, mls.getName ()); 
     541                                 
     542                                projPrefs.flush (); 
     543                                 
     544                                // Persist any changes to the configuration changes. 
     545                                this._levels.save (); 
     546                        } 
    510547                } 
    511548                catch (BackingStoreException e) 
     
    552589                 
    553590                // Reset the Control to display the reloaded configurations 
    554                 this._ctv.setInput (this._levels); 
     591                _ctv.refresh (); 
     592                _levelsDefault.refresh (); 
    555593                 
    556594                // reload the default level settings  
    557                 String defaultMLSLevel = projPrefs.get (SEFPreferencePage.DEFAULT_MLS_LEVEL, "mls-low"); 
    558                 _levelsDefault.select (_levelsDefault.indexOf (defaultMLSLevel)); 
     595                String defaultMLSLevel = projPrefs.get (SEFPreferencePage.DEFAULT_MLS_LEVEL,  
     596                                                                                                MLSSettingsProjProperties.DEFAULT_MLS_LOW_LEVEL_NAME); 
     597                _levelsDefault.setSelection (new StructuredSelection(_levels.getLevel (defaultMLSLevel))); 
    559598 
    560599        } 
     
    570609    } 
    571610         
    572  
    573611    /** 
    574      * TableLabelProvider 
     612     * MLSComboLabelProvider 
     613     *  
     614     * An inner utility class responsible for helping out with the  
     615     * display of the data from an MLS Level Object 
     616     *  
     617     * @author jjarrett 
     618     * 
     619     */ 
     620    protected class MLSComboLabelProvider 
     621        extends LabelProvider 
     622        { 
     623         
     624        /** 
     625         * getText 
     626         *  
     627         * Returns the textual representation of an element within list of options 
     628         * of combobox drop down list. 
     629         *  
     630         *  @param element      - The data object to be presented to the user 
     631         *  @return                     - The string representation. 
     632         */ 
     633        public String getText(Object element)  
     634        { 
     635                MLSLevel mls = (MLSLevel)element; 
     636                 
     637                return mls.getName (); 
     638        } 
     639        } 
     640 
     641    /** 
     642     * MLSTableLabelProvider 
    575643     *  
    576644     * An inner utility class responsible for helping out with the 
     
    580648     * 
    581649     */ 
    582         protected class TableLabelProvider 
    583         implements ITableLabelProvider 
     650        protected class MLSTableLabelProvider 
     651                extends LabelProvider 
     652                implements ITableLabelProvider 
    584653        { 
    585654                /** 
     
    670739                        // reflected in the GUI. (May not actually be the case.) 
    671740                        return true; 
    672                 } 
    673          
    674                 /** 
    675                  * dispose 
    676                  *  
    677                  * required implementation by a base class. 
    678                  *  
    679                  */ 
    680                 public void dispose () 
    681                 {} 
    682          
    683                 /** 
    684                  * addListener 
    685                  *  
    686                  * required implementation by a base class  
    687                  */ 
    688                 public void addListener (ILabelProviderListener ipl) 
    689                 {} 
    690          
    691                 /** 
    692                  * addListener 
    693                  *  
    694                  * required implementation by a base class  
    695                  */ 
    696                 public void removeListener (ILabelProviderListener ipl) 
    697                 {} 
     741                }        
    698742        } 
    699743 
     
    707751         * 
    708752         */ 
    709         protected class roleCellModifier 
     753        protected class MLSCellModifier 
    710754        implements ICellModifier 
    711755        { 
     
    721765                 *  
    722766                 */ 
    723                 public roleCellModifier () 
     767                public MLSCellModifier () 
    724768                { 
    725769                } 
     
    759803                         
    760804                        // Determine which property is being requested 
    761                         if (roleCellModifier.COLOR_PROPERTY_NAME.equals (property)) 
     805                        if (MLSCellModifier.COLOR_PROPERTY_NAME.equals (property)) 
    762806                        { 
    763807                                retValue = MLSEclipseLevel.getColorRGB (mls); 
    764808                        } 
    765                         else if (roleCellModifier.NAME_PROPERTY_NAME.equals (property)) 
     809                        else if (MLSCellModifier.NAME_PROPERTY_NAME.equals (property)) 
    766810                        { 
    767811                                retValue = mls.getName (); 
    768812                        }  
    769                         else if (roleCellModifier.RANGE_PROPERTY_NAME.equals (property)) 
     813                        else if (MLSCellModifier.RANGE_PROPERTY_NAME.equals (property)) 
    770814                        { 
    771815                                retValue = mls.getRange (); 
     
    800844                         
    801845                        // Determine which property has changed 
    802                         if (roleCellModifier.COLOR_PROPERTY_NAME.equals (property)) 
     846                        if (MLSCellModifier.COLOR_PROPERTY_NAME.equals (property)) 
    803847                        { 
    804848                                // Update the Color Definition 
    805849                                MLSEclipseLevel.setColorInstance (mls, (RGB)value); 
    806850                        } 
    807                         else if (roleCellModifier.NAME_PROPERTY_NAME.equals (property)) 
     851                        else if (MLSCellModifier.NAME_PROPERTY_NAME.equals (property)) 
    808852                        { 
    809853                                // The Name was change so the key to it needs to be changed too 
     
    814858                                _levels.add (mls); 
    815859                        } 
    816                         else if (roleCellModifier.RANGE_PROPERTY_NAME.equals (property)) 
     860                        else if (MLSCellModifier.RANGE_PROPERTY_NAME.equals (property)) 
    817861                        { 
    818862                                mls.setRange (value.toString ()); 
     
    821865                        // force the viewer to update itself. 
    822866                        _ctv.refresh (); 
     867                        _levelsDefault.refresh (); 
    823868                         
    824869                        return; 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/preferences/Messages.java

    r1883 r1936  
    3030        public static String shift_down; 
    3131        public static String default_level; 
    32  
     32        public static String color_column_header; 
     33        public static String name_column_header; 
     34        public static String range_column_header; 
    3335         
    3436 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/preferences/messages.properties

    r1883 r1936  
    2424shift_down=Shift Down 
    2525default_level=Default Level 
     26color_column_header=Color 
     27name_column_header=Name 
     28range_column_header=Range 
    2629 
    2730## text editor preferences