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) 

Source Link

Document

Constructor.

Usage

From source file:abid.password.wicket.pages.BasePage.java

License:Apache License

public BasePage() {
    ErrorInfoFeedbackPanel feedbackPanel = new ErrorInfoFeedbackPanel("feedbackPanel");
    add(feedbackPanel);//from www  .  j av  a2  s. c  o m

    Link<String> usersLink = new BookmarkablePageLink<String>("usersLink", UsersPage.class);
    usersLink.setVisible(MutablePasswordSession.get().isSignedIn());
    add(usersLink);

    Link<String> createUserLink = new BookmarkablePageLink<String>("createUserLink", CreateUserPage.class);
    createUserLink.setVisible(MutablePasswordSession.get().isSignedIn());
    add(createUserLink);

    Link<String> logoutLink = new BookmarkablePageLink<String>("logoutLink", LogoutPage.class);
    logoutLink.setVisible(MutablePasswordSession.get().isSignedIn());
    add(logoutLink);
}

From source file:almira.sample.web.AbstractBasePage.java

License:Apache License

/**
 * Constructor.//from   www. j  a  v  a  2 s  .c  om
 */
AbstractBasePage() {
    super();

    // http://apache-wicket.1842946.n4.nabble.com/wicket-message-in-the-title-td1843627.html
    add(new Label("pageTitle", new ResourceModel("catapult.title")));
    add(new BookmarkablePageLink<Void>("homeLink", IndexPage.class));
    add(new BookmarkablePageLink<Void>("adminLink", AdminPage.class));

    add(new LocaleDropDownPanel("localeSelectPanel", Arrays.asList(new Locale("es"), new Locale("de"),
            new Locale("en"), new Locale("fr"), new Locale("it"))));

    add(new Label("version", ((MainApplication) getApplication()).getVersion()));

    add(new Label("session", new PropertyModel<String>(this, "session.id")));
    add(new SearchPanel("searchPanel"));
    add(new Label("footertext", footerTextService.getText()));

    // Page 87, Wicket in Action
    add(new Label("clock", new Model<String>() {
        @Override
        public String getObject() {
            final SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy | HH:mm:ss.mmm",
                    getSession().getLocale());

            return dateFormat.format(new Date());
        }
    }));
}

From source file:br.eti.ranieri.opcoesweb.page.PaginaBase.java

License:Apache License

public PaginaBase() {
    add(new BookmarkablePageLink("configurar", ConfigurarOnlinePage.class));
    add(new BookmarkablePageLink("exibirOnline", ExibirOnlinePage.class));
    add(new BookmarkablePageLink("importadorSerieHistorica", ImportarSerieHistoricaPage.class));
    add(new BookmarkablePageLink("exibirOffline", ExibirOfflinePage.class));
    add(new BookmarkablePageLink("calcularBlackScholesAdhoc", CalcularBlackScholesAdhocPage.class));
    add(new BookmarkablePageLink("wizardSimulacao", Wizard1SimulacaoPage.class));
    add(new ExternalLink("logoutLink", "/j_spring_security_logout").setContextRelative(true));
}

From source file:ca.travelagency.HeaderPanel.java

License:Apache License

public HeaderPanel(String id, SystemUser systemUser, boolean isSignedIn) {
    super(id);/*from   www .ja v  a2 s. c o m*/

    BookmarkablePageLink<String> homePage = new BookmarkablePageLink<String>(HOME_PAGE,
            getApplication().getHomePage());
    add(homePage);

    homePage.add(new LogoImage(LOGO_IMAGE));

    StringResourceModel model = new StringResourceModel(WELCOME_GREETINGS, this, Model.of(systemUser));
    add(new Label(SIGN_IN_NAME, model).setVisible(isSignedIn));

    add(new BookmarkablePageLink<String>(SIGN_OUT, SignOutPage.class).setVisible(isSignedIn));
}

From source file:ca.travelagency.navigation.BaseNavigationMenu.java

License:Apache License

protected Component bookmarkablePageLink(String id, Class<? extends Page> page,
        Class<? extends Page> currentPage) {
    Component component = new BookmarkablePageLink<String>(id, page);
    if (page.getSimpleName().equals(currentPage.getSimpleName())) {
        component.add(new AttributeAppender("class", "selected"));
    }/*from  ww  w  .  j a v  a 2s.  c  o  m*/
    return component;
}

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

License:Open Source License

public MenuBar(String id) {
    super(id);//from www  . j  a  v  a 2s.com

    BookmarkablePageLink<WebPage> link = new BookmarkablePageLink<WebPage>("publish", PublishPage.class);
    add(link);

    PageParameters params = new PageParameters();
    params.add("uri", NanobrowserSession.get().getUser().getURI());
    BookmarkablePageLink<WebPage> userLink = new BookmarkablePageLink<WebPage>("userlink", AgentPage.class,
            params);
    add(userLink);

    userLink.add(new Label("user", NanobrowserSession.get().getUser().getName()));

    searchTextField = new TextField<String>("searchtextfield", Model.of(""));

    Form<?> searchForm = new Form<Void>("searchform") {

        private static final long serialVersionUID = 4204397843169014882L;

        protected void onSubmit() {
            String s = searchTextField.getModelObject();
            if (s == null)
                s = "";
            PageParameters params = new PageParameters();
            params.add("q", s);
            setResponsePage(SearchPage.class, params);
        }

    };

    add(searchForm);
    searchForm.add(searchTextField);
}

From source file:com.apachecon.memories.Index.java

License:Apache License

public Index() {
    add(new Thumbs("thumbs", 6, 3, new ApprovedModel()));
    add(new BookmarkablePageLink<Browse>("browse", Browse.class));
}

From source file:com.apachecon.memories.ScrapbookPage.java

License:Apache License

@SuppressWarnings({ "rawtypes", "unchecked" })
public ScrapbookPage() {
    add(new ExternalLink("apacheCon", "http://na11.apachecon.com/"));

    add(new BookmarkablePageLink("logo", Index.class));

    List<Class<? extends Page>> links = new ArrayList<Class<? extends Page>>();
    links.add(Index.class);
    links.add(Upload.class);
    Roles roles = AuthenticatedWebSession.get().getRoles();
    if (roles != null && roles.hasRole("admin")) {
        links.add(Browse.class);
        links.add(Approve.class);
        links.add(Logout.class);
    } else {/*from www.j av a2s  .co  m*/
        links.add(Browse.class);
        links.add(SignIn.class);
    }

    add(new ListView<Class>("menu", links) {
        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<Class> item) {
            BookmarkablePageLink link = new BookmarkablePageLink("link", item.getModelObject());

            String simpleName = item.getModelObject().getSimpleName();

            if (getPage().getClass().equals(item.getModelObject())) {
                item.add(AttributeModifier.append("class", "active"));
            }

            link.add(new Label("label", simpleName));
            item.add(link);
        }
    });
}

From source file:com.apachecon.memories.Thumbs.java

License:Apache License

public Thumbs(String id, int maxElems, int rowElements, IModel<List<UserFile>> model) {
    super(id, model);

    RepeatingView repeater = new RepeatingView("items");
    int itemCount = 0;
    for (UserFile file : model.getObject()) {
        MarkupContainer container = new WebMarkupContainer(repeater.newChildId());
        Link link = new BookmarkablePageLink("link", Upload.class);
        link.add(file.createSmallThumb("thumb"));
        container.add(link);// w w w .  j a v a2s. c  o  m

        repeater.add(container);

        if (++itemCount % rowElements == 0) {
            container.add(AttributeModifier.append("class", "last"));
        }

        if (itemCount == maxElems) {
            break;
        }
    }

    add(repeater);
}

From source file:com.apachecon.memories.Upload.java

License:Apache License

public Upload() {
    add(new FeedbackPanel("feedback"));

    ApprovedModel model = new ApprovedModel();
    add(new Thumbs("thumbs", 12, 4, model));
    add(new BookmarkablePageLink<Browse>("browse", Browse.class));

    add(new UploadForm("uploadForm", contentTypes));
}