@Override protected Component getValueComponent(String id, IModel<String> rowModel) { return new MultiLineLabel(id, monitoringParams.get(rowModel.getObject())); }
/** * Overridden in derived classes to add the form components. Calll form.add to add components, * not just add. */ @Override public void addFormComponents() { MultiLineLabel body = new MultiLineLabel("message", message); body.setEscapeModelStrings(false); form.add(body); }
public StackTracePanel(String id, String stackTrace) { super(id); MultiLineLabel stackTraceLabel = new MultiLineLabel("trace"); add(stackTraceLabel); if (stackTrace != null) { stackTraceLabel.setDefaultModel(new Model<>(stackTrace)); } } }
@Override public Component render(String id, IModel<?> data) { return new MultiLineLabel(id, data) .add(HideIfObjectIsEmptyBehavior.INSTANCE); }
/** * Factory method for create a new {@link MultiLineLabel}. * * @param <T> * the generic type of the model * @param id * the id * @param model * the {@link IModel} of the {@link MultiLineLabel}. * @return the new {@link MultiLineLabel}. */ public static <T> MultiLineLabel newMultiLineLabel(final String id, final IModel<T> model) { final MultiLineLabel multiLineLabel = new MultiLineLabel(id, model); multiLineLabel.setOutputMarkupId(true); return multiLineLabel; }
public WorkflowDialog(WorkflowPlugin plugin) { this.plugin = plugin; final IModel<Node> nodeModel = (IModel<Node>)plugin.getDefaultModel(); final MultiLineLabel dump = new MultiLineLabel("dump", ""); dump.setOutputMarkupId(true); add(dump); try { Node subject = nodeModel.getObject(); ByteArrayOutputStream ostream = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(ostream); Session session = subject.getSession(); WorkflowManager workflowManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager(); Node categories = session.getRootNode().getNode("hippo:configuration/hippo:workflows"); for (NodeIterator iter = categories.getNodes(); iter.hasNext();) { Node category = iter.nextNode(); WorkflowDescriptor descriptor = workflowManager.getWorkflowDescriptor(category.getName(), subject); out.println("Category " + category.getName() + ": " + (descriptor != null ? descriptor.getDisplayName() : "none")); } out.flush(); dump.setDefaultModel(new Model<String>(new String(ostream.toByteArray()))); } catch(RepositoryException ex) { dump.setDefaultModel(new Model<String>(ex.getClass().getName()+": "+ex.getMessage())); } setOkVisible(false); setFocusOnOk(); }
Font robotoFont = null; try { robotoFont = Font.createFont(Font.TRUETYPE_FONT, new File("/usr/share/fonts/roboto/Roboto-Black.ttf")); robotoFont = robotoFont.deriveFont(14f); } catch (Exception e) { e.printStackTrace(); } // Using the MultiLineLabel class. final MultiLineLabel mLabel = new MultiLineLabel( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + "Phasellus non sapien quam. Fusce posuere, nisl " + "vitae tristique volutpat, augue erat faucibus nisl, " + "nec venenatis metus sem vel enim. Cras in libero " + "sapien, vitae euismod neque. Proin hendrerit, odio " + "et faucibus suscipit, eros tellus blandit justo, " + "ac cursus risus elit ut risus."); mLabel.setForeground(Color.WHITE); mLabel.setFont(robotoFont);
public ViewUMLDialogPanel(String id, final IModel<String> model) { super(id, model); add(new WebMarkupContainer("umlImg") { @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("src", umlService.asImage(model.getObject())); } }); add(new MultiLineLabel("uml", model).setVisible(umlService.isUmlDebugEnabled())); }
label.setOutputMarkupId(true); label.add(new LabelAjaxBehavior(getLabelAjaxEvent())); return label;
/** * Factory method for creating the MultiLineLabel. This method is invoked in the constructor * from the derived classes and can be overridden so users can provide their own version of a * MultiLineLabel. * * @param id * the id * @param model * the model * @return the MultiLineLabel */ protected MultiLineLabel newMultiLineLabel(final String id, final IModel<String> model) { final MultiLineLabel multiLineLabel = new MultiLineLabel(id, model) { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @Override protected void onConfigure() { setVisibilityAllowed(!isEditable()); } }; multiLineLabel.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true); return multiLineLabel; }
/** * Callback method for layout this component and the child components of it. */ protected void onLayout() { getLabel().add(new AttributeAppender("class", "col-lg-5 col-md-5 col-sm-5 ")); getViewableLabel().add(new AttributeAppender("class", "col-lg-5 col-md-5 col-sm-5 ")); } }
public WorkflowDialog(WorkflowPlugin plugin) { this.plugin = plugin; final JcrNodeModel nodeModel = (JcrNodeModel) plugin.getDefaultModel(); final MultiLineLabel dump = new MultiLineLabel("dump", ""); dump.setOutputMarkupId(true); add(dump); try { Node subject = nodeModel.getNode(); ByteArrayOutputStream ostream = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(ostream); Session session = subject.getSession(); WorkflowManager workflowManager = ((HippoWorkspace) session.getWorkspace()).getWorkflowManager(); Node categories = session.getRootNode().getNode("hippo:configuration/hippo:workflows"); for (NodeIterator iter = categories.getNodes(); iter.hasNext();) { Node category = iter.nextNode(); WorkflowDescriptor descriptor = workflowManager.getWorkflowDescriptor(category.getName(), subject); out.println("Category " + category.getName() + ": " + (descriptor != null ? descriptor.getDisplayName() : "none")); } out.flush(); dump.setDefaultModel(new Model<String>(new String(ostream.toByteArray()))); } catch(RepositoryException ex) { dump.setDefaultModel(new Model<String>(ex.getClass().getName()+": "+ex.getMessage())); } setOkVisible(false); setFocusOnOk(); }
public HistoryItemPanel(String id, IModel<ScriptResult> model,final Component inpitField,final Component engineSelect) { super(id, model instanceof CompoundPropertyModel?model:new CompoundPropertyModel<ScriptResult>(model)); add(engine = new MultiLineLabel("engine").add(HideIfObjectIsEmptyBehavior.INSTANCE)); add(script = new MultiLineLabel("script").add(HideIfObjectIsEmptyBehavior.INSTANCE)); add(new AjaxLink("reuse"){ @Override public void onClick(AjaxRequestTarget target) { inpitField.setDefaultModelObject(script.getDefaultModelObject()); engineSelect.setDefaultModelObject(engine.getDefaultModelObject()); target.add(engineSelect); target.add(inpitField); } }); }
/** * Factory method for create a new {@link MultiLineLabel}. * * @param <T> * the generic type of the model * @param id * the id * @param model * the {@link IModel} of the {@link MultiLineLabel}. * @return the new {@link MultiLineLabel}. */ public static <T> MultiLineLabel newMultiLineLabel(final String id, final IModel<T> model) { final MultiLineLabel multiLineLabel = new MultiLineLabel(id, model); multiLineLabel.setOutputMarkupId(true); return multiLineLabel; }
/** * @see org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel#newLabel(org.apache.wicket.MarkupContainer, * java.lang.String, org.apache.wicket.model.IModel) */ @Override protected MultiLineLabel newLabel(MarkupContainer parent, String componentId, IModel<T> model) { MultiLineLabel label = new MultiLineLabel(componentId, model) { private static final long serialVersionUID = 1L; @Override protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { Object modelObject = getDefaultModelObject(); if (modelObject == null || "".equals(modelObject)) { replaceComponentTagBody(markupStream, openTag, defaultNullLabel()); } else { super.onComponentTagBody(markupStream, openTag); } } }; label.setOutputMarkupId(true); label.add(new LabelAjaxBehavior(getLabelAjaxEvent())); return label; }
public class PojoPanel extends GenericPanel<Pojo> { private static final long serialVersionUID = 1L; public PojoPanel(String id) { super(id); add(new Label("property")); } protected void onInitialize() { super.onInitialize(); add(new MultiLineLabel("Xproperty", new PropertyModel(getDefaultModel(), "property"))); } }
/** * Generates a component that is used to display the message inside the * feedback panel. This component must handle being attached to * <code>span</code> tags. * * By default a {@link Label} is used. * * Note that the created component is expected to respect feedback panel's * {@link #getEscapeModelStrings()} value * * @param id * parent id * @param message * feedback message * @return component used to display the message */ protected Component newMessageDisplayComponent(String id, FeedbackMessage message) { Serializable serializable = message.getMessage(); MultiLineLabel label = new MultiLineLabel(id, (serializable == null) ? "" : serializable.toString()); label.setEscapeModelStrings(CustomFeedbackPanel.this.getEscapeModelStrings()); return label; } }
public WKTPanel(String id, CoordinateReferenceSystem crs) { super(id); MultiLineLabel wktLabel = new MultiLineLabel("wkt"); add(wktLabel); if (crs != null) { wktLabel.setDefaultModel(new Model<String>(crs.toString())); } } }
@Override protected void onInitialize() { super.onInitialize(); ScriptResult historyItem = getModelObject(); ScriptResultRendererManager renderer = ScriptResultRendererManager.INSTANCE; add(new MultiLineLabel("out").add(HideIfObjectIsEmptyBehavior.INSTANCE)); add(new MultiLineLabel("error").add(HideIfObjectIsEmptyBehavior.INSTANCE)); add(renderer.render("result",historyItem.getResultModel())); }
public WKTPanel(String id, IModel<String> wktDescriptionModel, IModel<String> wktModel) { super(id); Label wktDescription = new Label("wktDescription", wktDescriptionModel); add(wktDescription); MultiLineLabel wkt = new MultiLineLabel("wkt", wktModel); add(wkt); } }