Package org.apache.wicket.markup.html.basic

Examples of org.apache.wicket.markup.html.basic.MultiLineLabel


    {
      public void populateItem(final ListItem listItem)
      {
        final Comment comment = (Comment)listItem.getModelObject();
        listItem.add(new Label("date", new Model(comment.getDate())));
        listItem.add(new MultiLineLabel("text", comment.getText()));
      }
    });
   
    // we need to cancel the standard submit of the form in the onsubmit handler,
    // otherwise we'll get double submits. To do so, we return false after the
View Full Code Here


  /**
   * @see org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel#newLabel(org.apache.wicket.MarkupContainer, java.lang.String, org.apache.wicket.model.IModel)
   */
  protected Component newLabel(MarkupContainer parent, String componentId, IModel model)
  {
    MultiLineLabel label = new MultiLineLabel(componentId, model)
    {
      private static final long serialVersionUID = 1L;

      protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
      {
        if (getModelObject() == null)
        {
          replaceComponentTagBody(markupStream, openTag, defaultNullLabel());
        }
        else
        {
          super.onComponentTagBody(markupStream, openTag);
        }
      }
    };
    label.setOutputMarkupId(true);
    label.add(new LabelAjaxBehavior("onclick"));
    return label;
  }
View Full Code Here

   * @see org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel#newLabel(org.apache.wicket.MarkupContainer,
   *      java.lang.String, org.apache.wicket.model.IModel)
   */
  protected Component newLabel(MarkupContainer parent, String componentId, IModel model)
  {
    MultiLineLabel label = new MultiLineLabel(componentId, model);
    label.setOutputMarkupId(true);
    label.add(new LabelAjaxBehavior("onclick"));
    return label;
  }
View Full Code Here

    add(new PropertyListView("comments", commentList)
    {
      public void populateItem(final ListItem listItem)
      {
        listItem.add(new Label("date"));
        listItem.add(new MultiLineLabel("text"));
      }
    }).setVersioned(false);
  }
View Full Code Here

       
        add(new Label(CKEY_SUPPLY_PRICE, new StringResourceModel(MKEY_MONEY_VALUE, null,
                resourceInformant.getValue(resource),
                moneyManager.getDefaultCurrency())).setVisible(!(resource instanceof MoneyResource)));

        MultiLineLabel descriptionLabel = new MultiLineLabel(CKEY_RESOURCE_DESCRIPTION, new Model<String>() {

            @Override
            public String getObject() {
                Resource resource = resourceReader.getResource(getResourceModel().getObject().getId());
                return resource .getDescription();
View Full Code Here

            private static final long serialVersionUID = 1L;

            @Override
            protected void populateItem(Item<Skill> item) {
                Skill skill = item.getModelObject();
                item.add(new MultiLineLabel(CKEY_USER_SKILL_TITLE, skill.getTitle()));
                item.add(new MultiLineLabel(CKEY_USER_SKILL_DESCRIPTIION, skill.getDescription()));
            }
           
        });
       
    }
View Full Code Here

    private IModel<BrixNode> targetNode = new BrixNodeModel();

    public RestoreItemsPanel(String id, String prototypeWorkspaceId, final String targetWorkspaceId) {
        super(id, prototypeWorkspaceId);

        final Component message = new MultiLineLabel("message", new Model<String>(
                ""));
        message.setOutputMarkupId(true);
        add(message);


        add(new SiteNodePickerPanel("picker", targetNode, targetWorkspaceId, true, null));

        add(new AjaxLink<Void>("restore") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                List<JcrNode> nodes = getSelectedNodes();
                if (!nodes.isEmpty()) {
                    Brix brix = ((BrixNode) nodes.iterator().next()).getBrix();
                    JcrWorkspace targetWorkspace = brix.getCurrentSession(targetWorkspaceId).getWorkspace();
                    Map<JcrNode, List<JcrNode>> dependencies = JcrUtil.getUnsatisfiedDependencies(
                            nodes, targetWorkspace);
                    ;
                    if (!dependencies.isEmpty()) {
                        message.setDefaultModelObject(getDependenciesMessage(dependencies));
                    } else {
                        JcrNode rootNode = targetNode.getObject();
                        if (rootNode == null) {
                            rootNode = targetWorkspace.getSession().getRootNode();
                        }
                        PrototypePlugin.get().restoreNodes(nodes, rootNode);
                        findParent(ModalWindow.class).close(target);
                    }
                } else {
                    message.setDefaultModelObject("You have to select at least one node.");
                }
                target.addComponent(message);
            }
        });
    }
View Full Code Here

public class CreatePrototypePanel extends SelectItemsPanel<Void> {
    public CreatePrototypePanel(String id, String workspaceId, final String targetPrototypeName) {
        super(id, workspaceId);

        final Component message = new MultiLineLabel("message", new Model<String>(
                ""));
        message.setOutputMarkupId(true);
        add(message);

        add(new AjaxLink<Void>("create") {
            @Override
            public void onClick(AjaxRequestTarget target) {
                List<JcrNode> nodes = getSelectedNodes();
                if (!nodes.isEmpty()) {
                    Map<JcrNode, List<JcrNode>> dependencies = JcrUtil.getUnsatisfiedDependencies(
                            nodes, null);
                    if (!dependencies.isEmpty()) {
                        message.setDefaultModelObject(getDependenciesMessage(dependencies));
                    } else {
                        PrototypePlugin.get().createPrototype(nodes, targetPrototypeName);
                        findParent(ModalWindow.class).close(target);
                    }
                } else {
                    message.setDefaultModelObject(getString("youHaveToSelectAtLeastOneNode"));
                }
                target.addComponent(message);
            }
        });
    }
View Full Code Here

    public static class WKTPanel extends Panel {

        public WKTPanel(String id, CoordinateReferenceSystem crs) {
            super(id);
           
            MultiLineLabel wktLabel = new MultiLineLabel("wkt");
           
            add( wktLabel );
           
            if ( crs != null ) {
                wktLabel.setDefaultModel( new Model( crs.toString() ) );
            }
        }
View Full Code Here

    class WKTPanel extends Panel {

        public WKTPanel(String id) {
            super(id);

            MultiLineLabel wktLabel = new MultiLineLabel("wkt");

            add(wktLabel);

            MathTransform mt = getTransform();
            if (mt != null) {
                wktLabel.setDefaultModel(new Model<String>(mt.toString()));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.basic.MultiLineLabel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.