Package com.gitblit.models.Menu

Examples of com.gitblit.models.Menu.PageLinkMenuItem


      @Override
      public void populateItem(final Item<MenuItem> item) {
        MenuItem entry = item.getModelObject();
        if (entry instanceof PageLinkMenuItem) {
          // link to another Wicket page
          PageLinkMenuItem pageLink = (PageLinkMenuItem) entry;
          item.add(new LinkPanel("menuItem", null, null, pageLink.toString(), pageLink.getPageClass(),
              pageLink.getPageParameters(), false).setRenderBodyOnly(true));
        } else if (entry instanceof ExternalLinkMenuItem) {
          // link to a specified href
          ExternalLinkMenuItem extLink = (ExternalLinkMenuItem) entry;
          item.add(new LinkPanel("menuItem", null, extLink.toString(), extLink.getHref(),
              extLink.openInNewWindow()).setRenderBodyOnly(true));
View Full Code Here


      @Override
      public void populateItem(final Item<MenuItem> item) {
        MenuItem entry = item.getModelObject();
        if (entry instanceof PageLinkMenuItem) {
          // link to another Wicket page
          PageLinkMenuItem pageLink = (PageLinkMenuItem) entry;
          item.add(new LinkPanel("menuItem", null, null, pageLink.toString(), pageLink.getPageClass(),
              pageLink.getPageParameters(), false).setRenderBodyOnly(true));
        } else if (entry instanceof ExternalLinkMenuItem) {
          // link to a specified href
          ExternalLinkMenuItem extLink = (ExternalLinkMenuItem) entry;
          item.add(new LinkPanel("menuItem", null, extLink.toString(), extLink.getHref(),
              extLink.openInNewWindow()).setRenderBodyOnly(true));
View Full Code Here

      }

      List<MenuItem> standardItems = new ArrayList<MenuItem>();
      standardItems.add(new MenuDivider());
      if (user.canAdmin() || user.canCreate()) {
        standardItems.add(new PageLinkMenuItem("gb.newRepository", app().getNewRepositoryPage()));
      }
      standardItems.add(new PageLinkMenuItem("gb.myProfile", UserPage.class,
          WicketUtils.newUsernameParameter(user.username)));
      if (editCredentials) {
        standardItems.add(new PageLinkMenuItem("gb.changePassword", ChangePasswordPage.class));
      }
      standardItems.add(new MenuDivider());
      add(newSubmenu("standardMenu", user.getDisplayName(), standardItems));

      if (showAdmin) {
        // admin menu
        List<MenuItem> adminItems = new ArrayList<MenuItem>();
        adminItems.add(new MenuDivider());
        adminItems.add(new PageLinkMenuItem("gb.users", UsersPage.class));
        adminItems.add(new PageLinkMenuItem("gb.teams", TeamsPage.class));

        boolean showRegistrations = app().federation().canFederate()
            && app().settings().getBoolean(Keys.web.showFederationRegistrations, false);
        if (showRegistrations) {
          adminItems.add(new PageLinkMenuItem("gb.federation", FederationPage.class));
        }
        adminItems.add(new MenuDivider());

        add(newSubmenu("adminMenu", getString("gb.administration"), adminItems));
      } else {
View Full Code Here

            name = getString(name);
          } catch (Exception e) {
          }
          if (item instanceof PageLinkMenuItem) {
            // link to another Wicket page
            PageLinkMenuItem pageLink = (PageLinkMenuItem) item;
            menuItem.add(new LinkPanel("submenuLink", null, null, name, pageLink.getPageClass(),
                pageLink.getPageParameters(), false).setRenderBodyOnly(true));
          } else if (item instanceof ExternalLinkMenuItem) {
            // link to a specified href
            ExternalLinkMenuItem extLink = (ExternalLinkMenuItem) item;
            menuItem.add(new LinkPanel("submenuLink", null, name, extLink.getHref(),
                extLink.openInNewWindow()).setRenderBodyOnly(true));
View Full Code Here

TOP

Related Classes of com.gitblit.models.Menu.PageLinkMenuItem

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.