public void setContentType(String contentType) { setStringValue("contenttype", contentType); }
public boolean addTextAreaField(String fieldName, String fieldPrettyName, int cols, int rows) { if (get(fieldName) == null) { TextAreaClass template_class = new TextAreaClass(); template_class.setName(fieldName); template_class.setPrettyName(fieldPrettyName); template_class.setSize(cols); template_class.setRows(rows); template_class.setObject(this); put(fieldName, template_class); return true; } return false; }
/** * @return true if the content of this text area is not a wiki syntax content */ public boolean isWikiContent() { String contentType = getContentType(); if (contentType != null && !contentType.equals("puretext") && !contentType.equals("velocitycode")) { return true; } else { return false; } }
public void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) boolean isWysiwyg = isWysiwyg(context); textarea textarea = new textarea(); String tname = prefix + name; textarea.setCols(getSize()); textarea.setRows(getRows() + (isWysiwyg ? 2 : 0)); textarea.setDisabled(isDisabled());
if (scriptField.getEditor() != "puretext") { scriptField.setStringValue("editor", "PureText"); needsUpdate = true;
XWikiContext context) String contentType = getContentType(); XWikiDocument doc = context.getDoc(); StringBuffer result = new StringBuffer(); super.displayView(result, name, prefix, object, context); if (getObjectDocumentSyntax(object, context).equals(Syntax.XWIKI_1_0)) { buffer.append(context.getWiki().parseContent(result.toString(), context)); } else { if (doc != null) { buffer.append(doc.getRenderedContent(result.toString(), getObjectDocumentSyntax(object, context).toIdString(), context)); } else { buffer.append(result);
BaseClass bclass = bobject.getXClass(context); for (Object fieldClass : bclass.getProperties()) { if (fieldClass instanceof TextAreaClass && ((TextAreaClass) fieldClass).isWikiContent()) { TextAreaClass textAreaClass = (TextAreaClass) fieldClass; LargeStringProperty field = (LargeStringProperty) bobject.getField(textAreaClass.getName());
public String getEditor() { return getStringValue("editor").toLowerCase(); }
public BaseCollection newObject(XWikiContext context) { return new TextAreaClass(); } }
public int getRows() { return getIntValue("rows"); }
/** * {@inheritDoc} * * @see com.xpn.xwiki.objects.classes.StringClass#newProperty() */ @Override public BaseProperty newProperty() { BaseProperty property = new LargeStringProperty(); property.setName(getName()); return property; }
public String getContentType() { String result = getStringValue("contenttype").toLowerCase(); if (result.equals("")) { result = "fullyrenderedtext"; } return result; }
public DBListMetaClass() { super(); setPrettyName("Database List"); setName(DBListClass.class.getName()); TextAreaClass sql_class = new TextAreaClass(this); sql_class.setName("sql"); sql_class.setPrettyName("Hibernate Query"); sql_class.setSize(80); sql_class.setRows(5); safeput("sql", sql_class); StringClass classname_class = new StringClass(this); classname_class.setName("classname"); classname_class.setPrettyName("XWiki Class Name"); classname_class.setSize(20); safeput("classname", classname_class); StringClass idfield_class = new StringClass(this); idfield_class.setName("idField"); idfield_class.setPrettyName("Id Field Name"); idfield_class.setSize(20); safeput("idField", idfield_class); StringClass valuefield_class = new StringClass(this); valuefield_class.setName("valueField"); valuefield_class.setPrettyName("Value Field Name"); valuefield_class.setSize(20); safeput("valueField", valuefield_class); }
safeput("prettyName", prettyname_class); TextAreaClass tooltip_class = new TextAreaClass(this); tooltip_class.setName("tooltip"); tooltip_class.setPrettyName("Tooltip"); tooltip_class.setSize(60); tooltip_class.setRows(5); safeput("tooltip", tooltip_class); TextAreaClass customdisplay_class = new TextAreaClass(this); customdisplay_class.setName("customDisplay"); customdisplay_class.setPrettyName("Custom Display"); customdisplay_class.setRows(5); customdisplay_class.setSize(80); safeput("customDisplay", customdisplay_class);