/** * Used to build property for each position coordinate of various nodes * (x,y,z) in the same way. * * @return Property for that coordinate */ private Property buildMultipleNodesGeneralPositionProperty(MultipleNodesPropertiesWrapper nodesWrapper, String coordinate) throws NoSuchMethodException { //Position: Property p = new PropertySupport.Reflection(nodesWrapper, Float.class, "getNodes" + coordinate.toUpperCase(), "setNodes" + coordinate.toUpperCase()); p.setDisplayName(NbBundle.getMessage(EditNodes.class, "EditNodes.position.text", coordinate)); p.setName(coordinate); return p; } }
/** * Used to build property for each position coordinate (x,y,z) in the same * way. * * @return Property for that coordinate */ private Property buildGeneralPositionProperty(Node node, String coordinate) throws NoSuchMethodException { //Position: Property p = new PropertySupport.Reflection(node, Float.TYPE, coordinate, "set" + coordinate.toUpperCase()); p.setDisplayName(NbBundle.getMessage(EditNodes.class, "EditNodes.position.text", coordinate)); p.setName(coordinate); return p; }
protected Property[] getProperties() throws NoSuchMethodException{ ServoController obj = getLookup().lookup(ServoController.class); if(obj == null){ return new Property[0]; } Property enabledProp = new PropertySupport.Reflection(obj, Boolean.class, Joint.PROP_ENABLED); enabledProp.setName("Enabled"); return new Property[]{enabledProp}; }
p.setName("Text"); // NOI18N p.setDisplayName(getBundleString("LBL_Text")); // parens: ensure first ss.put(p); } else { p = getElementNameProperty(box); p.setName("ElementName"); // NOI18N p.setDisplayName(getBundleString("LBL_Element")); // parens: ensure first p.setName("ElementId"); // NOI18N p.setDisplayName(getBundleString("LBL_Id")); ss.put(p); p.setName("attributes"); // NOI18N p.setDisplayName(getBundleString("LBL_Attributes")); ss.put(p); p.setName("BeanName"); // NOI18N p.setDisplayName(getBundleString("LBL_BeanName")); ss.put(p); p.setName("renderStream"); // NOI18N p.setDisplayName(getBundleString("LBL_RenderedHtml")); // NOI18N ss.put(p); p.setName("localStyles"); // NOI18N p.setDisplayName(getBundleString("LBL_LocalStyles")); ss.put(p); p.setName("styles"); // NOI18N
p.setName("size"); set.put(p); p.setName("color"); set.put(p); p.setName("labelcolor"); set.put(p); p.setName("labelsize"); set.put(p); p.setName("labelvisible"); set.put(p); p.setName("size"); set.put(p); p = new PropertySupport.Reflection(nodeWrapper, Color.class, "getNodeColor", "setNodeColor"); p.setDisplayName(NbBundle.getMessage(EditNodes.class, "EditNodes.color.text")); p.setName("color"); set.put(p); p.setName("labelsize"); set.put(p); p.setName("labelcolor"); set.put(p);
p = new PropertySupport.Reflection(edgesWrapper, Color.class, "getEdgesColor", "setEdgesColor"); p.setDisplayName(NbBundle.getMessage(EditEdges.class, "EditEdges.color.text")); p.setName("color"); set.put(p); p.setName("labelcolor"); set.put(p); p.setName("labelsize"); set.put(p); p.setName("labelvisible"); set.put(p); p = new PropertySupport.Reflection(edgeWrapper, Color.class, "getEdgeColor", "setEdgeColor"); p.setDisplayName(NbBundle.getMessage(EditEdges.class, "EditEdges.color.text")); p.setName("color"); set.put(p); p.setName("labelsize"); set.put(p); p.setName("labelcolor"); set.put(p); p.setName("labelvisible"); set.put(p);
p.setName(column.getId()); set.put(p);
p.setName(column.getId()); set.put(p);
name.setShortDescription(""); //NOI18N Node.Property<?> local = new PropertySupport.Reflection<Boolean>(info, Boolean.TYPE, "isLocal", null); //NOI18N local.setName("local"); //NOI18N local.setDisplayName(LBL_Local()); local.setShortDescription("");
/** * Creates a node property of the given key (same as the column keys) * and specific getter/setter methods on the given object. * * @param key property name (same as matching column). * @param type Class of the property (e.g. String.class). * @param inst object on which to reflect. * @param getter name of getter method for property value. * @param setter name of setter method for property value (may be null). * @return new property. */ private Node.Property createProperty(String key, Class type, Object inst, String getter, String setter) { Property prop = null; try { prop = new Reflection(inst, type, getter, setter); prop.setName(key); prop.setDisplayName(NbBundle.getMessage( ExternalReferenceDataNode.class, "CTL_ExternalReferenceCreator_Column_Name_" + key)); prop.setShortDescription(NbBundle.getMessage( ExternalReferenceDataNode.class, "CTL_ExternalReferenceCreator_Column_Desc_" + key)); } catch (NoSuchMethodException nsme) { ErrorManager.getDefault().notify(nsme); } return prop; }
/** * Create a property. * The parameter <code>propertyName</code> will be used as the canonical name of the <code>LayoutProperty</code>. * @param layout The layout instance * @param valueType The type of the property value, ex: <code>Double.class</code> * @param propertyName The display name of the property * @param propertyCategory A category string or <code>null</code> for using * default category * @param propertyCanonicalName Canonical name for the <code>LayoutProperty</code>. It should be unique and not localized * @param propertyDescription A description string for the property * @param getMethod The name of the get method for this property, must exist * to make Java reflexion working. * @param setMethod The name of the set method for this property, must exist * to make Java reflexion working. * @return the created property * @throws NoSuchMethodException if the getter or setter methods cannot be found */ public static LayoutProperty createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyCanonicalName, String propertyDescription, String getMethod, String setMethod) throws NoSuchMethodException { Property property = new PropertySupport.Reflection( layout, valueType, getMethod, setMethod); property.setName(propertyName); property.setShortDescription(propertyDescription); return new LayoutProperty(property, propertyCategory, propertyCanonicalName); }
protected Sheet createSheet () { Sheet s = Sheet.createDefault (); Sheet.Set ss = s.get (Sheet.PROPERTIES); Node.Property p; p = createNameProperty (obj); ss.put (p); FileObject fo = getDataObject().getPrimaryFile(); if (couldBeTemplate(fo) && !fo.isReadOnly()) { try { p = new PropertySupport.Reflection(obj, Boolean.TYPE, "isTemplate", "setTemplate"); // NOI18N p.setName(DataObject.PROP_TEMPLATE); p.setDisplayName(DataObject.getString("PROP_template")); p.setShortDescription(DataObject.getString("HINT_template")); ss.put(p); } catch (Exception ex) { throw new InternalError(); } } if (fo.isData()) { ss.put(new AllFilesProperty()); ss.put(new SizeProperty()); ss.put(new LastModifiedProperty()); } return s; }
/** * Create a property. * The parameter <code>propertyName</code> will be used as the canonical name of the <code>LayoutProperty</code>. * @param layout The layout instance * @param valueType The type of the property value, ex: <code>Double.class</code> * @param propertyName The display name of the property * @param propertyCategory A category string or <code>null</code> for using * default category * @param propertyDescription A description string for the property * @param getMethod The name of the get method for this property, must exist * to make Java reflexion working. * @param setMethod The name of the set method for this property, must exist * to make Java reflexion working. * @return the created property * @throws NoSuchMethodException if the getter or setter methods cannot be found */ public static LayoutProperty createProperty(Layout layout, Class valueType, String propertyName, String propertyCategory, String propertyDescription, String getMethod, String setMethod) throws NoSuchMethodException { Property property = new PropertySupport.Reflection( layout, valueType, getMethod, setMethod); property.setName(propertyName); property.setShortDescription(propertyDescription); return new LayoutProperty(property, propertyCategory, propertyName); }
protected Property[] getProperties() throws NoSuchMethodException{ ServoConfig obj = getLookup().lookup(ServoConfig.class); Property logIdProp = new PropertySupport.Reflection(obj, Integer.class, ServoConfig.PROP_ID); logIdProp.setName("Servo Id"); Property nameProp = new PropertySupport.Reflection(obj, String.class, ServoConfig.PROP_NAME); nameProp.setName("Name"); Property minPosProp = new PropertySupport.Reflection(obj, Integer.class, ServoConfig.PROP_MIN_POSITION); minPosProp.setName("Minimum Position"); Property maxPosProp = new PropertySupport.Reflection(obj, Integer.class, ServoConfig.PROP_MAX_POSITION); maxPosProp.setName("Maximum Position"); Property defPosProp = new PropertySupport.Reflection(obj, Integer.class, ServoConfig.PROP_DEF_POSITION); defPosProp.setName("Default Position"); return new Property[]{logIdProp, nameProp, minPosProp, maxPosProp, defPosProp}; }
public void setName(java.lang.String str) { del.setName(str); }
@Override public void setName(String name) { original.setName(name); }
protected Property[] getProperties() throws NoSuchMethodException{ Joint obj = getLookup().lookup(Joint.class); Property goalPosProp = new PropertySupport.Reflection(obj, Double.class, Joint.PROP_GOAL_POSITION); goalPosProp.setName("Goal Position"); Property enabledProp = new PropertySupport.Reflection(obj, Boolean.class, Joint.PROP_ENABLED); enabledProp.setName("Enabled"); return new Property[]{goalPosProp, enabledProp}; }