Changeset 2116

Show
Ignore:
Timestamp:
05/13/08 15:15:31 (6 months ago)
Author:
npatrick
Message:

Completed New Network Resource Wizard.
Added properties to NetworkResource?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/Messages.java

    r1978 r2116  
    3131        public static String domain; 
    3232        public static String resource; 
     33        public static String network_resource; 
    3334 
    3435        public static String base_domain; 
     
    5455        public static String prop_abilities; 
    5556        public static String prop_base; 
     57        public static String prop_network_resource; 
    5658        public static String default_prop; 
    5759         
     
    7274         
    7375        public static String mls_level; 
     76         
     77        public static String network_type; 
     78        public static String network_local_device; 
     79        public static String network_local_ip_address; 
     80        public static String network_local_mask; 
     81        public static String network_local_ip_ports; 
     82        public static String network_local_encryption_type; 
     83        public static String network_remote_device; 
     84        public static String network_remote_ip_address; 
     85        public static String network_remote_mask; 
     86        public static String network_remote_ip_ports; 
     87        public static String network_protocol; 
    7488} 
  • branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/NetworkResourceShape.java

    r2111 r2116  
    5555 
    5656        public static final String RDEF_PROP = "Resource.RDEF"; //$NON-NLS-1$ 
     57        public static final String PROP_NETWORK_RESOURCE = Messages.prop_network_resource; 
     58         
     59        public static final String NETWORK_TYPE_PROP = "NetworkResource.NetworkType";                           //$NON-NLS-1$ 
     60        public static final String DISPLAY_NAME_NETWORK_TYPE = Messages.network_type; 
     61         
     62        public static final String NETWORK_LOCAL_DEVICE = "NetworkResource.LocalDevice"; 
     63        public static final String DISPLAY_NAME_NETWORK_LOCAL_DEVICE = Messages.network_local_device; 
     64         
     65        public static final String NETWORK_LOCAL_IP_ADDRESS = "NetworkResource.LocalIPAddress"; 
     66        public static final String DISPLAY_NAME_NETWORK_LOCAL_IP_ADDRESS = Messages.network_local_ip_address; 
     67 
     68        public static final String NETWORK_LOCAL_MASK = "NetworkResource.LocalMask"; 
     69        public static final String DISPLAY_NAME_NETWORK_LOCAL_MASK = Messages.network_local_mask; 
     70 
     71        public static final String NETWORK_LOCAL_IP_PORTS = "NetworkResource.LocalIPPorts"; 
     72        public static final String DISPLAY_NAME_NETWORK_LOCAL_IP_PORTS = Messages.network_local_ip_ports; 
     73 
     74        public static final String NETWORK_LOCAL_ENCRYPTION_TYPE = "NetworkResource.LocalEncryptionType"; 
     75        public static final String DISPLAY_NAME_NETWORK_LOCAL_ENCRYPTION_TYPE = Messages.network_local_encryption_type; 
     76 
     77        public static final String NETWORK_REMOTE_DEVICE = "NetworkResource.RemoteDevice"; 
     78        public static final String DISPLAY_NAME_NETWORK_REMOTE_DEVICE = Messages.network_remote_device; 
     79 
     80        public static final String NETWORK_REMOTE_IP_ADDRESS = "NetworkResource.RemoteIPAddress"; 
     81        public static final String DISPLAY_NAME_NETWORK_REMOTE_IP_ADDRESS = Messages.network_remote_ip_address; 
     82 
     83        public static final String NETWORK_REMOTE_MASK = "NetworkResource.RemoteMask"; 
     84        public static final String DISPLAY_NAME_NETWORK_REMOTE_MASK = Messages.network_remote_mask; 
     85 
     86        public static final String NETWORK_REMOTE_IP_PORTS = "NetworkResource.RemoteIPPorts"; 
     87        public static final String DISPLAY_NAME_NETWORK_REMOTE_IP_PORTS = Messages.network_remote_ip_ports; 
     88 
     89        public static final String NETWORK_PROTOCOL = "NetworkResource.Protocol"; 
     90        public static final String DISPLAY_NAME_NETWORK_PROTOCOL = Messages.network_protocol; 
    5791 
    5892        private IPropertyDescriptor[] m_descriptors = null; 
    5993        private Vector m_rdefs = null; 
     94         
     95        private String network_type; 
     96        private String local_device; 
     97        private String local_ip_address; 
     98        private String local_mask; 
     99        private String local_ip_ports; 
     100        private String local_encryption_type; 
     101        private String remote_device; 
     102        private String remote_ip_address; 
     103        private String remote_mask; 
     104        private String remote_ip_ports; 
     105        private String protocol; 
    60106 
    61107        public NetworkResourceShape (SELinuxSystem i_system) 
     
    117163        public String getType () 
    118164        { 
    119                 return "NetworkResource"; 
     165                return "Network Resource"; 
    120166        } 
    121167 
     
    127173        public Wizard getWizard () 
    128174        { 
    129                 return new NetworkResourceShapePropertyWizard(this); 
     175                return new NetworkResourceShapePropertyWizard (this); 
    130176        } 
    131177 
     
    177223                        } 
    178224 
    179                         PropertyDescriptor[] myDescriptors = new PropertyDescriptor[nStatPropCount + nRdefCount]; 
    180  
     225                        //PropertyDescriptor[] myDescriptors = new PropertyDescriptor[nStatPropCount + nRdefCount]; 
     226                        PropertyDescriptor[] myDescriptors; 
     227                         
     228                        if (this.network_type.equals ("ipsec")) 
     229                                myDescriptors = new PropertyDescriptor[nStatPropCount + 5]; 
     230                         
     231                        else 
     232                                myDescriptors = new PropertyDescriptor[nStatPropCount + 10]; 
     233 
     234                         
    181235                        // Set validator to be used by cell editor. When value not valid, 
    182236                        // message will be returned 
     
    195249                        } 
    196250 
    197                         Vector pathDescriptor = new Vector (); 
     251                        myDescriptors[2] = new PropertyDescriptor(NETWORK_TYPE_PROP, DISPLAY_NAME_NETWORK_TYPE); 
     252                        myDescriptors[2].setCategory (PROP_NETWORK_RESOURCE); 
     253 
     254                        if (this.network_type.equals ("ipsec")) 
     255                        { 
     256                                myDescriptors[3] = new TextPropertyDescriptor(NETWORK_LOCAL_IP_ADDRESS, DISPLAY_NAME_NETWORK_LOCAL_IP_ADDRESS); 
     257                                myDescriptors[3].setCategory (PROP_NETWORK_RESOURCE); 
     258 
     259                                myDescriptors[4] = new TextPropertyDescriptor(NETWORK_LOCAL_MASK, DISPLAY_NAME_NETWORK_LOCAL_MASK); 
     260                                myDescriptors[4].setCategory (PROP_NETWORK_RESOURCE); 
     261 
     262                                myDescriptors[5] = new TextPropertyDescriptor(NETWORK_LOCAL_IP_PORTS, DISPLAY_NAME_NETWORK_LOCAL_IP_PORTS); 
     263                                myDescriptors[5].setCategory (PROP_NETWORK_RESOURCE); 
     264                                 
     265                                myDescriptors[6] = new ComboBoxPropertyDescriptor(NETWORK_LOCAL_ENCRYPTION_TYPE, DISPLAY_NAME_NETWORK_LOCAL_ENCRYPTION_TYPE, (String[])GetNetworkEncryptionTypes ().toArray (new String[2])); 
     266                                myDescriptors[6].setCategory (PROP_NETWORK_RESOURCE); 
     267                        } 
     268                         
     269                        else 
     270                        { 
     271                                myDescriptors[3] = new TextPropertyDescriptor(NETWORK_LOCAL_DEVICE, DISPLAY_NAME_NETWORK_LOCAL_DEVICE); 
     272                                myDescriptors[3].setCategory (PROP_NETWORK_RESOURCE); 
     273 
     274                                myDescriptors[4] = new TextPropertyDescriptor(NETWORK_LOCAL_IP_ADDRESS, DISPLAY_NAME_NETWORK_LOCAL_IP_ADDRESS); 
     275                                myDescriptors[4].setCategory (PROP_NETWORK_RESOURCE); 
     276 
     277                                myDescriptors[5] = new TextPropertyDescriptor(NETWORK_LOCAL_MASK, DISPLAY_NAME_NETWORK_LOCAL_MASK); 
     278                                myDescriptors[5].setCategory (PROP_NETWORK_RESOURCE); 
     279 
     280                                myDescriptors[6] = new TextPropertyDescriptor(NETWORK_LOCAL_IP_PORTS, DISPLAY_NAME_NETWORK_LOCAL_IP_PORTS); 
     281                                myDescriptors[6].setCategory (PROP_NETWORK_RESOURCE); 
     282 
     283                                myDescriptors[7] = new TextPropertyDescriptor(NETWORK_REMOTE_DEVICE, DISPLAY_NAME_NETWORK_REMOTE_DEVICE); 
     284                                myDescriptors[7].setCategory (PROP_NETWORK_RESOURCE); 
     285 
     286                                myDescriptors[8] = new TextPropertyDescriptor(NETWORK_REMOTE_IP_ADDRESS, DISPLAY_NAME_NETWORK_REMOTE_IP_ADDRESS); 
     287                                myDescriptors[8].setCategory (PROP_NETWORK_RESOURCE); 
     288 
     289                                myDescriptors[9] = new TextPropertyDescriptor(NETWORK_REMOTE_MASK, DISPLAY_NAME_NETWORK_REMOTE_MASK); 
     290                                myDescriptors[9].setCategory (PROP_NETWORK_RESOURCE); 
     291 
     292                                myDescriptors[10] = new TextPropertyDescriptor(NETWORK_REMOTE_IP_PORTS, DISPLAY_NAME_NETWORK_REMOTE_IP_PORTS); 
     293                                myDescriptors[10].setCategory (PROP_NETWORK_RESOURCE); 
     294 
     295                                myDescriptors[11] = new ComboBoxPropertyDescriptor(NETWORK_PROTOCOL, DISPLAY_NAME_NETWORK_PROTOCOL, (String[])GetNetworkProtcols ().toArray (new String[2])); 
     296                                myDescriptors[11].setCategory (PROP_NETWORK_RESOURCE); 
     297                        } 
     298 
     299                         
     300                        //Vector pathDescriptor = new Vector (); 
    198301                        NetworkResource comp = (NetworkResource) getComponent (); 
    199  
     302/* 
    200303                        { 
    201304                                Iterator itr = rdefs.iterator (); 
     
    234337                                .size ()]; 
    235338                        pathDescriptors = (PathPropertyDescriptor[]) pathDescriptor.toArray (pathDescriptors); 
    236  
    237                         m_descriptors = new IPropertyDescriptor[parentDescriptors.length + myDescriptors.length 
    238                                 + pathDescriptors.length]; 
     339*/ 
     340                        //m_descriptors = new IPropertyDescriptor[parentDescriptors.length + myDescriptors.length 
     341                                //+ pathDescriptors.length]; 
     342 
     343                        m_descriptors = new IPropertyDescriptor[parentDescriptors.length + myDescriptors.length]; 
     344 
    239345                        System.arraycopy (parentDescriptors, 0, m_descriptors, 0, parentDescriptors.length); 
     346                         
    240347                        System 
    241348                                .arraycopy (myDescriptors, 0, m_descriptors, parentDescriptors.length, myDescriptors.length); 
    242                         System.arraycopy (pathDescriptors, 0, m_descriptors, parentDescriptors.length 
    243                                 + myDescriptors.length, pathDescriptors.length); 
     349                         
     350                        //System.arraycopy (pathDescriptors, 0, m_descriptors, parentDescriptors.length 
     351                                //+ myDescriptors.length, pathDescriptors.length); 
    244352                } 
    245353 
     
    261369                } 
    262370 
     371                if (NETWORK_TYPE_PROP.equals (propertyId)) 
     372                        return this.network_type; 
     373                 
     374                if (NETWORK_LOCAL_DEVICE.equals (propertyId)) 
     375                        return this.local_device; 
     376                 
     377                if (NETWORK_LOCAL_IP_ADDRESS.equals (propertyId)) 
     378                        return this.local_ip_address; 
     379                 
     380                if (NETWORK_LOCAL_MASK.equals (propertyId)) 
     381                        return this.local_mask; 
     382                 
     383                if (NETWORK_LOCAL_IP_PORTS.equals (propertyId)) 
     384                        return this.local_ip_ports; 
     385                 
     386                if (NETWORK_LOCAL_ENCRYPTION_TYPE.equals (propertyId)) 
     387                        return this.local_encryption_type; 
     388                 
     389                if (NETWORK_REMOTE_DEVICE.equals (propertyId)) 
     390                        return this.remote_device; 
     391                 
     392                if (NETWORK_REMOTE_IP_ADDRESS.equals (propertyId)) 
     393                        return this.remote_ip_address; 
     394                 
     395                if (NETWORK_REMOTE_MASK.equals (propertyId)) 
     396                        return this.remote_mask; 
     397                 
     398                if (NETWORK_REMOTE_IP_PORTS.equals (propertyId)) 
     399                        return this.remote_ip_ports; 
     400                 
     401                if (NETWORK_PROTOCOL.equals (propertyId)) 
     402                        return this.protocol; 
     403                 
    263404                return super.getPropertyValue (propertyId); 
    264405        } 
     
    283424                                .setPath ((NetworkResource) getComponent (), (String) value); 
    284425                } 
     426                 
     427                else if (NETWORK_TYPE_PROP.equals (propertyId)) 
     428                { 
     429                        this.network_type = (String)value; 
     430                } 
     431                else if (NETWORK_LOCAL_DEVICE.equals (propertyId)) 
     432                        this.local_device = (String)value; 
     433                else if (NETWORK_LOCAL_IP_ADDRESS.equals (propertyId)) 
     434                        this.local_ip_address = (String)value; 
     435                else if (NETWORK_LOCAL_MASK.equals (propertyId)) 
     436                        this.local_mask = (String)value; 
     437                else if (NETWORK_LOCAL_IP_PORTS.equals (propertyId)) 
     438                        this.local_ip_ports = (String)value; 
     439                else if (NETWORK_LOCAL_ENCRYPTION_TYPE.equals (propertyId)) 
     440                        this.local_encryption_type = (String)value; 
     441                else if (NETWORK_REMOTE_DEVICE.equals (propertyId)) 
     442                        this.remote_device = (String)value; 
     443                else if (NETWORK_REMOTE_IP_ADDRESS.equals (propertyId)) 
     444                        this.remote_ip_address = (String)value; 
     445                else if (NETWORK_REMOTE_MASK.equals (propertyId)) 
     446                        this.remote_mask = (String)value; 
     447                else if (NETWORK_REMOTE_IP_PORTS.equals (propertyId)) 
     448                        this.remote_ip_ports = (String)value; 
     449                else if (NETWORK_PROTOCOL.equals (propertyId)) 
     450                        this.protocol = (String)value; 
    285451                else 
    286452                        super.setPropertyValue (propertyId, value); 
     453        } 
     454 
     455        public static Set GetNetworkEncryptionTypes () 
     456        { 
     457                HashSet encryptionTypes = new HashSet (); 
     458                encryptionTypes.add ("3des-cbc"); 
     459                encryptionTypes.add ("blowfish-cbc"); 
     460 
     461                return encryptionTypes; 
     462        } 
     463 
     464        public static Set GetNetworkProtcols () 
     465        { 
     466                HashSet protocols = new HashSet (); 
     467                protocols.add ("tcp"); 
     468                protocols.add ("udp"); 
     469 
     470                return protocols; 
    287471        } 
    288472 
  • branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/messages.properties

    r1978 r2116  
    1717resource=Resource 
    1818resource_defn=Resource Definition 
     19network_resource=Network Resource 
    1920 
    2021name=Name 
     
    4041prop_base=Base 
    4142default_prop=Default 
     43prop_network_resource=Network Resources 
    4244 
    4345category_boolean=Booleans 
     
    5759 
    5860mls_level=MLS Level 
     61 
     62network_type=Network Type 
     63network_local_device=Local Network Device 
     64network_local_ip_address=Local IP Address 
     65network_local_mask=Local Mask 
     66network_local_ip_ports=Local IP Ports 
     67network_local_encryption_type=Encryption Type 
     68network_remote_device=Remote Network Device 
     69network_remote_ip_address=Remote IP Address 
     70network_remote_mask=Remote Mask 
     71network_remote_ip_ports=Remote IP Ports 
     72network_protocol=Protocol 
  • branches/networking/src/com/tresys/framework/plugin/wizards/shape/Messages.java

    r2110 r2116  
    5353        public static String NetworkResourcePropertyPage_ip_mask; 
    5454        public static String NetworkResourcePropertyPage_ip_ports; 
     55        public static String NetworkResourcePropertyPage_Protocol; 
    5556        public static String NetworkResourcePropertyPage_bad_ip_ports; 
    5657        public static String NetworkResourcePropertyPage_bad_ip_mask; 
  • branches/networking/src/com/tresys/framework/plugin/wizards/shape/NetworkResourceShapePropertyPage.java

    r2111 r2116  
    11package com.tresys.framework.plugin.wizards.shape; 
    22 
     3import java.lang.reflect.*; 
    34import java.util.regex.*; 
    45import org.eclipse.jface.viewers.ArrayContentProvider; 
     
    2324import org.eclipse.swt.widgets.Text; 
    2425import org.eclipse.swt.widgets.Group; 
     26import org.eclipse.swt.widgets.Shell; 
     27import org.eclipse.swt.widgets.Canvas; 
    2528 
    2629import com.tresys.framework.compiler.dictionary.INameValue; 
     
    3336        extends WizardPage 
    3437{ 
    35  
     38        private static final String FIELD_LOCAL_DEVICE = "localDevice"; 
     39        private static final String FIELD_LOCAL_IP_ADDRESS = "localIPAddress"; 
     40        private static final String FIELD_LOCAL_MASK = "localMask"; 
     41        private static final String FIELD_LOCAL_IP_PORTS = "localIPPorts"; 
     42        private static final String FIELD_LOCAL_ENCRYPTION_TYPE = "localEncryptionType"; 
     43         
     44        private static final String FIELD_REMOTE_DEVICE = "remoteDevice"; 
     45        private static final String FIELD_REMOTE_IP_ADDRESS = "remoteIPAddress"; 
     46        private static final String FIELD_REMOTE_MASK = "remoteMask"; 
     47        private static final String FIELD_REMOTE_IP_PORTS = "remoteIPPorts"; 
     48         
     49        private static final String FIELD_PROTOCOL = "protocol"; 
     50         
    3651        private ComboViewer m_combo; 
    3752        private NetworkResourceShape m_shape; 
     
    4156        private Group localDetails = null; 
    4257        private Group remoteDetails = null; 
     58        private Composite detailsCanvas = null; 
     59         
     60        public String localDevice = new String(); 
     61        public String localIPAddress = new String(); 
     62        public String localMask = new String(); 
     63        public String localIPPorts = new String(); 
     64        public String localEncryptionType = new String(); 
     65         
     66        public String remoteDevice = new String(); 
     67        public String remoteIPAddress = new String(); 
     68        public String remoteMask = new String(); 
     69        public String remoteIPPorts = new String(); 
     70         
     71        public String protocol = new String(); 
    4372 
    4473        public NetworkResourceShapePropertyPage (NetworkResourceShape i_shape) 
     
    5180        public void createControl(Composite parent) 
    5281        { 
     82                Shell shell = this.getShell (); 
     83                shell.setSize (500,440); 
     84 
    5385                m_composite = new Composite (parent, SWT.NONE); 
    5486                 
     
    5890                GridLayout layout = new GridLayout(); 
    5991                layout.numColumns = 2; 
    60                 layout.verticalSpacing = 0
     92                layout.verticalSpacing = 7
    6193                m_composite.setLayout(layout); 
    6294                 
     
    137169        }        
    138170 
    139         protected class VerifyIPAddressListener implements ModifyListener 
     171        protected class ModifyValueListener 
     172        { 
     173                private String ipVar; 
     174                private NetworkResourceShapePropertyPage page; 
     175 
     176                public ModifyValueListener(NetworkResourceShapePropertyPage Page, String IPVar) 
     177                { 
     178                        super(); 
     179                        this.page = Page; 
     180                        this.ipVar = IPVar; 
     181                } 
     182                 
     183                public void modifyValue(Object value) 
     184                { 
     185                        try 
     186                        { 
     187                                Field f = page.getClass ().getDeclaredField (ipVar); 
     188                                f.set(this.page, value); 
     189                        } 
     190                         
     191                        catch (Exception ex) {} 
     192                } 
     193                 
     194        } 
     195         
     196        protected class ChangeComboValueListener extends ModifyValueListener implements ISelectionChangedListener 
     197        { 
     198                public ChangeComboValueListener(NetworkResourceShapePropertyPage Page, String IPVar) 
     199                { 
     200                        super(Page, IPVar); 
     201                } 
     202 
     203                public void selectionChanged (SelectionChangedEvent event) 
     204                { 
     205                        IStructuredSelection selection = (IStructuredSelection) event.getSelection (); 
     206                        if (selection != null) 
     207                        { 
     208                                String value = (String)selection.getFirstElement (); 
     209                                modifyValue (value); 
     210                        } 
     211 
     212                } 
     213        } 
     214         
     215        protected class ModifyTextValueListener extends ModifyValueListener implements ModifyListener 
     216        { 
     217 
     218                public ModifyTextValueListener(NetworkResourceShapePropertyPage Page, String IPVar) 
     219                { 
     220                        super(Page, IPVar); 
     221                } 
     222 
     223                public void modifyText(ModifyEvent e) 
     224                { 
     225                        String s = ((Text) e.widget).getText(); 
     226 
     227                        modifyValue (s); 
     228                } 
     229 
     230        } 
     231         
     232        protected class VerifyIPAddressListener extends ModifyTextValueListener 
    140233        { 
    141234                private String errorMessage; 
    142235                 
    143                 public VerifyIPAddressListener(String ErrorMessage) 
    144                 { 
    145                         super(); 
     236                public VerifyIPAddressListener(NetworkResourceShapePropertyPage Page, String IPVar, String ErrorMessage) 
     237                { 
     238                        super(Page, IPVar); 
    146239                        this.errorMessage = ErrorMessage; 
    147240                } 
     
    151244                        String s = ((Text) e.widget).getText(); 
    152245 
     246                        modifyValue (s); 
     247                         
    153248                        if (!Pattern.matches (Messages.NetworkResource_ipv4_address_pattern, s) && 
    154249                                !Pattern.matches(Messages.NetworkResource_ipv6_address_pattern, s)) 
     
    156251                         
    157252                        else 
    158                                 updateStatus(null); 
    159                 } 
    160         } 
    161          
    162         protected class VerifyIPPortsListener implements ModifyListener 
    163         { 
     253                                updateStatus(null);                      
     254                } 
     255        } 
     256         
     257        protected class VerifyIPPortsListener extends ModifyTextValueListener 
     258        { 
     259                public VerifyIPPortsListener(NetworkResourceShapePropertyPage Page, String IPVar) 
     260                { 
     261                        super(Page, IPVar); 
     262                } 
     263                 
    164264                public void modifyText(ModifyEvent e) 
    165265                { 
    166266                        String s = ((Text) e.widget).getText (); 
     267                         
     268                        modifyValue (s); 
    167269                         
    168270                        if (!Pattern.matches (Messages.NetworkResource_ip_ports_pattern, s)) 
     
    181283 
    182284         
    183         private void removeGroup (Group group) 
     285        private void removeGroup (Composite group) 
    184286        { 
    185287                if (group != null) 
    186288                { 
    187289                        for (Widget control: group.getChildren ()) 
    188                                 control.dispose (); 
    189                  
     290                        { 
     291                                if (control.getClass () == Composite.class) 
     292                                        removeGroup((Composite)control); 
     293                                else 
     294                                        control.dispose (); 
     295                        } 
     296                         
    190297                        group.dispose (); 
    191298                } 
     
    197304        public void DialogChanged() 
    198305        { 
    199                 StructuredSelection sel = (StructuredSelection)m_combo.getSelection ();          
    200  
    201 //              if (sel.isEmpty ()) 
    202 //                      return; 
    203  
    204                 this.removeGroup(this.localDetails); 
    205                 this.removeGroup(this.remoteDetails); 
     306                StructuredSelection sel = (StructuredSelection)m_combo.getSelection (); 
     307 
     308                this.removeGroup(this.detailsCanvas); 
     309                 
     310                this.detailsCanvas = new Composite(this.m_composite, SWT.NULL); 
     311                { 
     312                        GridData layoutData = new GridData (GridData.FILL_HORIZONTAL | GridData.GRAB_VERTICAL); 
     313                        layoutData.horizontalSpan = 2; 
     314 
     315                        this.detailsCanvas.setLayoutData (layoutData); 
     316                         
     317                        GridLayout gridLayout = new GridLayout(); 
     318                        gridLayout.numColumns = 2; 
     319                        this.detailsCanvas.setLayout (gridLayout);                       
     320                } 
    206321                 
    207322                this.localDetails = null; 
     
    213328                { 
    214329 
    215                         this.localDetails = new Group(this.m_composite, SWT.SHADOW_ETCHED_IN); 
     330                        this.localDetails = new Group(this.detailsCanvas, SWT.SHADOW_ETCHED_IN); 
    216331                        localDetails.setText (Messages.NetworkResourcePropertyPage_Local_Information); 
    217332                        GridData layoutData = new GridData (GridData.FILL_HORIZONTAL | GridData.GRAB_VERTICAL); 
     
    230345 
    231346                                ComboViewer combo = new ComboViewer (localDetails, SWT.DROP_DOWN | SWT.READ_ONLY); 
    232                                 //m_combo.setContentProvider (new ArrayContentProvider ()); 
    233                                 //m_combo.addSelectionChangedListener (new ChangeListener ());  
    234                  
    235                                 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
     347                                combo.setContentProvider (new ArrayContentProvider ()); 
     348                                combo.addSelectionChangedListener (new ChangeComboValueListener (this, FIELD_LOCAL_ENCRYPTION_TYPE));  
     349                 
     350                                GridData sysData = new GridData(/*GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL*/); 
    236351                                combo.getCombo ().setLayoutData(sysData); 
    237                                 //m_combo.setInput (NetworkResourceShape.GetNetworkTypes ());                           
     352                                combo.setInput (NetworkResourceShape.GetNetworkEncryptionTypes ()); 
    238353                        } 
    239354                         
     
    244359 
    245360                                Text ip = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
    246                                 ip.addModifyListener (new VerifyIPAddressListener(Messages.NetworkResourcePropertyPage_bad_ip_address));                               
     361                                ip.addModifyListener (new VerifyIPAddressListener(this, FIELD_LOCAL_IP_ADDRESS, Messages.NetworkResourcePropertyPage_bad_ip_address));                                 
    247362                                GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    248363                                ip.setLayoutData(sysData); 
    249                         } 
     364                                ip.setText (this.localIPAddress); 
     365
    250366 
    251367                        //For IP Mask 
     
    255371 
    256372                                Text mask = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
    257                                 mask.addModifyListener (new VerifyIPAddressListener(Messages.NetworkResourcePropertyPage_bad_ip_mask)); 
     373                                mask.addModifyListener (new VerifyIPAddressListener(this, FIELD_LOCAL_MASK, Messages.NetworkResourcePropertyPage_bad_ip_mask)); 
    258374                                GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    259375                                mask.setLayoutData(sysData); 
    260                         } 
     376                                mask.setText (this.localMask); 
     377
    261378 
    262379                        //For IP Ports 
     
    266383 
    267384                                Text ports = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
    268                                 ports.addModifyListener (new VerifyIPPortsListener()); 
     385                                ports.addModifyListener (new VerifyIPPortsListener(this, FIELD_LOCAL_IP_PORTS)); 
    269386                                GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    270387                                ports.setLayoutData(sysData); 
     
    274391                else if (networkType != null && networkType.equals("secmark")) 
    275392                { 
    276                         this.localDetails = new Group(this.m_composite, SWT.SHADOW_ETCHED_IN); 
     393                        this.localDetails = new Group(this.detailsCanvas, SWT.SHADOW_ETCHED_IN); 
    277394                        localDetails.setText (Messages.NetworkResourcePropertyPage_Local_Information); 
    278395                        { 
     
    282399                                gridLayout.numColumns = 2; 
    283400                                this.localDetails.setLayout (gridLayout); 
     401 
     402                                //For Local Network Device 
     403                                { 
     404                                        Label label = new Label (localDetails, SWT.NULL); 
     405                                        label.setText (Messages.NetworkResourcePropertyPage_Local_Device); 
     406 
     407                                        Text device = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
     408                                        device.addModifyListener (new ModifyTextValueListener(this, FIELD_LOCAL_DEVICE)); 
     409                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
     410                                        device.setLayoutData(sysData); 
     411                                } 
    284412                                 
    285413                                //For IP Address 
     
    289417 
    290418                                        Text ip = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
    291                                         ip.addModifyListener (new VerifyIPAddressListener(Messages.NetworkResourcePropertyPage_bad_ip_address));                               
     419                                        ip.addModifyListener (new VerifyIPAddressListener(this, FIELD_LOCAL_IP_ADDRESS, Messages.NetworkResourcePropertyPage_bad_ip_address));                                 
    292420                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    293421                                        ip.setLayoutData(sysData); 
     422                                        ip.setText (this.localIPAddress); 
    294423                                } 
    295424 
     
    300429 
    301430                                        Text mask = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
    302                                         mask.addModifyListener (new VerifyIPAddressListener(Messages.NetworkResourcePropertyPage_bad_ip_mask)); 
     431                                        mask.addModifyListener (new VerifyIPAddressListener(this, FIELD_LOCAL_MASK, Messages.NetworkResourcePropertyPage_bad_ip_mask)); 
    303432                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    304433                                        mask.setLayoutData(sysData); 
     434                                        mask.setText (this.localMask); 
    305435                                } 
    306436 
     
    311441 
    312442                                        Text ports = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 
    313                                         ports.addModifyListener (new VerifyIPPortsListener()); 
     443                                        ports.addModifyListener (new VerifyIPPortsListener(this, FIELD_LOCAL_IP_PORTS)); 
    314444                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    315445                                        ports.setLayoutData(sysData); 
     
    318448                        } 
    319449                         
    320                         this.remoteDetails = new Group(this.m_composite, SWT.SHADOW_ETCHED_IN); 
     450                        this.remoteDetails = new Group(this.detailsCanvas, SWT.SHADOW_ETCHED_IN); 
    321451                        remoteDetails.setText (Messages.NetworkResourcePropertyPage_Remote_Information); 
    322452                        { 
     
    327457                                this.remoteDetails.setLayout (gridLayout); 
    328458                                 
     459                                //For Remote Network Device 
     460                                { 
     461                                        Label label = new Label (remoteDetails, SWT.NULL); 
     462                                        label.setText (Messages.NetworkResourcePropertyPage_Remote_Device); 
     463 
     464                                        Text device = new Text(remoteDetails, SWT.BORDER | SWT.SINGLE); 
     465                                        device.addModifyListener (new ModifyTextValueListener(this, FIELD_REMOTE_DEVICE)); 
     466                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
     467                                        device.setLayoutData(sysData); 
     468                                } 
     469 
    329470                                //For IP Address 
    330471                                { 
     
    333474 
    334475                                        Text ip = new Text(remoteDetails, SWT.BORDER | SWT.SINGLE); 
    335                                         ip.addModifyListener (new VerifyIPAddressListener(Messages.NetworkResourcePropertyPage_bad_ip_address));                               
     476                                        ip.addModifyListener (new VerifyIPAddressListener(this, FIELD_REMOTE_IP_ADDRESS, Messages.NetworkResourcePropertyPage_bad_ip_address));                                
    336477                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    337478                                        ip.setLayoutData(sysData); 
     479                                        ip.setText (this.remoteIPAddress); 
    338480                                } 
    339481 
     
    344486 
    345487                                        Text mask = new Text(remoteDetails, SWT.BORDER | SWT.SINGLE); 
    346                                         mask.addModifyListener (new VerifyIPAddressListener(Messages.NetworkResourcePropertyPage_bad_ip_mask)); 
     488                                        mask.addModifyListener (new VerifyIPAddressListener(this, FIELD_REMOTE_MASK, Messages.NetworkResourcePropertyPage_bad_ip_mask)); 
    347489                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    348490                                        mask.setLayoutData(sysData); 
     491                                        mask.setText (this.remoteMask); 
    349492                                } 
    350493 
     
    355498 
    356499                                        Text ports = new Text(remoteDetails, SWT.BORDER | SWT.SINGLE); 
    357                                         ports.addModifyListener (new VerifyIPPortsListener()); 
     500                                        ports.addModifyListener (new VerifyIPPortsListener(this, FIELD_REMOTE_IP_PORTS)); 
    358501                                        GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 
    359502                                        ports.setLayoutData(sysData); 
    360503                                } 
    361  
    362                         } 
    363  
     504                        } 
     505                         
     506                        // For Protocol 
     507                        { 
     508                                Canvas canvas = new Canvas (detailsCanvas, SWT.NULL); 
     509                                { 
     510                                        GridData layoutData = new GridData (GridData.FILL_HORIZONTAL | GridData.GRAB_VERTICAL); 
     511                                        layoutData.horizontalSpan = 2; 
     512 
     513                    &nb