public HstRenderPathEditor(final String id, final IModel<String> valueModel) { super(id); setOutputMarkupId(true); final String propertyValue = valueModel.getObject(); // validation icon Label validationIcon = new Label("validation-icon", StringUtils.EMPTY); add(validationIcon); determineIcon(validationIcon, propertyValue); // input field final TextAreaWidget editor = new TextAreaWidget("reference-edit", valueModel); editor.setRows("1"); add(editor); }
@Override protected Component createValueEditor(final JcrPropertyValueModel valueModel) throws RepositoryException { StringConverter stringModel = new StringConverter(valueModel); TextAreaWidget editor = createEditorWidget("value", stringModel); editor.setCols(String.valueOf(TEXT_AREA_MAX_COLUMNS)); editor.setRows(String.valueOf(getRows(stringModel))); return editor; }
public DescriptionPanel(String id, IModel model, IPluginContext context, IPluginConfig config) { super(id, model); this.context = context; this.config = config; TextAreaWidget descWidget = new TextAreaWidget("description", new PropertyModel(model, "description")); descWidget.setRenderBodyOnly(true); add(descWidget); }
public TextAreaWidget(String id, IModel<String> model) { super(id, model); textArea = createTextArea(model); textArea.setType(String.class); addFormField(textArea); }
public TextDialog(IModel<String> title, IModel<String> question, IModel<String> textModel) { super(); this.title = title; add(new Label("question", question)); TextAreaWidget textfield; add(textfield = new TextAreaWidget("value", textModel)); textfield.addBehaviourOnFormComponent( new AttributeAppender("class", true, new Model<String>("text-dialog-textarea"), " ")); setFocus(textfield.getFocusComponent()); }
String asString = stringModel.getObject(); if (asString.contains("\n")) { TextAreaWidget editor = new TextAreaWidget("value", stringModel); String[] lines = StringUtils.splitByWholeSeparator(asString, "\n"); int rowCount = lines.length; editor.setCols(String.valueOf(columnCount + 1)); editor.setRows(String.valueOf(rowCount + 1)); item.add(editor); TextAreaWidget editor = new TextAreaWidget("value", stringModel); editor.setCols(String.valueOf(textAreaMaxColumns)); editor.setRows(String.valueOf((asString.length() / 80))); item.add(editor); TextAreaWidget editor = new TextAreaWidget("value", stringModel); editor.setCols(String.valueOf(textAreaMaxColumns)); editor.setRows("1"); item.add(editor);
add(new TextAreaWidget("hint-editor", hintModel)); } else { add(new Label("caption-editor", captionModel));
TextAreaWidget editor = new TextAreaWidget("value", stringModel); String[] lines = StringUtils.splitByWholeSeparator(asString, "\n"); int rowCount = lines.length; editor.setRows(String.valueOf(rowCount + 1)); return editor; TextAreaWidget editor = new TextAreaWidget("value", stringModel); editor.setRows(String.valueOf((asString.length() / 80))); return editor; TextAreaWidget editor = new TextAreaWidget("value", stringModel); editor.setRows("1"); return editor;
public DescriptionPanel(String id, IModel model) { super(id, model); TextAreaWidget descWidget = new TextAreaWidget("description", new PropertyModel<>(model, "description")); descWidget.setRenderBodyOnly(true); add(descWidget); }
public TextTemplatePlugin(IPluginContext context, IPluginConfig config) { super(context, config); final IModel<String> valueModel = getModel(); final IEditor.Mode mode = IEditor.Mode.fromString(config.getString("mode"), IEditor.Mode.VIEW); switch (mode) { case EDIT: TextAreaWidget widget = new TextAreaWidget("value", valueModel); if (config.getString("rows") != null) { widget.setRows(config.getString("rows")); } add(widget); break; case COMPARE: final IModel<String> baseModel = context.getService(config.getString("model.compareTo"), IModelReference.class).getModel(); IModel<String> compareModel = new HtmlDiffModel(new NewLinesToBrModel(baseModel), new NewLinesToBrModel(valueModel), getDiffService(context)); add(new Label("value", compareModel).setEscapeModelStrings(false)); break; default: add(new Label("value", new NewLinesToBrModel(valueModel)).setEscapeModelStrings(false)); } }