private void fixClassProperty(BaseClass bclass, String name, String prettyName) { PropertyInterface property = bclass.get(name); if (!(property instanceof DBListClass)) { bclass.removeField(name); bclass.addDBListField(name, prettyName, 80, true, null); DBListClass fixedProperty = (DBListClass) bclass.get(name); fixedProperty.setDisplayType(ListClass.DISPLAYTYPE_INPUT); } } }
public void flushCache() { Object[] props = getPropertyNames(); for (int i = 0; i < props.length; i++) { String propname = (String) props[i]; PropertyClass propclass = (PropertyClass) get(propname); if (propclass != null) { propclass.flushCache(); } } }
@Override public String getClassName() { BaseClass bclass = getxWikiClass(); return (bclass == null) ? "" : bclass.getName(); }
@Override protected void createClass(BaseClass xclass) { xclass.addTextField(PARAMETER_NAME_PROPERTY, "Parameter name", 30); xclass.addTextAreaField(PARAMETER_DESCRIPTION_PROPERTY, "Parameter description", 40, 5); xclass.addBooleanField(PARAMETER_MANDATORY_PROPERTY, "Parameter mandatory", "yesno"); xclass.addTextField(PARAMETER_DEFAULT_VALUE_PROPERTY, "Parameter default value", 30); xclass.addTextField(PARAMETER_TYPE_PROPERTY, "Parameter type", 60); } }
public boolean addPasswordField(String fieldName, String fieldPrettyName, int size) { if (get(fieldName) == null) { PasswordClass text_class = new PasswordClass(); text_class.setName(fieldName); text_class.setPrettyName(fieldPrettyName); text_class.setSize(size); text_class.setObject(this); put(fieldName, text_class); return true; } return false; }
public boolean addBooleanField(String fieldName, String fieldPrettyName, String displayType) { if (get(fieldName) == null) { BooleanClass boolean_class = new BooleanClass(); boolean_class.setName(fieldName); boolean_class.setPrettyName(fieldPrettyName); boolean_class.setDisplayType(displayType); boolean_class.setObject(this); put(fieldName, boolean_class); return true; } return false; }
public boolean addTextField(String fieldName, String fieldPrettyName, int size) { if (get(fieldName) == null) { StringClass text_class = new StringClass(); text_class.setName(fieldName); text_class.setPrettyName(fieldPrettyName); text_class.setSize(size); text_class.setObject(this); put(fieldName, text_class); return true; } return false; }
/** * @param xclass the class to add to * @param name the name of the property to add * @param prettyName the pretty name of the property to add */ private void addWatchedElementField(BaseClass xclass, String name, String prettyName) { xclass.addDBListField(name, prettyName, 80, true, null); // Set the input display type in order to easily debug from the object editor. DBListClass justAddedProperty = (DBListClass) xclass.get(name); justAddedProperty.setDisplayType(ListClass.DISPLAYTYPE_INPUT); } }
/** * Mark a property as disabled. A disabled property should not be editable, but existing object values are still * kept in the database. * * @param name the name of the property to disable * @since 2.4M2 */ public void disableField(String name) { PropertyClass pclass = (PropertyClass) safeget(name); if (pclass != null) { pclass.setDisabled(true); } }
public BaseCollection newObject(XWikiContext context) { return new NumberClass(); } }
@Override public BaseClass getxWikiClass(XWikiContext context) { return getxWikiClass(); }
public BaseCollection newObject(XWikiContext context) { return new TextAreaClass(); } }
public StringClass(String name, String prettyname, PropertyMetaClass wclass) { super(name, prettyname, wclass); setSize(30); }
public PasswordClass(PropertyMetaClass wclass) { super("password", "Password", wclass); setxWikiClass(wclass); }
public BooleanClass() { this(null); setDisplayFormType("select"); }
public BaseCollection newObject(XWikiContext context) { return new PasswordClass(); } }
/** * {@inheritDoc} * * @see com.xpn.xwiki.objects.BaseCollection#toXML(com.xpn.xwiki.objects.classes.BaseClass) */ @Override public Element toXML(BaseClass bclass) { return toXML(); }
public boolean addDBTreeListField(String fieldName, String fieldPrettyName, int size, boolean multiSelect, String sql) { return addDBTreeListField(fieldName, fieldPrettyName, size, multiSelect, multiSelect, sql); }
/** * Re-enable a property. This field will appear again in object instances. * * @param name the name of the property to enable * @since 2.4M2 */ public void enableField(String name) { PropertyClass pclass = (PropertyClass) safeget(name); if (pclass != null) { pclass.setDisabled(false); } }