Changeset 2116
- Timestamp:
- 05/13/08 15:15:31 (6 months ago)
- Files:
-
- branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/Messages.java (modified) (3 diffs)
- branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/NetworkResourceShape.java (modified) (8 diffs)
- branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/messages.properties (modified) (3 diffs)
- branches/networking/src/com/tresys/framework/plugin/wizards/shape/Messages.java (modified) (1 diff)
- branches/networking/src/com/tresys/framework/plugin/wizards/shape/NetworkResourceShapePropertyPage.java (modified) (27 diffs)
- branches/networking/src/com/tresys/framework/plugin/wizards/shape/NetworkResourceShapePropertyWizard.java (modified) (1 diff)
- branches/networking/src/com/tresys/framework/plugin/wizards/shape/messages.properties (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/Messages.java
r1978 r2116 31 31 public static String domain; 32 32 public static String resource; 33 public static String network_resource; 33 34 34 35 public static String base_domain; … … 54 55 public static String prop_abilities; 55 56 public static String prop_base; 57 public static String prop_network_resource; 56 58 public static String default_prop; 57 59 … … 72 74 73 75 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; 74 88 } branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/NetworkResourceShape.java
r2111 r2116 55 55 56 56 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; 57 91 58 92 private IPropertyDescriptor[] m_descriptors = null; 59 93 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; 60 106 61 107 public NetworkResourceShape (SELinuxSystem i_system) … … 117 163 public String getType () 118 164 { 119 return "Network Resource";165 return "Network Resource"; 120 166 } 121 167 … … 127 173 public Wizard getWizard () 128 174 { 129 return new NetworkResourceShapePropertyWizard (this);175 return new NetworkResourceShapePropertyWizard (this); 130 176 } 131 177 … … 177 223 } 178 224 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 181 235 // Set validator to be used by cell editor. When value not valid, 182 236 // message will be returned … … 195 249 } 196 250 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 (); 198 301 NetworkResource comp = (NetworkResource) getComponent (); 199 302 /* 200 303 { 201 304 Iterator itr = rdefs.iterator (); … … 234 337 .size ()]; 235 338 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 239 345 System.arraycopy (parentDescriptors, 0, m_descriptors, 0, parentDescriptors.length); 346 240 347 System 241 348 .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); 244 352 } 245 353 … … 261 369 } 262 370 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 263 404 return super.getPropertyValue (propertyId); 264 405 } … … 283 424 .setPath ((NetworkResource) getComponent (), (String) value); 284 425 } 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; 285 451 else 286 452 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; 287 471 } 288 472 branches/networking/src/com/tresys/framework/plugin/editor/policy/graphic/model/messages.properties
r1978 r2116 17 17 resource=Resource 18 18 resource_defn=Resource Definition 19 network_resource=Network Resource 19 20 20 21 name=Name … … 40 41 prop_base=Base 41 42 default_prop=Default 43 prop_network_resource=Network Resources 42 44 43 45 category_boolean=Booleans … … 57 59 58 60 mls_level=MLS Level 61 62 network_type=Network Type 63 network_local_device=Local Network Device 64 network_local_ip_address=Local IP Address 65 network_local_mask=Local Mask 66 network_local_ip_ports=Local IP Ports 67 network_local_encryption_type=Encryption Type 68 network_remote_device=Remote Network Device 69 network_remote_ip_address=Remote IP Address 70 network_remote_mask=Remote Mask 71 network_remote_ip_ports=Remote IP Ports 72 network_protocol=Protocol branches/networking/src/com/tresys/framework/plugin/wizards/shape/Messages.java
r2110 r2116 53 53 public static String NetworkResourcePropertyPage_ip_mask; 54 54 public static String NetworkResourcePropertyPage_ip_ports; 55 public static String NetworkResourcePropertyPage_Protocol; 55 56 public static String NetworkResourcePropertyPage_bad_ip_ports; 56 57 public static String NetworkResourcePropertyPage_bad_ip_mask; branches/networking/src/com/tresys/framework/plugin/wizards/shape/NetworkResourceShapePropertyPage.java
r2111 r2116 1 1 package com.tresys.framework.plugin.wizards.shape; 2 2 3 import java.lang.reflect.*; 3 4 import java.util.regex.*; 4 5 import org.eclipse.jface.viewers.ArrayContentProvider; … … 23 24 import org.eclipse.swt.widgets.Text; 24 25 import org.eclipse.swt.widgets.Group; 26 import org.eclipse.swt.widgets.Shell; 27 import org.eclipse.swt.widgets.Canvas; 25 28 26 29 import com.tresys.framework.compiler.dictionary.INameValue; … … 33 36 extends WizardPage 34 37 { 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 36 51 private ComboViewer m_combo; 37 52 private NetworkResourceShape m_shape; … … 41 56 private Group localDetails = null; 42 57 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(); 43 72 44 73 public NetworkResourceShapePropertyPage (NetworkResourceShape i_shape) … … 51 80 public void createControl(Composite parent) 52 81 { 82 Shell shell = this.getShell (); 83 shell.setSize (500,440); 84 53 85 m_composite = new Composite (parent, SWT.NONE); 54 86 … … 58 90 GridLayout layout = new GridLayout(); 59 91 layout.numColumns = 2; 60 layout.verticalSpacing = 0;92 layout.verticalSpacing = 7; 61 93 m_composite.setLayout(layout); 62 94 … … 137 169 } 138 170 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 140 233 { 141 234 private String errorMessage; 142 235 143 public VerifyIPAddressListener( String ErrorMessage)144 { 145 super( );236 public VerifyIPAddressListener(NetworkResourceShapePropertyPage Page, String IPVar, String ErrorMessage) 237 { 238 super(Page, IPVar); 146 239 this.errorMessage = ErrorMessage; 147 240 } … … 151 244 String s = ((Text) e.widget).getText(); 152 245 246 modifyValue (s); 247 153 248 if (!Pattern.matches (Messages.NetworkResource_ipv4_address_pattern, s) && 154 249 !Pattern.matches(Messages.NetworkResource_ipv6_address_pattern, s)) … … 156 251 157 252 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 164 264 public void modifyText(ModifyEvent e) 165 265 { 166 266 String s = ((Text) e.widget).getText (); 267 268 modifyValue (s); 167 269 168 270 if (!Pattern.matches (Messages.NetworkResource_ip_ports_pattern, s)) … … 181 283 182 284 183 private void removeGroup ( Groupgroup)285 private void removeGroup (Composite group) 184 286 { 185 287 if (group != null) 186 288 { 187 289 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 190 297 group.dispose (); 191 298 } … … 197 304 public void DialogChanged() 198 305 { 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 } 206 321 207 322 this.localDetails = null; … … 213 328 { 214 329 215 this.localDetails = new Group(this. m_composite, SWT.SHADOW_ETCHED_IN);330 this.localDetails = new Group(this.detailsCanvas, SWT.SHADOW_ETCHED_IN); 216 331 localDetails.setText (Messages.NetworkResourcePropertyPage_Local_Information); 217 332 GridData layoutData = new GridData (GridData.FILL_HORIZONTAL | GridData.GRAB_VERTICAL); … … 230 345 231 346 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*/); 236 351 combo.getCombo ().setLayoutData(sysData); 237 //m_combo.setInput (NetworkResourceShape.GetNetworkTypes ());352 combo.setInput (NetworkResourceShape.GetNetworkEncryptionTypes ()); 238 353 } 239 354 … … 244 359 245 360 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)); 247 362 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 248 363 ip.setLayoutData(sysData); 249 } 364 ip.setText (this.localIPAddress); 365 } 250 366 251 367 //For IP Mask … … 255 371 256 372 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)); 258 374 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 259 375 mask.setLayoutData(sysData); 260 } 376 mask.setText (this.localMask); 377 } 261 378 262 379 //For IP Ports … … 266 383 267 384 Text ports = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 268 ports.addModifyListener (new VerifyIPPortsListener( ));385 ports.addModifyListener (new VerifyIPPortsListener(this, FIELD_LOCAL_IP_PORTS)); 269 386 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 270 387 ports.setLayoutData(sysData); … … 274 391 else if (networkType != null && networkType.equals("secmark")) 275 392 { 276 this.localDetails = new Group(this. m_composite, SWT.SHADOW_ETCHED_IN);393 this.localDetails = new Group(this.detailsCanvas, SWT.SHADOW_ETCHED_IN); 277 394 localDetails.setText (Messages.NetworkResourcePropertyPage_Local_Information); 278 395 { … … 282 399 gridLayout.numColumns = 2; 283 400 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 } 284 412 285 413 //For IP Address … … 289 417 290 418 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)); 292 420 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 293 421 ip.setLayoutData(sysData); 422 ip.setText (this.localIPAddress); 294 423 } 295 424 … … 300 429 301 430 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)); 303 432 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 304 433 mask.setLayoutData(sysData); 434 mask.setText (this.localMask); 305 435 } 306 436 … … 311 441 312 442 Text ports = new Text(localDetails, SWT.BORDER | SWT.SINGLE); 313 ports.addModifyListener (new VerifyIPPortsListener( ));443 ports.addModifyListener (new VerifyIPPortsListener(this, FIELD_LOCAL_IP_PORTS)); 314 444 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 315 445 ports.setLayoutData(sysData); … … 318 448 } 319 449 320 this.remoteDetails = new Group(this. m_composite, SWT.SHADOW_ETCHED_IN);450 this.remoteDetails = new Group(this.detailsCanvas, SWT.SHADOW_ETCHED_IN); 321 451 remoteDetails.setText (Messages.NetworkResourcePropertyPage_Remote_Information); 322 452 { … … 327 457 this.remoteDetails.setLayout (gridLayout); 328 458 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 329 470 //For IP Address 330 471 { … … 333 474 334 475 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)); 336 477 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 337 478 ip.setLayoutData(sysData); 479 ip.setText (this.remoteIPAddress); 338 480 } 339 481 … … 344 486 345 487 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)); 347 489 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 348 490 mask.setLayoutData(sysData); 491 mask.setText (this.remoteMask); 349 492 } 350 493 … … 355 498 356 499 Text ports = new Text(remoteDetails, SWT.BORDER | SWT.SINGLE); 357 ports.addModifyListener (new VerifyIPPortsListener( ));500 ports.addModifyListener (new VerifyIPPortsListener(this, FIELD_REMOTE_IP_PORTS)); 358 501 GridData sysData = new GridData(GridData.FILL_HORIZONTAL| GridData.GRAB_HORIZONTAL); 359 502 ports.setLayoutData(sysData); 360 503 } 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
