当前位置: 首页>>代码示例>>Java>>正文


Java PropertySupport类代码示例

本文整理汇总了Java中org.openide.nodes.PropertySupport的典型用法代码示例。如果您正苦于以下问题:Java PropertySupport类的具体用法?Java PropertySupport怎么用?Java PropertySupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertySupport类属于org.openide.nodes包,在下文中一共展示了PropertySupport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPropertySets

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ClusterizeInfo.java

示例2: createProperty

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
public static <T> Node.Property<T> createProperty (Object inst, Class<T> type,
                                            String name, String dispName,
                                            String shortDesc,
                                            String getter, String setter ) {
    Node.Property<T> prop;

    try {
        prop = new PropertySupport.Reflection<T> (inst, type, getter, setter);
    } catch (NoSuchMethodException e) {            
        throw new IllegalStateException (e.getMessage() + " " + getter); // NOI18N
    }
    
    prop.setName (name);
    prop.setDisplayName (dispName);
    prop.setShortDescription (shortDesc);
    return prop;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:BiNode.java

示例3: addIncludedProperty

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
protected void addIncludedProperty( Sheet.Set ps ) {    
    ps.put(new PropertySupport.ReadWrite<Boolean> (
               PROP_INCLUDED,
               Boolean.TYPE,
               GenerateBeanInfoAction.getString ("PROP_Bi_" + PROP_INCLUDED ),
               GenerateBeanInfoAction.getString ("HINT_Bi_" + PROP_INCLUDED )
           ) {
               public Boolean getValue () {
                   return biFeature.isIncluded ();
               }
               public void setValue (Boolean val) throws
                   IllegalAccessException, IllegalArgumentException, InvocationTargetException {
                   try {
                       biFeature.setIncluded ( val );
                       setIconBaseWithExtension( biFeature.getIconBase(false) + ".gif" );
                   } catch (ClassCastException e) {
                       throw new IllegalArgumentException ();
                   }
               }
           });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:BiFeatureNode.java

示例4: updateProperties

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
private void updateProperties(Parameter param) {
    PropertySupport<String> ps = new PropertySupport.Name(this);
    addProperty(ps);

    switch (param.getDirection()) {
        case IN:
            addProperty(TYPE, TYPEDESC, String.class, false, NbBundle.getMessage (ProcedureParamNode.class, "In")); // NOI18N
            break;
        case OUT:
            addProperty(TYPE, TYPEDESC, String.class, false, NbBundle.getMessage (ProcedureParamNode.class, "Out")); // NOI18N
            break;
        case INOUT:
            addProperty(TYPE, TYPEDESC, String.class, false, NbBundle.getMessage (ProcedureParamNode.class, "InOut")); // NOI18N
            break;
    }

    addProperty(DATATYPE, DATATYPEDESC, String.class, false, param.getType() == null ? "null" : param.getType().toString()); // NOI18N

    addProperty(DBDATATYPE, DBDATATYPEDESC, String.class, false,
            param.getTypeName() == null ? "" : param.getTypeName());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ProcedureParamNode.java

示例5: updateProperties

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
private void updateProperties(ForeignKeyColumn column) {
    PropertySupport ps = new PropertySupport.Name(this);
    addProperty(ps);

    try {
        Column referred = column.getReferredColumn();
        Column referring = column.getReferringColumn();

        addProperty(FKPOSITION, FKPOSITIONDESC, Integer.class, false, column.getPosition());
        addProperty(FKREFERRINGSCHEMA, FKREFERRINGSCHEMADESC, String.class, false, referring.getParent().getParent().getName());
        addProperty(FKREFERRINGTABLE, FKREFERRINGTABLEDESC, String.class, false, referring.getParent().getName());
        addProperty(FKREFERRINGCOLUMN, FKREFERRINGCOLUMNDESC, String.class, false, referring.getName());
        addProperty(FKREFERREDSCHEMA, FKREFERREDSCHEMADESC, String.class, false, referred.getParent().getParent().getName());
        addProperty(FKREFERREDTABLE, FKREFERREDTABLEDESC, String.class, false, referred.getParent().getName());
        addProperty(FKREFERREDCOLUMN, FKREFERREDCOLUMNDESC, String.class, false, referred.getName());

    } catch (Exception e) {
        Exceptions.printStackTrace(e);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ForeignKeyColumnNode.java

示例6: createProperty

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
/** Create PropertySupport for given property name and class */
private PropertySupport createProperty(final String name, final Class clazz) {
    return new PropertySupport.ReadWrite(name, clazz,
        getBundleString("PROP_" + name),    //NOI18N
        getBundleString("HINT_" + name)) {  //NOI18N
        public Object getValue() {
            return getProperty(name);
        }
        public void setValue(Object value) {
            setProperty(name, value);
        }
        public boolean supportsDefaultValue() {
            return false;
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:AnnotationTypesNode.java

示例7: getPropSet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
public Sheet.Set getPropSet() {
    Sheet.Set props = super.getPropSet();

    Node.Property p = new PropertySupport.ReadWrite("loglevel", Integer.class, "Log level", "") {

        public void setValue(Object val) {
            filter = replaceFilter(filter, new LogProxy.FilterLog(levels[(Integer) val]));
        }

        public Object getValue() {
            Integer i = levelToIndex.get(((LogProxy.FilterLog) filter).getLevel());
            return i;
        }
    };

    p.setValue("intValues", levelVals);
    p.setValue("stringKeys", levelNames);
    props.put(p);

    return props;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:22,代码来源:LogProxy.java

示例8: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    Sheet.Set props = sheet.get(Sheet.PROPERTIES);
    if (props == null) {
        props = Sheet.createPropertiesSet();
        sheet.put(props);
    }
    try {
        PropertySupport.Reflection prop = new ReflProp(serverDef, URI.class, "uri", "URI");
        prop.setPropertyEditorClass(getURIPropEditorClass());
        props.put(new Property[]{
                    new ReflProp(serverDef, String.class, "serverName", "Server name"), // TODO not working
                    prop,});

    } catch (NoSuchMethodException ex) {
        ex.printStackTrace();
    }

    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:22,代码来源:ServerNode.java

示例9: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);

    try {
        Node.Property nameProp = new PropertySupport.Reflection<String>(getDataNode(), String.class, "getName", "setName");
        nameProp.setName(DriveElement.deName);
        nameProp.setDisplayName("Name of drive element");
        set.put(new Property[]{nameProp});
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:17,代码来源:SimpleDriveElementWidget.java

示例10: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);

    try {
        Property nameProp = new PropertySupport.Reflection<String>(getDataNode(), String.class, "getActionName", "setActionName");
        nameProp.setName(TriggeredAction.taName);

        nameProp.setDisplayName("Name of the action");

        set.put(nameProp);
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:19,代码来源:SimpleRoleActionWidget.java

示例11: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);

    try {
        Property collectionNameProp = new PropertySupport.Reflection<String>(getDataNode(), String.class, "getDriveCollectionName", "setDriveCollectionName");

        collectionNameProp.setName(DriveCollection.dcName);
        collectionNameProp.setDisplayName("Name of drive collection");

        set.put(collectionNameProp);
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:19,代码来源:SimpleDriveCollectionWidget.java

示例12: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);

    try {

        Property nameProp = new PropertySupport.Reflection<String>(compNode, String.class, "getNodeName", "setNodeName");
        nameProp.setName(Competence.cnName);
        nameProp.setDisplayName("Name of competence node");
        
        set.put(new Property[]{nameProp});
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }

    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:20,代码来源:SimpleRoleCompetenceWidget.java

示例13: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);

    try {
        Property nameProp = new PropertySupport.Reflection<String>(getDataNode(), String.class, "getName", "setName");
        nameProp.setName(CompetenceElement.caName);
        nameProp.setDisplayName("Name of competence atom");
        
        Property retriesProp = new PropertySupport.Reflection<Integer>(getDataNode(), Integer.class, "getRetries", "setRetries");
        retriesProp.setName(CompetenceElement.caRetries);
        retriesProp.setDisplayName("Number of retries");

        Property commentProp = new PropertySupport.Reflection<String>(getDataNode(), String.class, "getComment", "setComment");
        commentProp.setName(CompetenceElement.caComment);
        commentProp.setDisplayName("Comment");

        set.put(new Property[]{nameProp, retriesProp, commentProp});
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:26,代码来源:SimpleCompetenceElementWidget.java

示例14: createSheet

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    sheet.put(set);

    try {
        Property nameProp = new PropertySupport.Reflection<String>(apNode, String.class, "getNodeName", "setNodeName");
        nameProp.setName(ActionPattern.apName);
        nameProp.setDisplayName("Name of action pattern");

        Property commentProp = new PropertySupport.Reflection<String>(apNode, String.class, "getNodeComment", "setNodeComment");
        commentProp.setName(ActionPattern.apComment);
        commentProp.setDisplayName("Comment about node");
        commentProp.setShortDescription("It is difficult to keep track about what part of POSH plan does what and that is where comments come in.");

        set.put(new Property[]{nameProp, commentProp});
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    return sheet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:23,代码来源:SimpleRoleActionPatternWidget.java

示例15: getPropertySets

import org.openide.nodes.PropertySupport; //导入依赖的package包/类
@Override
public PropertySet[] getPropertySets() {
    final Sheet.Set set = Sheet.createPropertiesSet();
    set.put(new PropertySupport.ReadOnly<Boolean>(
            "PROP_DebugBridgeConnected",
            Boolean.class,
            NbBundle.getMessage(DevicesNode.class, "PROP_DebugBridgeConnected"),
            NbBundle.getMessage(DevicesNode.class, "DESC_DebugBridgeConnected")) {
        @Override
        public Boolean getValue() throws IllegalAccessException, InvocationTargetException {
            final AndroidDebugBridge jp = AndroidSdkProvider.getAdb();
            return jp == null ? Boolean.FALSE : jp.isConnected();
        }
    });
    return new PropertySet[]{
        set
    };
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:19,代码来源:DevicesNode.java


注:本文中的org.openide.nodes.PropertySupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。