/** * Set the description (table header tooltip) for the property column * representing properties that have the passed programmatic (not display) * name, or for the tree column. * * @param columnName The programmatic name (Property.getName()) of the * column, or name of the tree column * @param description Tooltip text for the column header for that column */ public final void setPropertyColumnDescription(String columnName, String description) { Parameters.notNull ("columnName", columnName); //NOI18N Property[] props = rowModel.getProperties(); for (Property p : props) { if (columnName.equals(p.getName())) { p.setShortDescription(description); } } if (columnName.equals(model.getColumnName(0))) { outline.setNodesColumnDescription(description); } }
/** * 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; }
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; }
Node.Property<?> id = new PropertySupport.Reflection<String>(info, String.class, "getId", null); //NOI18N id.setDisplayName(LBL_Id()); id.setShortDescription(""); //NOI18N Node.Property<?> name = new PropertySupport.Reflection<String>(info, String.class, "getName", null); //NOI18N name.setDisplayName(LBL_Name()); 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(""); Node.Property<?> localRepoLocation = new PropertySupport.Reflection<String>(info, String.class, "getRepositoryPath", null); //NOI18N localRepoLocation.setDisplayName(LBL_Local_repository_path());
/** * 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); }
/** * 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); }
@Override public void setShortDescription(String text) { original.setShortDescription(text); }
public void setShortDescription(java.lang.String str) { del.setShortDescription(str); }
public void setShortDescription(int column, String descr) { assert column < prop.length : column + " must be bellow " + prop.length; prop[column].setShortDescription(descr); descs[column] = null; }