Changeset 2117
- Timestamp:
- 05/13/08 15:58:20
(6 months ago)
- Author:
- npatrick
- Message:
Fixed a problem with the NetworkResource? property sheet.
Properties in comboboxes were not being displayed properly.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2116 |
r2117 |
|
| 10 | 10 | package com.tresys.framework.plugin.editor.policy.graphic.model; |
|---|
| 11 | 11 | |
|---|
| | 12 | import java.util.ArrayList; |
|---|
| 12 | 13 | import java.util.HashSet; |
|---|
| 13 | 14 | import java.util.Iterator; |
|---|
| … | … | |
| 73 | 74 | |
|---|
| 74 | 75 | public static final String NETWORK_LOCAL_ENCRYPTION_TYPE = "NetworkResource.LocalEncryptionType"; |
|---|
| | 76 | public static final String NETWORK_LOCAL_ENCRYPTION_TYPE_INDEX = "NetworkResource.LocalEncryptionTypeIndex"; |
|---|
| 75 | 77 | public static final String DISPLAY_NAME_NETWORK_LOCAL_ENCRYPTION_TYPE = Messages.network_local_encryption_type; |
|---|
| 76 | 78 | |
|---|
| … | … | |
| 88 | 90 | |
|---|
| 89 | 91 | public static final String NETWORK_PROTOCOL = "NetworkResource.Protocol"; |
|---|
| | 92 | public static final String NETWORK_PROTOCOL_INDEX = "NetworkResource.ProtocolIndex"; |
|---|
| 90 | 93 | public static final String DISPLAY_NAME_NETWORK_PROTOCOL = Messages.network_protocol; |
|---|
| 91 | 94 | |
|---|
| … | … | |
| 263 | 266 | myDescriptors[5].setCategory (PROP_NETWORK_RESOURCE); |
|---|
| 264 | 267 | |
|---|
| 265 | | myDescriptors[6] = new ComboBoxPropertyDescriptor(NETWORK_LOCAL_ENCRYPTION_TYPE, DISPLAY_NAME_NETWORK_LOCAL_ENCRYPTION_TYPE, (String[])GetNetworkEncryptionTypes ().toArray (new String[2])); |
|---|
| | 268 | myDescriptors[6] = new ComboBoxPropertyDescriptor(NETWORK_LOCAL_ENCRYPTION_TYPE_INDEX, DISPLAY_NAME_NETWORK_LOCAL_ENCRYPTION_TYPE, (String[])GetNetworkEncryptionTypes ().toArray (new String[2])); |
|---|
| 266 | 269 | myDescriptors[6].setCategory (PROP_NETWORK_RESOURCE); |
|---|
| 267 | 270 | } |
|---|
| … | … | |
| 293 | 296 | myDescriptors[10].setCategory (PROP_NETWORK_RESOURCE); |
|---|
| 294 | 297 | |
|---|
| 295 | | myDescriptors[11] = new ComboBoxPropertyDescriptor(NETWORK_PROTOCOL, DISPLAY_NAME_NETWORK_PROTOCOL, (String[])GetNetworkProtcols ().toArray (new String[2])); |
|---|
| | 298 | myDescriptors[11] = new ComboBoxPropertyDescriptor(NETWORK_PROTOCOL_INDEX, DISPLAY_NAME_NETWORK_PROTOCOL, (String[])GetNetworkProtcols ().toArray (new String[3])); |
|---|
| 296 | 299 | myDescriptors[11].setCategory (PROP_NETWORK_RESOURCE); |
|---|
| 297 | 300 | } |
|---|
| … | … | |
| 387 | 390 | return this.local_encryption_type; |
|---|
| 388 | 391 | |
|---|
| | 392 | if (NETWORK_LOCAL_ENCRYPTION_TYPE_INDEX.equals(propertyId)) |
|---|
| | 393 | return this.GetNetworkEncryptionIndex (); |
|---|
| | 394 | |
|---|
| 389 | 395 | if (NETWORK_REMOTE_DEVICE.equals (propertyId)) |
|---|
| 390 | 396 | return this.remote_device; |
|---|
| … | … | |
| 401 | 407 | if (NETWORK_PROTOCOL.equals (propertyId)) |
|---|
| 402 | 408 | return this.protocol; |
|---|
| | 409 | |
|---|
| | 410 | if (NETWORK_PROTOCOL_INDEX.equals(propertyId)) |
|---|
| | 411 | return this.GetNetworkProtocolIndex (); |
|---|
| 403 | 412 | |
|---|
| 404 | 413 | return super.getPropertyValue (propertyId); |
|---|
| … | … | |
| 439 | 448 | else if (NETWORK_LOCAL_ENCRYPTION_TYPE.equals (propertyId)) |
|---|
| 440 | 449 | this.local_encryption_type = (String)value; |
|---|
| | 450 | else if (NETWORK_LOCAL_ENCRYPTION_TYPE_INDEX.equals (propertyId)) |
|---|
| | 451 | this.SetNetworkEncryptionIndex (value); |
|---|
| 441 | 452 | else if (NETWORK_REMOTE_DEVICE.equals (propertyId)) |
|---|
| 442 | 453 | this.remote_device = (String)value; |
|---|
| … | … | |
| 449 | 460 | else if (NETWORK_PROTOCOL.equals (propertyId)) |
|---|
| 450 | 461 | this.protocol = (String)value; |
|---|
| | 462 | else if (NETWORK_PROTOCOL_INDEX.equals (propertyId)) |
|---|
| | 463 | this.SetNetworkProtocolIndex (value); |
|---|
| 451 | 464 | else |
|---|
| 452 | 465 | super.setPropertyValue (propertyId, value); |
|---|
| 453 | 466 | } |
|---|
| 454 | 467 | |
|---|
| | 468 | public Integer GetNetworkEncryptionIndex() |
|---|
| | 469 | { |
|---|
| | 470 | ArrayList list = new ArrayList(GetNetworkEncryptionTypes ()); |
|---|
| | 471 | return new Integer(list.indexOf (this.local_encryption_type)); |
|---|
| | 472 | } |
|---|
| | 473 | |
|---|
| | 474 | public void SetNetworkEncryptionIndex(Object index) |
|---|
| | 475 | { |
|---|
| | 476 | ArrayList list = new ArrayList(GetNetworkEncryptionTypes ()); |
|---|
| | 477 | this.local_encryption_type = (String) list.get ((Integer)index); |
|---|
| | 478 | } |
|---|
| | 479 | |
|---|
| | 480 | public Integer GetNetworkProtocolIndex() |
|---|
| | 481 | { |
|---|
| | 482 | ArrayList list = new ArrayList(GetNetworkProtcols()); |
|---|
| | 483 | return new Integer(list.indexOf (this.protocol)); |
|---|
| | 484 | } |
|---|
| | 485 | |
|---|
| | 486 | public void SetNetworkProtocolIndex(Object index) |
|---|
| | 487 | { |
|---|
| | 488 | ArrayList list = new ArrayList(GetNetworkProtcols()); |
|---|
| | 489 | this.protocol = (String) list.get ((Integer)index); |
|---|
| | 490 | } |
|---|
| | 491 | |
|---|
| 455 | 492 | public static Set GetNetworkEncryptionTypes () |
|---|
| 456 | 493 | { |
|---|
| … | … | |
| 465 | 502 | { |
|---|
| 466 | 503 | HashSet protocols = new HashSet (); |
|---|
| | 504 | protocols.add ("All"); |
|---|
| 467 | 505 | protocols.add ("tcp"); |
|---|
| 468 | 506 | protocols.add ("udp"); |
|---|
| r2116 |
r2117 |
|
| 62 | 62 | this.m_shape.setPropertyValue (NetworkResourceShape.NETWORK_REMOTE_IP_ADDRESS, m_page1.remoteIPAddress); |
|---|
| 63 | 63 | this.m_shape.setPropertyValue (NetworkResourceShape.NETWORK_REMOTE_MASK, m_page1.remoteMask); |
|---|
| | 64 | this.m_shape.setPropertyValue (NetworkResourceShape.NETWORK_REMOTE_IP_PORTS, m_page1.remoteIPPorts); |
|---|
| 64 | 65 | this.m_shape.setPropertyValue (NetworkResourceShape.NETWORK_PROTOCOL, m_page1.protocol); |
|---|
| 65 | 66 | |
|---|
Download in other formats:
* Generating other formats may take time.