Search in sources :

Example 6 with StringClass

use of com.xpn.xwiki.objects.classes.StringClass in project xwiki-platform by xwiki.

the class PropertyMetaClass method addPresentationMetaProperties.

/**
 * Adds generic meta properties that control how an XClass property is displayed.
 */
private void addPresentationMetaProperties() {
    StringClass prettyNameClass = new StringClass(this);
    prettyNameClass.setName("prettyName");
    prettyNameClass.setPrettyName("Pretty Name");
    prettyNameClass.setSize(40);
    safeput(prettyNameClass.getName(), prettyNameClass);
    StringClass hintClass = new StringClass(this);
    hintClass.setName("hint");
    hintClass.setPrettyName("Hint");
    hintClass.setSize(40);
    safeput(hintClass.getName(), hintClass);
    TextAreaClass toolTipClass = new TextAreaClass(this);
    toolTipClass.setName("tooltip");
    toolTipClass.setPrettyName("Tooltip");
    toolTipClass.setSize(60);
    toolTipClass.setRows(5);
    safeput(toolTipClass.getName(), toolTipClass);
    TextAreaClass customDisplayClass = new TextAreaClass(this);
    customDisplayClass.setName("customDisplay");
    customDisplayClass.setPrettyName("Custom Display");
    customDisplayClass.setEditor("Text");
    customDisplayClass.setRows(5);
    customDisplayClass.setSize(80);
    safeput(customDisplayClass.getName(), customDisplayClass);
}
Also used : StringClass(com.xpn.xwiki.objects.classes.StringClass) TextAreaClass(com.xpn.xwiki.objects.classes.TextAreaClass)

Aggregations

StringClass (com.xpn.xwiki.objects.classes.StringClass)6 TextAreaClass (com.xpn.xwiki.objects.classes.TextAreaClass)3 BaseObject (com.xpn.xwiki.objects.BaseObject)2 BaseProperty (com.xpn.xwiki.objects.BaseProperty)2 StringProperty (com.xpn.xwiki.objects.StringProperty)2 BaseClass (com.xpn.xwiki.objects.classes.BaseClass)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 DocumentReference (org.xwiki.model.reference.DocumentReference)2 XWikiContext (com.xpn.xwiki.XWikiContext)1 XWikiException (com.xpn.xwiki.XWikiException)1 BaseCollection (com.xpn.xwiki.objects.BaseCollection)1 BaseStringProperty (com.xpn.xwiki.objects.BaseStringProperty)1 LargeStringProperty (com.xpn.xwiki.objects.LargeStringProperty)1 LongProperty (com.xpn.xwiki.objects.LongProperty)1 BooleanClass (com.xpn.xwiki.objects.classes.BooleanClass)1 PasswordClass (com.xpn.xwiki.objects.classes.PasswordClass)1 MigrationRequiredException (com.xpn.xwiki.store.migration.MigrationRequiredException)1 SQLException (java.sql.SQLException)1 Date (java.util.Date)1