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


Java PropertySupport.Reflection方法代码示例

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


在下文中一共展示了PropertySupport.Reflection方法的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: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例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 {
        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

示例10: createSheet

import org.openide.nodes.PropertySupport; //导入方法依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setName("AssetKey");
    set.setDisplayName("Conversion Settings");
    for (Field field : key.getClass().getDeclaredFields()) {
        PropertyDescriptor prop = PropertyUtils.getPropertyDescriptor(key.getClass(), field);
        if (prop != null) {
            try {
                Property sup = new PropertySupport.Reflection(key, prop.getPropertyType(), prop.getReadMethod(), prop.getWriteMethod());
                sup.setName(prop.getName());
                sup.setDisplayName(prop.getDisplayName());
                set.put(sup);
            } catch (Exception e) {
                Exceptions.printStackTrace(e);
            }
        }
    }
    sheet.put(set);
    return sheet;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:23,代码来源:ImportKeyNode.java

示例11: createSheet

import org.openide.nodes.PropertySupport; //导入方法依赖的package包/类
@Override
protected Sheet createSheet() {
    Sheet sheet = super.createSheet();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setName("NavMeshGenerator");
    set.setDisplayName("Settings");
    for (Field field : key.getClass().getDeclaredFields()) {
        PropertyDescriptor prop = PropertyUtils.getPropertyDescriptor(key.getClass(), field);
        if (prop != null) {
            try {
                Property sup = new PropertySupport.Reflection(key, prop.getPropertyType(), prop.getReadMethod(), prop.getWriteMethod());
                sup.setDisplayName(prop.getDisplayName());
                sup.setShortDescription(org.openide.util.NbBundle.getMessage(NavMeshAction.class, "properties."+prop.getName()));
                set.put(sup);
            } catch (Exception e) {
                Exceptions.printStackTrace(e);
            }
        }
    }
    sheet.put(set);
    return sheet;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:23,代码来源:NavMeshGeneratorNode.java

示例12: createSheet

import org.openide.nodes.PropertySupport; //导入方法依赖的package包/类
@Override
protected Sheet createSheet() {
  Sheet sheet = Sheet.createDefault();
  Sheet.Set set = Sheet.createPropertiesSet();
  set.setDisplayName("FeedRate Properties");
  try {
    Property<Double> rpmProp = new PropertySupport.Reflection<>(feedrate, double.class, "Rpm");
    rpmProp.setName("RPM");
    rpmProp.setShortDescription("Maximum RPM");
    set.put(rpmProp);

    Property<Double> velProp = new PropertySupport.Reflection<>(feedrate, double.class, "Velocity");
    velProp.setName("Velocity");
    velProp.setShortDescription("Maximum Velocity");
    set.put(velProp);
  } catch (NoSuchMethodException ex) {
    ErrorManager.getDefault();
  }
  sheet.put(set);
  return sheet;
}
 
开发者ID:billooms,项目名称:COrnLathe,代码行数:22,代码来源:FeedRateNode.java

示例13: createSheet

import org.openide.nodes.PropertySupport; //导入方法依赖的package包/类
@Override
protected Sheet createSheet() {
  Sheet sheet = Sheet.createDefault();
  Sheet.Set set = Sheet.createPropertiesSet();
  set.setDisplayName("Threads Properties");
  try {
    Property<Integer> tpiProp = new PropertySupport.Reflection<>(threads, int.class, "tpi");
    tpiProp.setName("TPI");
    tpiProp.setShortDescription("Threads per inch");
    set.put(tpiProp);
    
    Property<Integer> startsProp = new PropertySupport.Reflection<>(threads, int.class, "starts");
    startsProp.setName("Starts");
    startsProp.setShortDescription("Number of thread starts");
    set.put(startsProp);
    
    Property<Integer> percentProp = new PropertySupport.Reflection<>(threads, int.class, "percent");
    percentProp.setName("%");
    percentProp.setShortDescription("Percent thread engagement");
    set.put(percentProp);
  } catch (NoSuchMethodException ex) {
    ErrorManager.getDefault();
  }
  sheet.put(set);
  return sheet;
}
 
开发者ID:billooms,项目名称:COrnLathe,代码行数:27,代码来源:ThreadsNode.java

示例14: createSheet

import org.openide.nodes.PropertySupport; //导入方法依赖的package包/类
@Override
protected Sheet createSheet() {
  Sheet sheet = Sheet.createDefault();
  Sheet.Set set = Sheet.createPropertiesSet();
  set.setDisplayName("Controls Properties");
  try {
    Property<Kind> kindProp = new PropertySupport.Reflection<>(controls, Kind.class, "Kind");
    kindProp.setName("Kind of cuts");
    kindProp.setShortDescription("Kind of cutting selects which controls are active");
    set.put(kindProp);
  } catch (NoSuchMethodException ex) {
    ErrorManager.getDefault();
  }
  sheet.put(set);
  return sheet;
}
 
开发者ID:billooms,项目名称:COrnLathe,代码行数:17,代码来源:ControlsNode.java

示例15: createSheet

import org.openide.nodes.PropertySupport; //导入方法依赖的package包/类
@Override
protected Sheet createSheet() {
  super.createSheet();
  set.setDisplayName("PiercePoint Properties");
  try {
    Property<Direction> motionProp = new PropertySupport.Reflection<>(cpt, Direction.class, "Direction");
    motionProp.setName("Direction");
    motionProp.setShortDescription("Direction of cutting motion");
    set.put(motionProp);

    Property<Double> cutWProp = new PropertySupport.Reflection<>(cpt, double.class, "getWidthAtMax", null);
    cutWProp.setName("Cut Width");
    cutWProp.setShortDescription("Width of cut at the maximum cut depth");
    set.put(cutWProp);
  } catch (NoSuchMethodException ex) {
    ErrorManager.getDefault();
  }
  sheet.put(set);
  return sheet;
}
 
开发者ID:billooms,项目名称:COrnLathe,代码行数:21,代码来源:PiercePointNode.java


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