Java Code Examples for org.openide.nodes.Sheet#get()

The following examples show how to use org.openide.nodes.Sheet#get() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExternalReferenceDataNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Set set = sheet.get(Sheet.PROPERTIES);
    set.put(createProperty(PROP_NAME, String.class, this,
            "getHtmlDisplayName", null));
    if (canSelect()) {
        set.put(createProperty(PROP_SELECTED, Boolean.TYPE, this,
                "isSelected", "setSelected"));
   //     Node.Property prop = createProperty(PROP_PREFIX, String.class,
       //         this, "getPrefix", "setPrefix");
        // Suppress the [...] button because it is not needed.
    //    prop.setValue("suppressCustomEditor", Boolean.TRUE);
    //    set.put(prop);
    } /*else {
        // Do not include this property so the checkbox is not shown.
        //set.put(createProperty(PROP_SELECTED, Boolean.TYPE, this,
        //        "isSelected", null));
        Node.Property prop = createProperty(PROP_PREFIX, String.class,
                this, "getPrefix", null);
        // Suppress the [...] button because it is not needed.
        prop.setValue("suppressCustomEditor", Boolean.TRUE);
        set.put(prop);
    }*/
    return sheet;
}
 
Example 2
Source File: ExperimentalForceSetNode.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
@Override
public Sheet createSheet() {
     Sheet defaultSheet = super.createSheet();
    try {
        Sheet.Set set = defaultSheet.get(Sheet.PROPERTIES);
        PropertySupport.Reflection nextNodeProp = new PropertySupport.Reflection(this, Color.class, "getColor", "setColorUI");
        nextNodeProp.setName("force color");
        set.put(nextNodeProp);

        PropertySupport.Reflection nextNodeProp2= new PropertySupport.Reflection(this, double.class, "getForceScaleFactor", "setForceScaleFactorUI");
        nextNodeProp2.setName("force size");
        set.put(nextNodeProp2);

        return defaultSheet;
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return defaultSheet;
}
 
Example 3
Source File: OneAssociatedMotionNode.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
@Override
public Sheet createSheet() {
    Sheet defaultSheet = super.createSheet();
    AnnotatedMotion dMotion = (AnnotatedMotion)this.getOpenSimObject();
    try {
        Sheet.Set set = defaultSheet.get(Sheet.PROPERTIES);
        PropertySupport.Reflection nextNodeProp = new PropertySupport.Reflection(dMotion.getMotionDisplayer(), Color.class, "getDefaultForceColor", "setDefaultForceColor");
        nextNodeProp.setName("force color");
        set.put(nextNodeProp);

        PropertySupport.Reflection nextNodeProp2= new PropertySupport.Reflection(dMotion, double.class, "getDisplayForceScale", "setDisplayForceScale");
        nextNodeProp2.setName("Force display size");
        set.put(nextNodeProp2);

        PropertySupport.Reflection nextNodeProp3= new PropertySupport.Reflection(dMotion, String.class, "getDisplayForceShape", "setDisplayForceShape");
        nextNodeProp3.setName("Force display shape");
        set.put(nextNodeProp3);

        return defaultSheet;
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return defaultSheet;
}
 
Example 4
Source File: AnnotationTypesNode.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Create properties sheet */
   protected Sheet createSheet() {
       Sheet sheet = super.createSheet();
       
Sheet.Set ps = sheet.get (Sheet.PROPERTIES);
if (ps == null) {
    ps = Sheet.createPropertiesSet ();
}
       
       ps.put(createProperty(AnnotationTypes.PROP_BACKGROUND_DRAWING, boolean.class)); //NOI18N
       ps.put(createProperty(AnnotationTypes.PROP_BACKGROUND_GLYPH_ALPHA, int.class)); //NOI18N
       ps.put(createProperty(AnnotationTypes.PROP_COMBINE_GLYPHS, boolean.class));    //NOI18N
       ps.put(createProperty(AnnotationTypes.PROP_GLYPHS_OVER_LINE_NUMBERS, boolean.class));    //NOI18N
       ps.put(createProperty(AnnotationTypes.PROP_SHOW_GLYPH_GUTTER, boolean.class));    //NOI18N
       sheet.put(ps);
       
       return sheet;
   }
 
Example 5
Source File: ExperimentalMarkerSetNode.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
@Override
public Sheet createSheet() {
     Sheet defaultSheet = super.createSheet();
    try {
        Sheet.Set set = defaultSheet.get(Sheet.PROPERTIES);
        PropertySupport.Reflection nextNodeProp = new PropertySupport.Reflection(this, Color.class, "getColor", "setColorUI");
        nextNodeProp.setName("marker color");
        set.put(nextNodeProp);

        PropertySupport.Reflection nextNodeProp2= new PropertySupport.Reflection(this, double.class, "getMarkerRadius", "setMarkerRadiusUI");
        nextNodeProp2.setName("marker radius (mm)");
        nextNodeProp2.setShortDescription("Number to scale current visualization with");
        set.put(nextNodeProp2);

        return defaultSheet;
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return defaultSheet;
}
 
Example 6
Source File: RestoreDefaultValueTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    // Make sure there is a "Properties" set:
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    tp = new TProperty("property", true);
    props.put(tp);
    return sheet;
}
 
Example 7
Source File: PUDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet s = super.createSheet();
    Sheet.Set ss = s.get(Sheet.PROPERTIES);
    if (ss == null) {
        ss = Sheet.createPropertiesSet();
        s.put(ss);
    }
    // TODO add some relevant properties: ss.put(...)
    return s;
}
 
Example 8
Source File: PropertySheetTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    // Make sure there is a "Properties" set:
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    props.put(tp);
    return sheet;
}
 
Example 9
Source File: ProxyNodeTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    // Make sure there is a "Properties" set:
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    props.put(myprop);
    myprop.setFiringNode(this);
    return sheet;
}
 
Example 10
Source File: OneGeometryNode.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
public Sheet createSheet() {
    Sheet sheet;
    sheet = super.createSheet();
    Sheet.Set set = sheet.get(Sheet.PROPERTIES);
    // Remove Properties for origin, direction as not supported 
    if (Cone.safeDownCast(comp)!=null){
        set.remove("origin");
        set.remove("direction");
    }
    set.remove("scale_factors");
    return sheet;
}
 
Example 11
Source File: IndexedPropertyTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    // Make sure there is a "Properties" set:
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    props.put(plain);
    props.put(fancy);
    return sheet;
}
 
Example 12
Source File: TagsAndEditorsTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    // Make sure there is a "Properties" set:
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    for (int i=0; i < ed.length; i++) {
        props.put(new TProperty(this, ed[i], true));
    }
    return sheet;
}
 
Example 13
Source File: PropertiesFlushTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    // Make sure there is a "Properties" set:
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    props.put(new TProperty("before", true));
    return sheet;
}
 
Example 14
Source File: OneMuscleNode.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/** override createSheet to remove optimal_force property
* 
* @return 
*/
@Override
public Sheet createSheet() {
    Sheet sheet;

    sheet = super.createSheet();
    Sheet.Set set = sheet.get(Sheet.PROPERTIES);
    set.remove("optimal_force");
    return sheet;
}
 
Example 15
Source File: OutlineViewTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected Sheet createSheet () {
    Sheet s = super.createSheet ();
    Sheet.Set ss = s.get (Sheet.PROPERTIES);
    if (ss == null) {
        ss = Sheet.createPropertiesSet ();
        s.put (ss);
    }
    ss.put (new DummyProperty (getName ()));
    return s;
}
 
Example 16
Source File: SuiteCustomizerLibraries.java    From netbeans with Apache License 2.0 5 votes vote down vote up
Enabled(Children ch, boolean enabled) {
    super(ch);
    setState(enabled ? EnabledState.FULL_ENABLED : EnabledState.DISABLED, false);
    
    Sheet s = Sheet.createDefault();
    Sheet.Set ss = s.get(Sheet.PROPERTIES);
    ss.put(new EnabledProp(this));
    ss.put(new OriginProp(this));
    setSheet(s);
    setIconBaseWithExtension(
            isLeaf() ? NbModuleProject.NB_PROJECT_ICON_PATH : SuiteProject.SUITE_ICON_PATH);
}
 
Example 17
Source File: BiNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
SubNode ( BiAnalyser biAnalyser, Class<?>[] keys, String titleKey, String iconBase,
          Node.Property[] properties, Node.Property[] expert ) {
    super ( new BiChildren (  biAnalyser, keys ) );
    setDisplayName (NbBundle.getBundle(BiNode.class).
                    getString (titleKey));
    setIconBaseWithExtension ( iconBase );
        
    this.biAnalyser = biAnalyser;
    this.key = keys[0];
    
    Sheet sheet = Sheet.createDefault();
    Sheet.Set ps = sheet.get(Sheet.PROPERTIES);

    for ( int i = 0; i < properties.length; i++ ) {
        ps.put( properties[i] );
    }
    
    if( expert != null ){                
        Sheet.Set eps = Sheet.createExpertSet();

        for ( int i = 0; i < expert.length; i++ ) {
            eps.put( expert[i] );
        }
        sheet.put(eps);
    }
    
    setSheet(sheet);

    getCookieSet().add ( this );
}
 
Example 18
Source File: OnePropNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    props.put(new PropertySupport.Name(this));
    class ValueProp extends PropertySupport.ReadWrite {
        public ValueProp() {
            super("value", String.class,
                    bundle.getString("PROP_value"), bundle.getString("HINT_value"));
        }
        public Object getValue() {
            return System.getProperty(key);
        }
        public void setValue(Object nue) {
            System.setProperty(key, (String) nue);
            PropertiesNotifier.changed();
        }
        
    }
    
    props.put(new ValueProp());
    PropertiesNotifier.addChangeListener(listener = new
            ChangeListener() {
        public void stateChanged(ChangeEvent ev) {
            firePropertyChange("value", null, null);
        }
    });
    return sheet;
}
 
Example 19
Source File: TableNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Sheet createSheet() {
    Sheet s = Sheet.createDefault();
    Sheet.Set ss = s.get(Sheet.PROPERTIES);
    try {
        PropertySupport.Reflection p;
        p = new Reflection(this, String.class, "getTableName", null); // NOI18N
        p.setName("tableName"); // NOI18N
        String tableDisplayName = NbBundle.getMessage(TableNode.class, "TABLE_DISPLAY_NAME");    // NOI18N
        // p.setDisplayName("Table Name"); // NOI18N
        p.setDisplayName(tableDisplayName);

        String tableShortDescription = NbBundle.getMessage(TableNode.class, "TABLE_SHORT_DESCRIPTION");    // NOI18N
        // p.setShortDescription("Table name"); // NOI18N
        p.setShortDescription(tableShortDescription); 
        ss.put(p);
        p = new Reflection(this, String.class, "getCorrName", "setCorrName"); // NOI18N
        p.setName("aliasName"); // NOI18N
        String aliasDisplayName = NbBundle.getMessage(TableNode.class, "ALIAS_DISPLAY_NAME");    // NOI18N
        // p.setDisplayName("Table Alias"); // NOI18N
        p.setDisplayName(aliasDisplayName); 
        String aliasShortDescription = NbBundle.getMessage(TableNode.class, "ALIAS_SHORT_DESCRIPTION");    // NOI18N
        // p.setShortDescription("Alias name for the table"); // NOI18N
        p.setShortDescription(aliasShortDescription); 
        ss.put(p);
    } catch (NoSuchMethodException nsme) {
        Exceptions.printStackTrace(nsme);
    }
    return s;
}
 
Example 20
Source File: OneMarkerNode.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
@Override
public Sheet createSheet() {
    Sheet sheet;

    sheet = super.createSheet();
    Sheet.Set set = sheet.get(Sheet.PROPERTIES);
    // Add property for Location
    Marker obj = Marker.safeDownCast(getOpenSimObject());
    MarkerAdapter gMarker = new MarkerAdapter(obj);
    Model theModel = getModelForNode();
    try {
        
        set.remove("name");
        Reflection nextNodeProp = createNodePropForObjectName(obj, theModel, true);
        if (nextNodeProp != null) {
            nextNodeProp.setName("name");
            nextNodeProp.setShortDescription("Name of the Object");
            nextNodeProp.setValue("suppressCustomEditor", Boolean.TRUE);
            set.put(nextNodeProp);
        }

        // customize offset
        set.remove("location");
        PropertySupport.Reflection locationNodeProp;
        locationNodeProp = new PropertySupport.Reflection(gMarker, String.class, "getOffsetString", "setOffsetString");
        ((Node.Property) locationNodeProp).setValue("oneline", Boolean.TRUE);
        ((Node.Property) locationNodeProp).setValue("suppressCustomEditor", Boolean.TRUE);
        locationNodeProp.setName("location");
        locationNodeProp.setShortDescription(getPropertyComment("location"));
        set.put(locationNodeProp);
        // Also replace seocket so we can fix frame/location
        Sheet.Set setSockets = sheet.get(Sheet.EXPERT);
        setSockets.remove("PhysicalFrame:parent_frame");
        AbstractSocket sock = obj.getSocket("parent_frame");
        String connecteeType = sock.getConnecteeTypeName();
        String connectionName = sock.getName();
        
        PropertySupport.Reflection nextNodePropFrame = 
                new PropertySupport.Reflection(this,
                String.class,
                "getConnectedToFrame",
                "setConnectedToFrame");
        nextNodePropFrame.setValue("canEditAsText", Boolean.TRUE);
        nextNodePropFrame.setValue("suppressCustomEditor", Boolean.TRUE);
        nextNodePropFrame.setName(connecteeType + ":" + connectionName);
        PropertyEditorSupport editor = EditorRegistry.getEditor(connecteeType);
        if (editor != null)
            nextNodePropFrame.setPropertyEditorClass(editor.getClass());
        setSockets.put(nextNodePropFrame);
       
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }

    return sheet;
}