Example usage for org.apache.wicket.markup.html.link BookmarkablePageLink BookmarkablePageLink

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

Introduction

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

Prototype

public <C extends Page> BookmarkablePageLink(final String id, final Class<C> pageClass,
        final PageParameters parameters) 

Source Link

Document

Constructor.

Usage

From source file:ch.tkuhn.nanobrowser.AgentItem.java

License:Open Source License

public AgentItem(String id, AgentElement a, int guiItemStyle) {
    super(id);//  ww w. jav a 2  s.c  o m

    PageParameters params = new PageParameters();
    params.add("uri", a.getURI());
    BookmarkablePageLink<WebPage> link = new BookmarkablePageLink<WebPage>("agentlink", AgentPage.class,
            params);
    add(link);

    WebMarkupContainer icon = new WebMarkupContainer("icon");
    if (a.isBot()) {
        icon.add(new AttributeModifier("src", new Model<String>("icons/bot.svg")));
    }
    link.add(icon);

    Label nameLabel = new Label("agent", a.getName());
    nameLabel.setVisible(guiItemStyle != ThingElement.TINY_GUI_ITEM);
    link.add(nameLabel);
}

From source file:ch.tkuhn.nanobrowser.NanopubItem.java

License:Open Source License

public NanopubItem(String id, NanopubElement n, int guiItemStyle) {
    super(id);//from w ww.ja v a2  s .com

    PageParameters params = new PageParameters();
    params.add("uri", n.getURI());
    BookmarkablePageLink<WebPage> link = new BookmarkablePageLink<WebPage>("nanopublink", NanopubPage.class,
            params);
    add(link);
    WebMarkupContainer icon = new WebMarkupContainer("icon");
    if (n.isValid()) {
        icon.add(new AttributeModifier("src", new Model<String>("icons/nanopubv.svg")));
    }
    link.add(icon);

    String date = n.getCreateDateString();
    Label dateLabel;
    if (date == null) {
        dateLabel = new Label("nanopubdate", "");
    } else {
        dateLabel = new Label("nanopubdate", n.getCreateDateString());
    }
    dateLabel.setVisible(guiItemStyle == ThingElement.LONG_GUI_ITEM);
    add(dateLabel);
    Label nameLabel = new Label("nanopubname", " " + n.getShortName() + " ");
    nameLabel.setVisible(guiItemStyle != ThingElement.TINY_GUI_ITEM);
    link.add(nameLabel);
}

From source file:ch.tkuhn.nanobrowser.PaperItem.java

License:Open Source License

public PaperItem(String id, PaperElement p, int guiItemStyle) {
    super(id);/* ww w.  j a va2  s .c o  m*/

    PageParameters params = new PageParameters();
    params.add("uri", p.getURI());
    BookmarkablePageLink<WebPage> link = new BookmarkablePageLink<WebPage>("doilink", PaperPage.class, params);
    add(link);

    Label nameLabel = new Label("doi", p.getDoiString());
    nameLabel.setVisible(guiItemStyle != ThingElement.TINY_GUI_ITEM);
    link.add(nameLabel);
}

From source file:ch.tkuhn.nanobrowser.SentenceItem.java

License:Open Source License

public SentenceItem(String id, SentenceElement s, int guiItemStyle) {
    super(id);/*w  ww.j a  v  a2s.c  om*/

    PageParameters params = new PageParameters();
    params.add("uri", s.getURI());
    BookmarkablePageLink<WebPage> link = new BookmarkablePageLink<WebPage>("sentencelink", SentencePage.class,
            params);
    add(link);

    Label nameLabel = new Label("sentence", s.getSentenceText());
    nameLabel.setVisible(guiItemStyle != ThingElement.TINY_GUI_ITEM);
    link.add(nameLabel);
}

From source file:ch.tkuhn.nanobrowser.ThingItem.java

License:Open Source License

public ThingItem(String id, ThingElement th, int guiItemStyle) {
    super(id);/*from w  w  w . ja  v  a2  s  . c  om*/

    PageParameters params = new PageParameters();
    String uri = th.getURI();
    params.add("uri", uri);
    BookmarkablePageLink<WebPage> link = new BookmarkablePageLink<WebPage>("thinglink", ThingPage.class,
            params);
    add(link);
    String n = th.getShortName();
    if (guiItemStyle == ThingElement.PREDICATEFIRST_ITEM) {
        if (SentenceRelation.get(uri) != null) {
            n = SentenceRelation.get(uri).getText();
        }
        n += ":";
    }
    link.add(new Label("thing", n));
}

From source file:com.axway.ats.testexplorer.pages.model.BookmarkableTabbedPanel.java

License:Apache License

@Override
protected WebMarkupContainer newLink(String linkId, int index) {

    PageParameters newPageParameters = new PageParameters(pageParameters);
    if (index == defaultTabIndex) {
        newPageParameters.remove(tabParameterName);
    } else {/*from  w w  w  . ja  v a2  s. co m*/
        newPageParameters.set(tabParameterName, index);
    }

    WebMarkupContainer link = new BookmarkablePageLink<Object>(linkId, getPage().getClass(), newPageParameters);
    return link;
}

From source file:com.chbase.applications.weight.IntroPage.java

License:Apache License

public IntroPage(final PageParameters parameters) {
    PageParameters pp = new PageParameters();
    pp.add("login", "true");
    add(new BookmarkablePageLink("login", AuthenticationPage.class, pp));
}

From source file:com.cubeia.backoffice.web.operator.OperatorList.java

License:Open Source License

public OperatorList() {
    final List<OperatorDTO> operators = operatorServiceClient.getOperators();
    final DataView<OperatorDTO> operatorList = new DataView<OperatorDTO>("operatorList",
            new ListDataProvider<OperatorDTO>(operators)) {

        private static final long serialVersionUID = 1L;

        @Override//from   w  w w . ja  va  2  s .  co  m
        protected void populateItem(Item<OperatorDTO> item) {
            OperatorDTO operator = item.getModelObject();
            item.add(new Label("id", "" + operator.getId()));
            item.add(new Label("name", operator.getName()));
            item.add(new Label("enabled", operator.isEnabled() ? "Enabled" : "Disabled"));
            String status = operator.getAccountStatus() == null ? "" : operator.getAccountStatus().toString();
            item.add(new Label("accountStatus", status));
            PageParameters parameters = new PageParameters();
            parameters.add("id", operator.getId());
            item.add(new BookmarkablePageLink<Void>("editLink", EditOperator.class, parameters));
        }
    };
    add(operatorList);
}

From source file:com.cubeia.backoffice.web.user.UserSummary.java

License:Open Source License

/**
* Constructor that is invoked when page is invoked without a session.
* 
* @param params//from  w w  w.  j  a v a  2s  .co  m
*            Page parameters
*/
public UserSummary(PageParameters params) {
    if (!assertValidUserid(params)) {
        return;
    }

    final Long userId = params.get(PARAM_USER_ID).toLongObject();
    loadFormData(userId);

    if (getUser() == null || getUser().getStatus() == UserStatus.REMOVED) {
        log.debug("user is removed, id = " + userId);
        setInvalidUserResponsePage(userId);
        return;
    }

    CompoundPropertyModel<UserSummary> cpm = new CompoundPropertyModel<UserSummary>(this);

    add(new Label("userId", cpm.<Long>bind("user.userId")));
    add(new Label("status", cpm.<UserStatus>bind("user.status")));
    add(new Label("operatorId", cpm.<Long>bind("user.operatorId")));
    add(new Label("externalUserId", cpm.<String>bind("user.externalUserId")));
    add(new Label("userName", cpm.<String>bind("user.userName")));
    add(new Label("firstName", cpm.<String>bind("user.userInformation.firstName")));
    add(new Label("lastName", cpm.<String>bind("user.userInformation.lastName")));
    add(new Label("email", cpm.<String>bind("user.userInformation.email")));
    add(new Label("userTitle", cpm.<String>bind("user.userInformation.title")));
    add(new Label("city", cpm.<String>bind("user.userInformation.city")));
    add(new Label("billingAddress", cpm.<String>bind("user.userInformation.billingAddress")));
    add(new Label("fax", cpm.<String>bind("user.userInformation.fax")));
    add(new Label("cellphone", cpm.<String>bind("user.userInformation.cellphone")));
    add(new Label("country", cpm.<String>bind("user.userInformation.country")));
    add(new Label("zipcode", cpm.<String>bind("user.userInformation.zipcode")));
    add(new Label("state", cpm.<String>bind("user.userInformation.state")));
    add(new Label("phone", cpm.<String>bind("user.userInformation.phone")));
    add(new Label("workphone", cpm.<String>bind("user.userInformation.workphone")));
    add(new Label("gender", cpm.<Gender>bind("user.userInformation.gender")));
    add(new FeedbackPanel("feedback"));
    add(createAttributesListView());

    ListAccountsRequest request = new ListAccountsRequest();
    request.setUserId(userId);
    request.setStatus(AccountStatus.OPEN);
    request.setLimit(100);
    log.debug("sending accounts request: {}", request);
    AccountQueryResult listAccounts = walletService.listAccounts(request);
    add(createAccountListView(listAccounts));

    add(new BookmarkablePageLink<Void>("editLink", EditUser.class, params)
            .add(new Label("editLabel", "Edit user")));
}

From source file:com.cubeia.backoffice.web.util.LabelLinkPanel.java

License:Open Source License

public LabelLinkPanel(String id, String text, String toolTip, Class<? extends Page> page,
        PageParameters params) {/*w  w w  . j av  a2s  . c o  m*/
    super(id);
    BookmarkablePageLink<?> link = new BookmarkablePageLink<Void>("link", page, params);
    link.add(new Label("label", text));

    if (toolTip != null) {
        link.add(new AttributeModifier("title", Model.of(toolTip)));
    }

    add(link);
}