1 19 20 package org.netbeans.modules.j2ee.deployment.impl.ui; 21 22 import java.awt.CardLayout ; 23 import java.awt.Component ; 24 import java.awt.Container ; 25 import java.awt.Dialog ; 26 import java.awt.Dimension ; 27 import java.awt.GridBagConstraints ; 28 import java.awt.GridBagLayout ; 29 import java.awt.Image ; 30 import java.awt.Window ; 31 import java.beans.PropertyChangeListener ; 32 import java.beans.PropertyChangeEvent ; 33 import java.beans.PropertyVetoException ; 34 import java.beans.VetoableChangeListener ; 35 import java.util.ArrayList ; 36 import java.util.Collection ; 37 import java.util.Collections ; 38 import java.util.HashMap ; 39 import java.util.Iterator ; 40 import java.util.List ; 41 import java.util.Set ; 42 import javax.swing.UIManager ; 43 import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; 44 import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; 45 import org.netbeans.modules.j2ee.deployment.impl.ui.wizard.AddServerInstanceWizard; 46 import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; 47 import org.openide.nodes.Node; 48 import org.openide.explorer.ExplorerManager; 49 import org.openide.explorer.view.BeanTreeView; 50 import org.openide.DialogDisplayer; 51 import org.openide.WizardDescriptor; 52 import org.openide.filesystems.Repository; 53 import org.openide.loaders.DataFolder; 54 import org.openide.nodes.AbstractNode; 55 import org.openide.nodes.Children; 56 import org.openide.nodes.FilterNode; 57 import org.openide.util.NbBundle; 58 59 60 61 67 public class ServersCustomizer extends javax.swing.JPanel implements PropertyChangeListener , VetoableChangeListener , ExplorerManager.Provider { 68 69 private static final Dimension MINIMUM_SIZE = new Dimension (720, 400); 70 71 private ServerCategoriesChildren children; 72 private ExplorerManager manager; 73 private ServerInstance initialInstance; 74 75 76 public ServersCustomizer(ServerInstance initialInstance) { 77 initComponents(); 78 serverName.setColumns(30); 79 serverType.setColumns(30); 80 servers.setPreferredSize(new Dimension (200,200)); 82 this.initialInstance = initialInstance; 83 setPreferredSize(MINIMUM_SIZE); 84 } 85 86 87 public void propertyChange(PropertyChangeEvent evt) { 88 if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) { 89 Node[] nodes = (Node[]) evt.getNewValue(); 90 if (nodes.length!=1) { 91 selectServer(null); 92 } else { 93 selectServer(nodes[0]); 94 } 95 } 96 } 97 98 public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException { 99 if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) { 100 Node[] nodes = (Node[]) evt.getNewValue(); 101 if (nodes.length>1) { 102 throw new PropertyVetoException ("Invalid length",evt); } 104 } 105 } 106 107 public synchronized ExplorerManager getExplorerManager() { 108 if (this.manager == null) { 109 this.manager = new ExplorerManager(); 110 this.manager.setRootContext(new AbstractNode(getChildren())); 111 this.manager.addPropertyChangeListener(this); 112 this.manager.addVetoableChangeListener(this); 113 } 114 return manager; 115 } 116 117 public void addNotify() { 118 super.addNotify(); 119 expandServers(initialInstance); 120 } 121 122 123 128 private void initComponents() { 130 java.awt.GridBagConstraints gridBagConstraints; 131 132 jPanel3 = new javax.swing.JPanel (); 133 servers = new PlatformsView (); 134 addButton = new javax.swing.JButton (); 135 removeButton = new javax.swing.JButton (); 136 cards = new javax.swing.JPanel (); 137 messageArea = new javax.swing.JPanel (); 138 jPanel1 = new javax.swing.JPanel (); 139 jLabel1 = new javax.swing.JLabel (); 140 serverName = new javax.swing.JTextField (); 141 jLabel2 = new javax.swing.JLabel (); 142 serverType = new javax.swing.JTextField (); 143 clientArea = new javax.swing.JPanel (); 144 serversLabel = new javax.swing.JLabel (); 145 146 setLayout(new java.awt.GridBagLayout ()); 147 148 servers.setBorder(null); 149 servers.setPreferredSize(new java.awt.Dimension (220, 400)); 150 gridBagConstraints = new java.awt.GridBagConstraints (); 151 gridBagConstraints.gridx = 0; 152 gridBagConstraints.gridy = 1; 153 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE; 154 gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; 155 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 156 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 157 gridBagConstraints.weighty = 1.0; 158 gridBagConstraints.insets = new java.awt.Insets (3, 12, 6, 6); 159 add(servers, gridBagConstraints); 160 servers.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_InstalledServers")); servers.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_InstalledServers")); 163 org.openide.awt.Mnemonics.setLocalizedText(addButton, NbBundle.getMessage(ServersCustomizer.class, "CTL_AddServer")); addButton.addActionListener(new java.awt.event.ActionListener () { 165 public void actionPerformed(java.awt.event.ActionEvent evt) { 166 addServer(evt); 167 } 168 }); 169 gridBagConstraints = new java.awt.GridBagConstraints (); 170 gridBagConstraints.gridx = 0; 171 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 172 gridBagConstraints.insets = new java.awt.Insets (6, 12, 12, 0); 173 add(addButton, gridBagConstraints); 174 addButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_AddServer")); addButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_AddServer")); 177 org.openide.awt.Mnemonics.setLocalizedText(removeButton, NbBundle.getMessage(ServersCustomizer.class, "CTL_Remove")); removeButton.setEnabled(false); 179 removeButton.addActionListener(new java.awt.event.ActionListener () { 180 public void actionPerformed(java.awt.event.ActionEvent evt) { 181 removeServer(evt); 182 } 183 }); 184 gridBagConstraints = new java.awt.GridBagConstraints (); 185 gridBagConstraints.gridx = 1; 186 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 187 gridBagConstraints.insets = new java.awt.Insets (6, 6, 12, 6); 188 add(removeButton, gridBagConstraints); 189 removeButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_Remove")); removeButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_Remove")); 192 cards.setLayout(new java.awt.CardLayout ()); 193 194 messageArea.setLayout(new java.awt.GridBagLayout ()); 195 cards.add(messageArea, "card3"); 196 197 jPanel1.setLayout(new java.awt.GridBagLayout ()); 198 199 jLabel1.setLabelFor(serverName); 200 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(ServersCustomizer.class, "CTL_ServerName")); gridBagConstraints = new java.awt.GridBagConstraints (); 202 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 203 jPanel1.add(jLabel1, gridBagConstraints); 204 jLabel1.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_ServerName")); jLabel1.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_ServerName")); 207 serverName.setEditable(false); 208 gridBagConstraints = new java.awt.GridBagConstraints (); 209 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 210 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 211 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 212 gridBagConstraints.weightx = 1.0; 213 gridBagConstraints.insets = new java.awt.Insets (0, 6, 0, 0); 214 jPanel1.add(serverName, gridBagConstraints); 215 serverName.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_ServerName")); serverName.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_ServerName")); 218 jLabel2.setLabelFor(serverType); 219 org.openide.awt.Mnemonics.setLocalizedText(jLabel2, NbBundle.getMessage(ServersCustomizer.class, "CTL_ServerType")); gridBagConstraints = new java.awt.GridBagConstraints (); 221 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 222 gridBagConstraints.insets = new java.awt.Insets (6, 0, 12, 0); 223 jPanel1.add(jLabel2, gridBagConstraints); 224 jLabel2.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_ServerType")); jLabel2.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_Server Type")); 227 serverType.setEditable(false); 228 gridBagConstraints = new java.awt.GridBagConstraints (); 229 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 230 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 231 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 232 gridBagConstraints.weightx = 1.0; 233 gridBagConstraints.insets = new java.awt.Insets (6, 6, 12, 0); 234 jPanel1.add(serverType, gridBagConstraints); 235 serverType.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCN_ServerType")); serverType.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_Server Type")); 238 clientArea.setLayout(new java.awt.GridBagLayout ()); 239 gridBagConstraints = new java.awt.GridBagConstraints (); 240 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 241 gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; 242 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 243 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 244 gridBagConstraints.weightx = 1.0; 245 gridBagConstraints.weighty = 1.0; 246 jPanel1.add(clientArea, gridBagConstraints); 247 248 cards.add(jPanel1, "card2"); 249 250 gridBagConstraints = new java.awt.GridBagConstraints (); 251 gridBagConstraints.gridx = 2; 252 gridBagConstraints.gridy = 1; 253 gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; 254 gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; 255 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 256 gridBagConstraints.weightx = 1.0; 257 gridBagConstraints.weighty = 1.0; 258 gridBagConstraints.insets = new java.awt.Insets (6, 6, 6, 12); 259 add(cards, gridBagConstraints); 260 261 serversLabel.setLabelFor(servers); 262 org.openide.awt.Mnemonics.setLocalizedText(serversLabel, org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "CTL_Servers")); gridBagConstraints = new java.awt.GridBagConstraints (); 264 gridBagConstraints.gridx = 0; 265 gridBagConstraints.gridy = 0; 266 gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; 267 gridBagConstraints.insets = new java.awt.Insets (12, 12, 0, 0); 268 add(serversLabel, gridBagConstraints); 269 serversLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "LBL_Servers")); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/deployment/impl/ui/Bundle"); serversLabel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_ServerList")); 273 getAccessibleContext().setAccessibleName(bundle.getString("ASCN_ServerManager")); getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ServersCustomizer.class, "ASCD_ServerCustomizer")); } 277 private void removeServer(java.awt.event.ActionEvent evt) { Node[] nodes = getExplorerManager().getSelectedNodes(); 279 if (nodes.length!=1) { 280 assert false : "Illegal number of selected nodes"; return; 282 } 283 if (nodes[0] instanceof ServerNode) { 284 ServerInstance serverInstance = ((ServerNode)nodes[0]).getServerInstance(); 285 if (!serverInstance.isRemoveForbidden()) { 286 ServerRegistry.getInstance().removeServerInstance(serverInstance.getUrl()); 287 getChildren().refreshServers(); 288 expandServers(null); 289 } 290 } 291 } 293 private void addServer(java.awt.event.ActionEvent evt) { AddServerInstanceWizard wizard = new AddServerInstanceWizard(); 295 final Dialog dialog = DialogDisplayer.getDefault().createDialog(wizard); 296 dialog.getAccessibleContext().setAccessibleDescription( 297 NbBundle.getMessage(ServersCustomizer.class, "ACSD_Add_Server_Instance")); 298 dialog.setVisible(true); 299 if (wizard.getValue() == WizardDescriptor.FINISH_OPTION) { 300 getChildren().refreshServers(); 301 ServerInstance servInst = null; 302 Set result = wizard.getInstantiatedObjects(); 305 if (result != null) { 306 for (Iterator i = result.iterator(); i.hasNext();) { 307 Object instObj = i.next(); 308 if (instObj instanceof InstanceProperties) { 309 InstanceProperties ip = (InstanceProperties)instObj; 310 String url = ip.getProperty(InstanceProperties.URL_ATTR); 311 servInst = ServerRegistry.getInstance().getServerInstance(url); 312 } 313 } 314 } 315 expandServers(servInst); 316 } 317 } 319 320 private synchronized ServerCategoriesChildren getChildren() { 321 if (this.children == null) { 322 this.children = new ServerCategoriesChildren(); 323 } 324 return this.children; 325 } 326 327 private void selectServer(Node aNode) { 328 clientArea.removeAll(); 329 330 if (aNode instanceof ServerNode) { 331 ServerInstance serverInstance = ((ServerNode)aNode).getServerInstance(); 332 serverName.setText(serverInstance.getDisplayName()); 333 serverType.setText(serverInstance.getServer().getDisplayName()); 334 if (serverInstance.isRemoveForbidden()) { 335 removeButton.setEnabled(false); 336 } else { 337 removeButton.setEnabled(true); 338 } 339 } else { 340 removeButton.setEnabled(false); 341 ((CardLayout )cards.getLayout()).first(cards); 342 return; 343 } 344 345 if (aNode.hasCustomizer()) { 346 Component component = aNode.getCustomizer(); 347 if (component != null) { 348 addComponent(clientArea, component); 349 } 350 } 351 int height = getHeight(); 353 int width = getWidth(); 354 setPreferredSize(null); 356 revalidate(); 357 Dimension prefSize = getPreferredSize(); 359 int prefWidth = (int)(prefSize.getWidth() > MINIMUM_SIZE.getWidth() ? prefSize.getWidth() : MINIMUM_SIZE.getWidth()); 360 int prefHeight = (int)(prefSize.getHeight() > MINIMUM_SIZE.getHeight() ? prefSize.getHeight() : MINIMUM_SIZE.getHeight()); 361 if (prefHeight > height || prefWidth > width) { 363 setPreferredSize(new Dimension (prefWidth > width ? prefWidth : width, 364 prefHeight > height ? prefHeight : height)); 365 for (Container parent = getParent(); parent != null; parent = parent.getParent()) { 367 if (parent instanceof Window ) { 368 ((Window )parent).pack(); 369 break; 370 } 371 } 372 } 373 CardLayout cl = (CardLayout )cards.getLayout(); 374 cl.last(cards); 375 } 376 377 private static void addComponent(Container container, Component component) { 378 GridBagConstraints c = new GridBagConstraints (); 379 c.gridx = c.gridy = GridBagConstraints.RELATIVE; 380 c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER; 381 c.fill = GridBagConstraints.BOTH; 382 c.anchor = GridBagConstraints.NORTHWEST; 383 c.weightx = c.weighty = 1.0; 384 ((GridBagLayout )container.getLayout()).setConstraints(component,c); 385 container.add(component); 386 } 387 388 private void expandServers(ServerInstance servInst) { 389 ExplorerManager mgr = this.getExplorerManager(); 390 Node node = mgr.getRootContext(); 391 expandAllNodes(servers, node, mgr, servInst); 392 } 393 394 private static void expandAllNodes(BeanTreeView btv, Node node, ExplorerManager mgr, ServerInstance servInst) { 395 btv.expandNode(node); 396 Children ch = node.getChildren(); 397 398 if (servInst != null && ch == Children.LEAF && node instanceof ServerNode) { 400 try { 401 if (((ServerNode)node).getServerInstance() == servInst) { 402 mgr.setSelectedNodes(new Node[] {node}); 403 } 404 } catch (PropertyVetoException e) { 405 } 407 } 408 409 if (servInst == null && ch == Children.LEAF && mgr.getSelectedNodes().length == 0) { 411 try { 412 mgr.setSelectedNodes(new Node[] {node}); 413 } catch (PropertyVetoException e) { 414 } 416 } 417 Node nodes[] = ch.getNodes( true ); 418 for ( int i = 0; i < nodes.length; i++ ) { 419 expandAllNodes( btv, nodes[i], mgr, servInst); 420 } 421 } 422 423 424 private javax.swing.JButton addButton; 426 private javax.swing.JPanel cards; 427 private javax.swing.JPanel clientArea; 428 private javax.swing.JLabel jLabel1; 429 private javax.swing.JLabel jLabel2; 430 private javax.swing.JPanel jPanel1; 431 private javax.swing.JPanel jPanel3; 432 private javax.swing.JPanel messageArea; 433 private javax.swing.JButton removeButton; 434 private javax.swing.JTextField serverName; 435 private javax.swing.JTextField serverType; 436 private org.openide.explorer.view.BeanTreeView servers; 437 private javax.swing.JLabel serversLabel; 438 440 441 private static class PlatformsView extends BeanTreeView { 442 443 public PlatformsView() { 444 super(); 445 this.setPopupAllowed(false); 446 this.setDefaultActionAllowed(false); 447 this.setRootVisible(false); 448 this.tree.setEditable(false); 449 this.tree.setShowsRootHandles(false); 450 this.setBorder(UIManager.getBorder("Nb.ScrollPane.border")); } 452 453 } 454 455 private static class ServerCategoriesDescriptor implements Comparable { 456 private final String categoryName; 457 private final List servers; 458 459 public ServerCategoriesDescriptor(String categoryName) { 460 assert categoryName != null; 461 this.categoryName = categoryName; 462 this.servers = new ArrayList (); 463 } 464 465 public String getName() { 466 return categoryName; 467 } 468 469 public List getServers() { 470 Collections.sort(servers); 471 return Collections.unmodifiableList(servers); 472 } 473 474 public void add(Node node) { 475 servers.add(node); 476 } 477 478 public int hashCode() { 479 return categoryName.hashCode(); 480 } 481 482 public boolean equals(Object other) { 483 if (other instanceof ServerCategoriesDescriptor) { 484 ServerCategoriesDescriptor desc = (ServerCategoriesDescriptor) other; 485 return categoryName.equals(desc.categoryName) && 486 servers.size() == desc.servers.size(); 487 } 488 return false; 489 } 490 491 public int compareTo(Object other) { 492 if (!(other instanceof ServerCategoriesDescriptor )) { 493 throw new IllegalArgumentException (); 494 } 495 ServerCategoriesDescriptor desc = (ServerCategoriesDescriptor) other; 496 return categoryName.compareTo(desc.categoryName); 497 } 498 499 } 500 501 private static class ServersChildren extends Children.Keys { 502 503 private List servers; 504 505 public ServersChildren (List servers) { 506 this.servers = servers; 507 } 508 509 protected void addNotify() { 510 super.addNotify(); 511 this.setKeys (this.servers); 512 } 513 514 protected void removeNotify() { 515 super.removeNotify(); 516 this.setKeys(new Object [0]); 517 } 518 519 protected Node[] createNodes(Object key) { 520 return new Node[] {(Node) key}; 521 } 522 } 523 524 private static class ServerNode extends FilterNode implements Comparable { 525 526 private final ServerInstance serverInstance; 527 528 public ServerNode(ServerInstance serverInstance) { 529 super(serverInstance.getServer().getRegistryNodeFactory().getManagerNode(RegistryNodeProvider.createLookup(serverInstance))); 530 disableDelegation(DELEGATE_GET_DISPLAY_NAME | DELEGATE_SET_DISPLAY_NAME | 531 DELEGATE_GET_NAME | DELEGATE_SET_NAME); 532 this.serverInstance = serverInstance; 533 setChildren(Children.LEAF); 534 setDisplayName(serverInstance.getDisplayName()); 535 setName(serverInstance.getUrl()); 536 } 537 538 public ServerInstance getServerInstance() { 539 return serverInstance; 540 } 541 542 public int compareTo(Object other) { 543 if (!(other instanceof ServerNode)) { 544 throw new IllegalArgumentException (); 545 } 546 return serverInstance.compareTo(((ServerNode)other).serverInstance); 547 } 548 } 549 550 private static class ServerCategoryNode extends AbstractNode { 551 552 private final ServerCategoriesDescriptor desc; 553 private Node iconDelegate; 554 555 public ServerCategoryNode (ServerCategoriesDescriptor desc) { 556 super (new ServersChildren (desc.getServers())); 557 this.desc = desc; 558 this.iconDelegate = DataFolder.findFolder (Repository.getDefault().getDefaultFileSystem().getRoot()).getNodeDelegate(); 559 } 560 561 public String getDisplayName () { 562 return desc.getName(); 563 } 564 565 public Image getIcon(int type) { 566 return iconDelegate.getIcon(type); 567 } 568 569 public Image getOpenedIcon(int type) { 570 return iconDelegate.getOpenedIcon(type); 571 } 572 } 573 574 private static class ServerCategoriesChildren extends Children.Keys { 575 576 protected void addNotify () { 577 super.addNotify (); 578 this.refreshServers(); 579 } 580 581 protected void removeNotify () { 582 super.removeNotify (); 583 } 584 585 protected Node[] createNodes(Object key) { 586 if (key instanceof ServerCategoriesDescriptor) { 587 ServerCategoriesDescriptor desc = (ServerCategoriesDescriptor) key; 588 return new Node[] { 589 new ServerCategoryNode (desc) 590 }; 591 } 592 else if (key instanceof Node) { 593 return new Node[] { 594 new FilterNode ((Node)key,Children.LEAF) 595 }; 596 } 597 else { 598 return new Node[0]; 599 } 600 } 601 602 private void refreshServers() { 603 Collection servInstances = ServerRegistry.getInstance().getInstances(); 604 HashMap categories = new HashMap (); 605 606 final String J2EE_SERVERS_CATEGORY = NbBundle.getMessage(ServersCustomizer.class, "LBL_J2eeServersNode"); ServerCategoriesDescriptor j2eeServers = new ServerCategoriesDescriptor(J2EE_SERVERS_CATEGORY); 609 for(Iterator it = servInstances.iterator(); it.hasNext();) { 610 ServerInstance serverInstance = (ServerInstance)it.next(); 611 j2eeServers.add(new ServerNode(serverInstance)); 612 } 613 categories.put(J2EE_SERVERS_CATEGORY, j2eeServers); 614 List keys = new ArrayList (categories.values()); 615 Collections.sort(keys); 616 this.setKeys(keys); 617 } 618 } 619 } 620 621 | Popular Tags |