Package com.cedarsoft.lookup

Examples of com.cedarsoft.lookup.DynamicLookup.addValue()


    for ( Object pathElement : path ) {
      if ( pathElement instanceof DefaultMutableTreeNode ) {
        Object userObject = ( ( DefaultMutableTreeNode ) pathElement ).getUserObject();
        if ( userObject != null ) {
          lookup.addValue( userObject );
        }
      } else {
        lookup.addValue( pathElement );
      }
    }
View Full Code Here


        Object userObject = ( ( DefaultMutableTreeNode ) pathElement ).getUserObject();
        if ( userObject != null ) {
          lookup.addValue( userObject );
        }
      } else {
        lookup.addValue( pathElement );
      }
    }

    return lookup;
  }
View Full Code Here

  protected Lookup getSelectedObjects() {
    DynamicLookup dynamicLookup = Lookups.dynamicLookup( detailsModel.getCurrentlySelectedObject(), treeModel.getRoot() );
    TreePath path = hierarchyTree.getSelectionPath();
    if ( path != null ) {
      for ( Object element : path.getPath() ) {
        dynamicLookup.addValue( element );
      }
    }
    return dynamicLookup;
  }
View Full Code Here

      final DynamicLookup lookup = new DynamicLookup();
      final AbstractAction[] actions = new AbstractAction[2];

      actions[0] = new AbstractAction( "action0" ) {
        public void actionPerformed( ActionEvent e ) {
          lookup.addValue( actions[1] );
        }
      };

      actions[1] = new AbstractAction( "action1" ) {
        public void actionPerformed( ActionEvent e ) {
View Full Code Here

        }
      };

      actions[1] = new AbstractAction( "action1" ) {
        public void actionPerformed( ActionEvent e ) {
          lookup.addValue( actions[0] );
        }
      };

      lookup.addValue( actions[0] );
      fileMenuNode.addChild( new DefaultNode( "toggleAction", lookup ) );
View Full Code Here

        public void actionPerformed( ActionEvent e ) {
          lookup.addValue( actions[0] );
        }
      };

      lookup.addValue( actions[0] );
      fileMenuNode.addChild( new DefaultNode( "toggleAction", lookup ) );
    }

    fileMenuNode.addChild( new DefaultNode( "separator1", Lookups.dynamicLookup( new JSeparator() ) ) );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.