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

The following examples show how to use org.openide.nodes.Sheet#put() . 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: DepTupleNode.java    From Llunatic with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.put(new StringProperty(Bundle.PROP_DependencyType()) {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return dependency.getType();
        }
    });
    set.put(new StringProperty(Bundle.PROP_DependencyId()) {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return dependency.getId();
        }
    });
    sheet.put(set);
    return sheet;
}
 
Example 2
Source File: JmeBitmapText.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    //TODO: multithreading..
    Sheet sheet = super.createSheet();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("BitmapText");
    set.setName(BitmapText.class.getName());
    BitmapText obj = geom;//getLookup().lookup(Spatial.class);
    if (obj == null) {
        return sheet;
    }

    set.put(makeProperty(obj, String.class, "getText", "setText", "Text"));
    set.put(makeProperty(obj, ColorRGBA.class, "getColor", "setColor", "Color"));
    set.put(makeProperty(obj, BitmapFont.class, "getFont", "Font"));

    sheet.put(set);
    return sheet;

}
 
Example 3
Source File: PropertiesFlushTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public Node.PropertySet[] getPropertySets() {
    if (sets == null) {
        System.err.println("Create sheet");
        Sheet sheet = new Sheet();
        // Make sure there is a "Properties" set:
        Sheet.Set props = sheet.get(Sheet.PROPERTIES);
        props = Sheet.createPropertiesSet();
        sheet.put(props);
        TProperty tp = new TProperty("property", true);
        props.put(tp);
        if (firstTime) {
            props.put(new TProperty("second", true));
            System.err.println("first time");
            firstTime = false;
        } else {
            System.err.println("Second  time");
        }
        sets = sheet.toArray();
    }
    return sets;
}
 
Example 4
Source File: JmeFogFilter.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
    protected Sheet createSheet() {
        Sheet sheet = super.createSheet();
        Sheet.Set set = Sheet.createPropertiesSet();
        set.setDisplayName("Fog");
        set.setName(Node.class.getName());
        FogFilter obj = (FogFilter) filter;
        if (obj == null) {
            return sheet;
        }
//        set.put(makeProperty(obj, float.class, "getFogDistance", "setFogDistance", "Distance"));
//        set.put(makeProperty(obj, float.class, "getFogDensity", "setFogDensity", "Density"));
//        set.put(makeProperty(obj, ColorRGBA.class, "getFogColor", "setFogColor", "Color"));
         createFields(FogFilter.class, set, obj);
        sheet.put(set);
        return sheet;

    }
 
Example 5
Source File: JmeBloomFilter.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
    protected Sheet createSheet() {
        Sheet sheet = super.createSheet();
        Sheet.Set set = Sheet.createPropertiesSet();
        set.setDisplayName("Bloom");
        set.setName(Node.class.getName());
        BloomFilter obj = (BloomFilter) filter;
        if (obj == null) {
            return sheet;
        }
//        set.put(makeProperty(obj, float.class, "getBloomIntensity", "setBloomIntensity", "Intensity"));
//        set.put(makeProperty(obj, float.class, "getBlurScale", "setBlurScale", "Blur Scale"));
//        set.put(makeProperty(obj, float.class, "getDownSamplingFactor", "setDownSamplingFactor", "Downsampling Factor"));
//        set.put(makeProperty(obj, float.class, "getExposureCutOff", "setExposureCutOff", "Exposure Cutoff"));
//        set.put(makeProperty(obj, float.class, "getExposurePower", "setExposurePower", "Exposure Power"));
         createFields(BloomFilter.class, set, obj);
        sheet.put(set);
        return sheet;

    }
 
Example 6
Source File: JmeSSAOFilter.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();

    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("SSAO");
    set.setName("SSAO");
    SSAOFilter obj = (SSAOFilter) filter;

    if (obj == null) {
        return sheet;
    }

    createFields(SSAOFilter.class, set, obj);

    sheet.put(set);
    return sheet;

}
 
Example 7
Source File: AssetPackBrowserItem.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
    protected Sheet createSheet() {
        Sheet sheet = super.createSheet();
        Set set = Sheet.createPropertiesSet();
        set.put(new ElementAttributeProperty(project, item, "name"));
        set.put(new ElementNodeTextProperty(project, item, "description"));
        set.put(new ElementAttributeProperty(project, item, "categories"));
        set.put(new ElementAttributeProperty(project, item, "tags"));
        Element elem = XmlHelper.findChildElement(item, "license");
        if ((project.getLookup().lookup(AssetPackLibrary.class) != null) && (elem == null || elem.getTextContent().trim().length() <= 0)) {
            set.put(new ElementNodeTextProperty(project, (Element) item.getParentNode().getParentNode(), "license"));
        } else {
            set.put(new ElementNodeTextProperty(project, item, "license"));
        }
        set.put(new ElementAttributeProperty(project, item, "type", ASSET_TYPES));
//        set.put(new ElementAttributeProperty(project, item, "format", ASSET_FORMATS));
        sheet.put(set);
        return sheet;
    }
 
Example 8
Source File: TableTupleLoaderNode.java    From Llunatic with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    logger.trace("Create tuple data: " + getName());
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);
    List<Cell> tupleCells = getTuple().getCells();
    for (final Cell cell : tupleCells) {
        StringProperty property = new StringProperty(cell.getAttribute()) {
            @Override
            public String getValue() throws IllegalAccessException, InvocationTargetException {
                return cell.getValue().toString();
            }

            //TODO: implement inplace editor
            @Override
            public boolean canWrite() {
                return true;
            }
        };
        set.put(property);
    }
    return sheet;
}
 
Example 9
Source File: JmePicture.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
    protected Sheet createSheet() {
        //TODO: multithreading..
        Sheet sheet = super.createSheet();
        Sheet.Set set = Sheet.createPropertiesSet();
        set.setDisplayName("Picture");
        set.setName(Picture.class.getName());
        Picture obj = geom;//getLookup().lookup(Spatial.class);
        if (obj == null) {
            return sheet;
        }

//        set.put(makeProperty(obj, String.class, "getText", "setText", "text"));

        sheet.put(set);
        return sheet;

    }
 
Example 10
Source File: RepositoryPathNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initProperties() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set ps = Sheet.createPropertiesSet();

    ps.put(new RevisionProperty());
    ps.put(new DateProperty());
    ps.put(new AuthorProperty());
    ps.put(new HistoryProperty());

    sheet.put(ps);
    setSheet(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: TreeModelNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set ps = Sheet.createPropertiesSet ();
    int i, k = columns.length;
    for (i = 0; i < k; i++)
        ps.put (new MyProperty (columns [i], treeModelRoot));
    sheet.put (ps);
    return sheet;
}
 
Example 13
Source File: PropertiesSheet.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void initializeSheet(final Properties properties, Sheet s) {

        Sheet.Set set1 = Sheet.createPropertiesSet();
        set1.setDisplayName("Properties");
        for (final Property p : properties) {
            Node.Property<String> prop = new Node.Property<String>(String.class) {

                @Override
                public boolean canRead() {
                    return true;
                }

                @Override
                public String getValue() throws IllegalAccessException, InvocationTargetException {
                    return p.getValue();
                }

                @Override
                public boolean canWrite() {
                    return false;
                }

                @Override
                public void setValue(String arg0) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
                    properties.setProperty(p.getName(), arg0);
                }
            };
            prop.setName(p.getName());
            set1.put(prop);
        }
        s.put(set1);
    }
 
Example 14
Source File: TreeTableViewTest.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() );
    return s;
}
 
Example 15
Source File: DiffNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initProperties() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set ps = Sheet.createPropertiesSet();
    
    ps.put(new NameProperty());
    ps.put(new LocationProperty());
    ps.put(new StatusProperty());
    
    sheet.put(ps);
    setSheet(sheet);        
}
 
Example 16
Source File: ScenarioNode.java    From Llunatic with GNU General Public License v3.0 5 votes vote down vote up
public void updateCostManagerSet() {
    Sheet sheet = getSheet();
    Sheet.Set oldCostManagerSet = sheet.get(PROP_SET_COST_MANAGER);
    Sheet.Set newCostManagerSet = costManager.createSheetSet(PROP_SET_COST_MANAGER, loadedScenario);
    sheet.put(newCostManagerSet);
    firePropertySetsChange(new PropertySet[]{oldCostManagerSet}, new PropertySet[]{newCostManagerSet});
}
 
Example 17
Source File: JMSBeanDataNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void createProperties(Object bean, java.beans.BeanInfo info) {
        BeanNode.Descriptor d = BeanNode.computeProperties(bean, info);
        Node.Property p = new PropertySupport.ReadWrite(
        "extraParams", JMSBeanDataNode.class, //NOI18N
        NbBundle.getMessage(JMSBeanDataNode.class,"LBL_ExtParams"), //NOI18N
        NbBundle.getMessage(JMSBeanDataNode.class,"DSC_ExtParams") //NOI18N
        ) {
            public Object getValue() {
                return resource.getExtraParams();
            }
            
            public void setValue(Object val){
                if (val instanceof Object[])
                    resource.setExtraParams((Object[])val);
            }
            
            public PropertyEditor getPropertyEditor(){
                return new NameValuePairsPropertyEditor(resource.getExtraParams());
            }
        };
        
        Sheet sets = getSheet();
        Sheet.Set pset = Sheet.createPropertiesSet();
        pset.put(d.property);
        pset.put(p);
//        pset.setValue("helpID", "AS_Res_JMS_Props"); //NOI18N
        sets.put(pset);
    }
 
Example 18
Source File: JustificationTupleNode.java    From Llunatic with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);
    set.put(new StringProperty("tid") {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return cell.getTupleOID().getValue().toString();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    set.put(new StringProperty("table") {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return cell.getAttributeRef().getTableName();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    set.put(new StringProperty("attribute") {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return cell.getAttributeRef().getName();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    set.put(new StringProperty("value") {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return cell.getValue().toString();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    set.put(new StringProperty("authoritative") {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return getAuth();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    return sheet;
}
 
Example 19
Source File: TreeTableView152857Test.java    From netbeans with Apache License 2.0 4 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);
    }
    Property [] props = new Property [2];

    DummyProperty dp = new DummyProperty (getName ());
    dp.setValue ("ComparableColumnTTV", Boolean.TRUE);
    props [0] = dp;

    Property p_tree = new Node.Property<Boolean> (Boolean.class) {

        @Override
        public boolean canRead () {
            return true;
        }

        @Override
        public Boolean getValue () throws IllegalAccessException, InvocationTargetException {
            return Boolean.TRUE;
        }

        @Override
        public boolean canWrite () {
            return false;
        }

        @Override
        public void setValue (Boolean val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
            throw new UnsupportedOperationException ("Not supported yet.");
        }
    };

    p_tree.setValue ("TreeColumnTTV", Boolean.TRUE);
    p_tree.setValue ("ComparableColumnTTV", Boolean.TRUE);
    p_tree.setValue ("SortingColumnTTV", Boolean.TRUE);
    props [1] = p_tree;

    ss.put (props);

    return s;
}
 
Example 20
Source File: ChaseStepPropertySheetGenerator.java    From Llunatic with GNU General Public License v3.0 4 votes vote down vote up
public void populateSheet(Sheet sheet, ChaseStepNode chaseStep) {
    Sheet.Set resultSet = createSheetSet(chaseStep);
    sheet.put(resultSet);
}