Exemplo n.º 1
0
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
     Node[] selectedNodes = layerController.getExplorerManager().getSelectedNodes();
     // if no form node, select data node (of FormDataObject) in lookup
     switchNodeInLookup(selectedNodes.length == 0 && dataObject.isValid());
   }
 }
 @Override
 public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
   if (enable && ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
     Node[] nodes = (Node[]) evt.getNewValue();
     if (nodes.length > 0 && ((DecoratedNode) nodes[0]).getOriginal() instanceof ItemWsNode) {
       ItemWsNode node = (ItemWsNode) ((DecoratedNode) nodes[0]).getOriginal();
       setSpecification((ISaSpecification) node.getItem().getElement());
       setIcon(node.getIcon(BeanInfo.ICON_COLOR_16x16));
     } else {
       setSpecification(null);
       setIcon(null);
     }
   }
 }
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getSource() == manager) {
     if (ExplorerManager.PROP_SELECTED_NODES.equals(evt.getPropertyName())) {
       Node[] nodes = manager.getSelectedNodes();
       if (nodes != null && nodes.length > 0) {
         Node node = nodes[0];
         if (isClientNode(node)) {
           // This is a method node.
           selectedMethod = node;
           setSelectionValid(true);
         } else {
           // This is not a method node.
           selectedMethod = null;
           setSelectionValid(false);
         }
       }
     }
   }
 }