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

The following examples show how to use org.openide.nodes.Sheet#createDefault() . 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: 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 2
Source File: ClusterizeInfo.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public PropertySet[] getPropertySets() {
    if (sheet != null) {
        return sheet.toArray();
    }
    try {
        sheet = Sheet.createDefault();
        Set ss = sheet.get(Sheet.PROPERTIES);
        final Reflection<String> cnb = new PropertySupport.Reflection<String>(this, String.class, "getCodeName", null); // NOI18N
        cnb.setDisplayName(NbBundle.getMessage(ClusterizeInfo.class, "MSG_ClusterizeCodeNameBase"));
        cnb.setName("cnb"); // NOI18N
        ss.put(cnb); // NOI18N
        final Reflection<ClusterizeAction> act = new PropertySupport.Reflection<ClusterizeAction>(this, ClusterizeAction.class, "action"); // NOI18N
        act.setDisplayName(NbBundle.getMessage(ClusterizeInfo.class, "MSG_ClusterizeActivateAs"));
        act.setName("action"); // NOI18N
        ss.put(act); // NOI18N
        final Reflection<Integer> count = new PropertySupport.Reflection<Integer>(this, Integer.class, "getSelectedFilesCount", null); // NOI18N
        count.setDisplayName(NbBundle.getMessage(ClusterizeInfo.class, "MSG_ClusterizeNumberOfModules"));
        count.setName("selectedFilesCount"); // NOI18N
        ss.put(act); // NOI18N
        return sheet.toArray();
    } catch (NoSuchMethodException ex) {
        throw new IllegalStateException(ex);
    }
}
 
Example 3
Source File: JmeLight.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    //TODO: multithreading..
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("Light");
    set.setName(Light.class.getName());
    Light obj = light;
    if (obj == null) {
        return sheet;
    }

    set.put(makeProperty(obj, ColorRGBA.class, "getColor", "setColor", "Color"));


    sheet.put(set);
    return sheet;

}
 
Example 4
Source File: TableTupleNode.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 = tuple.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 5
Source File: JmeGenericControl.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    //TODO: multithreading..
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("Control");
    set.setName(Control.class.getName());
    if (control == null) {
        return sheet;
    }

    createFields(control.getClass(), set, control);

    sheet.put(set);
    return sheet;

}
 
Example 6
Source File: UserCellTupleNode.java    From Llunatic with GNU General Public License v3.0 6 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("value") {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            return cell.getValue().toString();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    return sheet;
}
 
Example 7
Source File: JmeAnimControl.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
protected Sheet createSheet() {
    //TODO: multithreading..
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("AnimControl");
    set.setName(AnimControl.class.getName());
    if (animControl == null) {
        return sheet;
    }

    set.put(new AnimationProperty(animControl));

    sheet.put(set);
    return sheet;

}
 
Example 8
Source File: OpenSimNode.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
@Override
public Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    Sheet.Set setExpert = Sheet.createExpertSet();
    sheet.put(set);
    sheet.put(setExpert);
    return sheet;
}
 
Example 9
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 10
Source File: RevisionNode.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()); // XXX show only if VCS available
    ps.put(new UserProperty()); 
    ps.put(entry.canEdit() ? new EditableMessageProperty() : new MessageProperty());
    
    sheet.put(ps);
    setSheet(sheet);        
}
 
Example 11
Source File: MetadataElementInnerNode.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected final Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);
    return sheet;
}
 
Example 12
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 13
Source File: MetadataElementLeafNode.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected final Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    PropertySupport[] properties = createAttributeProperties();
    for (PropertySupport attributeProperty : properties) {
        set.put(attributeProperty);
    }
    sheet.put(set);
    return sheet;
}
 
Example 14
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 15
Source File: WildflyMailSessionNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    setSheet(sheet);
    return sheet;
}
 
Example 16
Source File: WildflyResourceAdapterNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    setSheet(sheet);
    return sheet;
}
 
Example 17
Source File: NavigationCaseEdge.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet s = Sheet.createDefault();
    Set ss = s.get("general"); // NOI18N
    if (ss == null) {
        ss = new Sheet.Set();
        ss.setName("general"); // NOI18N
        ss.setDisplayName(NbBundle.getMessage(NavigationCaseEdge.class, "General")); // NOI18N
        ss.setShortDescription(NbBundle.getMessage(NavigationCaseEdge.class, "GeneralHint")); // NOI18N
        s.put(ss);
    }
    Set gs = ss;
    
    try {
        PropertySupport.Reflection<String> p;
        
        p = new ModelProperty(navCase, String.class, "getFromOutcome", "setFromOutcome"); // NOI18N
        p.setName("fromOutcome"); // NOI18N
        p.setDisplayName(NbBundle.getMessage(NavigationCaseEdge.class, "Outcome")); // NOI18N
        p.setShortDescription(NbBundle.getMessage(NavigationCaseEdge.class, "OutcomeHint")); // NOI18N
        ss.put(p);
        
        p = new ModelProperty(navCase, String.class, "getFromAction", "setFromAction"); // NOI18N
        p.setName("fromView"); // NOI18N
        p.setDisplayName(NbBundle.getMessage(NavigationCaseEdge.class, "FromAction")); // NOI18N
        p.setShortDescription(NbBundle.getMessage(NavigationCaseEdge.class, "FromActionHint")); // NOI18N
        //                p.setValue(PageSelector.PROPERTY_NAVDOC, document);
        //                p.setPropertyEditorClass(PageSelector.class);
        ss.put(p);
        
        p = new ModelProperty(navCase, String.class, "getToViewId", "setToViewId"); // NOI18N
        p.setName("toViewId"); // NOI18N
        p.setDisplayName(NbBundle.getMessage(NavigationCaseEdge.class, "ToViewId")); // NOI18N
        p.setShortDescription(NbBundle.getMessage(NavigationCaseEdge.class, "ToViewHint")); // NOI18N
        //                p.setValue(PageSelector.PROPERTY_NAVDOC, document);
        //                p.setPropertyEditorClass(PageSelector.class);
        ss.put(p);
        
    } catch (NoSuchMethodException nsme) {
        ErrorManager.getDefault().notify(nsme);
    }
    
    return s;
}
 
Example 18
Source File: OccurrenceTupleNode.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 cellref.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 cellref.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 cellref.getAttributeRef().getName();
        }

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    set.put(new StringProperty(PREVIOUS_VALUE, Bundle.COL_PreviousValue()) {
        @Override
        public String getValue() throws IllegalAccessException, InvocationTargetException {
            if (previousValue == null) {
                return "-";
            }
            return previousValue.toString();
        }

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

        //TODO: implement inplace editor
        @Override
        public boolean canWrite() {
            return true;
        }
    });
    return sheet;
}
 
Example 19
Source File: StatisticNode.java    From BART with MIT License 4 votes vote down vote up
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setName("statInfo");set.setDisplayName("Statistics Result info");
    Sheet.Set set2 = Sheet.createPropertiesSet();
    set2.setName("systemtInfo");set2.setDisplayName("System info");
    
    final Statistic stat = getLookup().lookup(Statistic.class);
    
    if(stat == null)return sheet;
    
    try{
        //set1
        Property name = new PropertySupport.Reflection(stat,String.class,"getName",null);
        name.setName("name");name.setDisplayName("NAME :");
        StringBuilder sbName = new StringBuilder(R.HTML_Prop);
        sbName.append(stat.getName());
        sbName.append(R.HTML_CL_Prop);
        name.setValue("htmlDisplayValue",sbName.toString());
        name.setValue("suppressCustomEditor", Boolean.TRUE);
        set.put(name);
        
        Property startTime = new PropertySupport.Reflection(stat,String.class,"getStarTime",null);
        startTime.setName("startTime");startTime.setDisplayName("Start Time : ");
        StringBuilder sbStartTime = new StringBuilder(R.HTML_Prop);
        sbStartTime.append(stat.getStarTime());
        sbStartTime.append(R.HTML_CL_Prop);
        startTime.setValue("htmlDisplayValue",sbStartTime.toString());
        startTime.setValue("suppressCustomEditor", Boolean.TRUE);
        set.put(startTime);
        
        Property timeExecution = new PropertySupport.Reflection(stat,double.class,"getTimeExecution",null);
        timeExecution.setName("timeExecution");timeExecution.setDisplayName("Execution Time : ");
        StringBuilder sbTimeExecution = new StringBuilder(R.HTML_Prop);
        sbTimeExecution.append(stat.getTimeExecution());
        sbTimeExecution.append(R.HTML_CL_Prop);
        timeExecution.setValue("htmlDisplayValue",sbTimeExecution.toString());
        timeExecution.setValue("suppressCustomEditor", Boolean.TRUE);
        set.put(timeExecution);        
    
        Property changes = new PropertySupport.ReadOnly("changes", String.class , "Changes : ", "") {             
            @Override
            public Object getValue() throws IllegalAccessException, InvocationTargetException {
                return stat.getNumCellChanges();
            }
        };
        StringBuilder sbchanges = new StringBuilder(R.HTML_Prop);
        sbchanges.append(stat.getNumCellChanges());
        sbchanges.append(R.HTML_CL_Prop);
        changes.setValue("htmlDisplayValue",sbchanges.toString());
        changes.setValue("suppressCustomEditor", Boolean.TRUE);
        set.put(changes);
        
        //Set 2
    
        Property osName = new PropertySupport.Reflection(stat,String.class,"getOsName",null);
        osName.setName("osname");osName.setDisplayName("OS Name : ");
        StringBuilder sbOsName = new StringBuilder(R.HTML_Prop);
        sbOsName.append(stat.getOsName());
        sbOsName.append(R.HTML_CL_Prop);
        osName.setValue("htmlDisplayValue",sbOsName.toString());
        osName.setValue("suppressCustomEditor", Boolean.TRUE);
        set2.put(osName);
        
        Property osArch = new PropertySupport.Reflection(stat,String.class,"getOsArch",null);
        osArch.setName("osArch");osArch.setDisplayName("OS Arch : ");
        StringBuilder sbOsArch = new StringBuilder(R.HTML_Prop);
        sbOsArch.append(stat.getOsArch());
        sbOsArch.append(R.HTML_CL_Prop);
        osArch.setValue("htmlDisplayValue",sbOsArch.toString());
        osArch.setValue("suppressCustomEditor", Boolean.TRUE);
        set2.put(osArch);
        
        Property osVersion = new PropertySupport.Reflection(stat,String.class,"getOsVersion",null);
        osVersion.setName("osVersion");osVersion.setDisplayName("OS Version : ");
        StringBuilder sbosVersion = new StringBuilder(R.HTML_Prop);
        sbosVersion.append(stat.getOsVersion());
        sbosVersion.append(R.HTML_CL_Prop);
        osVersion.setValue("htmlDisplayValue",sbosVersion.toString());
        osVersion.setValue("suppressCustomEditor", Boolean.TRUE);
        set2.put(osVersion);
        
        Property javaVersion = new PropertySupport.Reflection(stat,String.class,"getJavaVersion",null);
        javaVersion.setName("osArch");javaVersion.setDisplayName("Java Version : ");
        StringBuilder sbjavaVersion = new StringBuilder(R.HTML_Prop);
        sbjavaVersion.append(stat.getJavaVersion());
        sbjavaVersion.append(R.HTML_CL_Prop);
        javaVersion.setValue("htmlDisplayValue",sbjavaVersion.toString());
        javaVersion.setValue("suppressCustomEditor", Boolean.TRUE);
        set2.put(javaVersion);

        
    }catch(Exception ex)   {
        return sheet;
    }       
    sheet.put(set);
    sheet.put(set2);
    return sheet;
}
 
Example 20
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;
}