Example usage for org.apache.wicket.markup.html.link AbstractLink getId

List of usage examples for org.apache.wicket.markup.html.link AbstractLink getId

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.link AbstractLink getId.

Prototype

@Override
public String getId() 

Source Link

Document

Gets the id of this component.

Usage

From source file:de.alpharogroup.wicket.components.menu.suckerfish.MenuItem.java

License:Apache License

/**
 * Instantiates a new {@link MenuItem}./*  w  w  w . j  a v a 2s .  c  om*/
 *
 * @param link
 *            the link
 * @param labelModel
 *            the model of the label text.
 */
public MenuItem(final AbstractLink link, final IModel<String> labelModel) {
    if ((link != null) && !link.getId().equals(MenuPanel.LINK_ID)) {
        throw new IllegalArgumentException("The id have to be SuckerfishMenuPanel.LINK_ID");
    }
    this.link = link;
    this.link.add(this.label = newLabel(MenuPanel.LINK_TEXT_ID, labelModel));
}

From source file:org.cdlflex.ui.markup.html.button.ButtonList.java

License:Apache License

@Override
protected void populateItem(ListItem<AbstractLink> item) {
    final AbstractLink link = item.getModelObject();

    Args.isTrue(getButtonMarkupId().equals(link.getId()),
            "component id is invalid, please use ButtonList.getButtonMarkupId()");

    item.add(link);//from ww  w. ja  v a 2  s .c om
}

From source file:org.cdlflex.ui.markup.html.dialog.Dialog.java

License:Apache License

/**
 * Adds the given link to the footer panel. The component is required to use the {@link #BUTTON_MARKUP_ID} constant
 * as component id./*from  ww w  .ja  v a2  s  .  c o  m*/
 * 
 * @param button the link to add
 * @return this for chaining
 * @throws java.lang.IllegalArgumentException if the component does not use the correct component id
 */
public Dialog<T> addButton(AbstractLink button) throws IllegalArgumentException {
    if (!BUTTON_MARKUP_ID.equals(button.getId())) {
        throw new IllegalArgumentException(String.format("Invalid button component id. Must be '%s', was '%s'.",
                BUTTON_MARKUP_ID, button.getId()));
    }

    buttons.add(button);
    return this;
}

From source file:org.cdlflex.ui.markup.html.dialog.Dialog.java

License:Apache License

/**
 * Adds the given link to the footer panel to the given position. The component is required to use the
 * {@link #BUTTON_MARKUP_ID} constant as component id.
 *
 * @param button the link to add/*from   w  w  w .  j  av a  2  s. c  o m*/
 * @param position index at which the specified element is to be inserted
 * @return this for chaining
 * @throws java.lang.IllegalArgumentException if the component does not use the correct component id
 */
public Dialog<T> addButton(int position, AbstractLink button) throws IllegalArgumentException {
    if (!BUTTON_MARKUP_ID.equals(button.getId())) {
        throw new IllegalArgumentException(String.format("Invalid button component id. Must be '%s', was '%s'.",
                BUTTON_MARKUP_ID, button.getId()));
    }

    buttons.add(position, button);
    return this;
}

From source file:org.devgateway.eudevfin.ui.common.components.RepairedNavbarDropDownButton.java

License:Open Source License

private ButtonList repairedButtonList(final String markupId) {
    final ButtonList buttonList = new ButtonList(markupId, newSubMenuButtons(ButtonList.getButtonMarkupId())) {

        @Override//from w w w. ja va2 s  . com
        protected void populateItem(ListItem<AbstractLink> item) {
            final AbstractLink link = item.getModelObject();

            Args.isTrue(getButtonMarkupId().equals(link.getId()),
                    "component id is invalid, please use ButtonList.getButtonMarkupId()");
            if (link instanceof DropDownSubMenu) {
                item.setRenderBodyOnly(true);
            }
            item.add(link);
        }

    };
    buttonList.setRenderBodyOnly(true);

    return buttonList;
}

From source file:ro.nextreports.server.web.common.menu.MenuItem.java

License:Apache License

public MenuItem(AbstractLink link, String label, String image) {
    if ((link != null) && !link.getId().equals(MenuPanel.LINK_ID)) {
        throw new IllegalArgumentException("The id must be MenuPanel.LINK_ID");
    }//from   ww  w  .  java  2  s. c om

    this.link = link;
    this.label = label;
    this.image = image;
}