Package wicket.markup.html.link

Examples of wicket.markup.html.link.PageLink


   * @param viewContext
   *            view context
   */
  public static PageLink link(final ModelContext modelContext,
      final ViewContext viewContext) {
    PageLink link = new PageLink(viewContext.getWicketId(),
        new IPageLink() {
          static final long serialVersionUID = 200701L;
          public Page getPage() {
            return new EntityEditFormPage(modelContext, viewContext);
          }
View Full Code Here


      ViewContext entityUpdateTablePageContext = new ViewContext(
          viewContext);
      WebPage entryConceptPage = app.getViewMeta().getPage(
          "EntityUpdateTablePage", entryContext,
          entityUpdateTablePageContext);
      Link entryConceptLink = new PageLink("entryUpdateTable",
          entryConceptPage);
      item.add(entryConceptLink);
      if (!app.isConceptDisplayAllowed(getAppSession(),
          entryConceptConfig)) {
        entryConceptLink.setVisible(false);
      } else if (!app.isConceptUpdateAllowed(getAppSession(),
          entryConceptConfig)) {
        entryConceptLink.setVisible(false);
      }
    } catch (Exception e) {
      log.error("Error in EntryUpdateTableListView: "
          + entry.getConceptConfig().getEntitiesCode() + " - "
          + e.getMessage());
View Full Code Here

   * @param viewContext
   *            view context
   */
  public static PageLink link(final ModelContext modelContext,
      final ViewContext viewContext) {
    PageLink link = new PageLink(viewContext.getWicketId(),
        new IPageLink() {
          static final long serialVersionUID = 200751L;
          public Page getPage() {
            return new EntityUpdateTablePage(modelContext,
                viewContext);
View Full Code Here

      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      App app = viewContext.getApp();

      Link homePageLink = new PageLink("home", app.getHomePage());
      homePageLink.setAutoEnable(true);
      add(homePageLink);

      Link contextLink;
      final Page contextPage = viewContext.getContextPage();
      if (contextPage == null) {
        contextLink = new PageLink("context", app.getHomePage());
      } else {
        contextLink = new Link("context") {
          static final long serialVersionUID = 201081L;
          public void onClick() {
            setResponsePage(contextPage);
View Full Code Here

      item.add(copyLink);

      final ViewContext entityUpdatePageContext = new ViewContext(
          viewContext);
      entityUpdatePageContext.setPageBlock(currentPageBlock);
      Link editLink = new PageLink("edit", new IPageLink() {
        static final long serialVersionUID = 200742L;

        public Page getPage() {
          return app.getViewMeta().getPage("EntityEditFormPage",
              entityModelContext, entityUpdatePageContext);
        }

        public Class getPageIdentity() {
          return app.getViewMeta().getPageClass("EntityEditFormPage",
              entityModelContext, entityUpdatePageContext);
        }
      });
      item.add(editLink);

      final ViewContext entityRemovePageContext = new ViewContext(
          viewContext);
      entityRemovePageContext.setPageBlock(currentPageBlock);
      item.add(new Link("remove") {
        static final long serialVersionUID = 200743L;

        public void onClick() {
          try {
            if (app.isConceptUpdateAllowed(
                getAppSession(), conceptConfig, entity, "remove")) {
              entities.getErrors().empty();
              if (app.getModelConfig().isConfirmRemove()) {
                setResponsePage(app.getViewMeta().getPage(
                    "EntityConfirmRemovePage",
                    entityModelContext,
                    entityRemovePageContext));
              } else if (entities.remove(entity)) {
                setResponsePage(app.getViewMeta().getPage(
                    "EntityUpdateTablePage",
                    entityModelContext,
                    entityRemovePageContext));
              } else {
                addDmLiteErrorKeys(entities);
              }
            } else {
              String error = getLocalizer().getString(
                  "entities.config.remove", this);
              error(error);
            }
          } catch (DmException e) {
            log.error("Error in EntityUpdateTableListView: "
                + modelContext.getEntitiesCode() + " - "
                + e.getMessage());
          }
        }
      });

      // Neighbor update links
      List<NeighborNameLabelLinkPair> neighborNameLabelLinkPairs = new ArrayList<NeighborNameLabelLinkPair>();
      NeighborsConfig neighborsConfig = conceptConfig
          .getNeighborsConfig();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("child")
            && neighborConfig.isInternal()) {
          NeighborNameLabelLinkPair neighborNameLabelLinkPair = new NeighborNameLabelLinkPair();
          String conceptCode = conceptConfig.getCode();
          String neighborKey = conceptCode + "."
              + neighborConfig.getCode();
          String neighborName = getLocalizer().getString(neighborKey,
              this);
          Label neighborNameLabel = new Label("neighborName",
              neighborName);
          neighborNameLabelLinkPair
              .setNeighborNameLabel(neighborNameLabel);
          Link neighborLink = null;
          IDomainModel domainModel = app.getDomainModel();
          final IOrderedEntities neighborEntities = (IOrderedEntities) domainModel
              .getModelMeta().getNeighborEntities(entity,
                  neighborConfig.getCode());

          final ModelContext neighborModelContext = new ModelContext(
              modelContext);
          neighborModelContext.setContextEntities(entities);
          neighborModelContext.setContextEntity(entity);
          neighborModelContext.setEntities(neighborEntities);
          final ViewContext neighborViewContext = new ViewContext(
              viewContext);
          neighborViewContext.setPageBlock(new Integer(0));

          neighborLink = new PageLink("neighbor", new IPageLink() {
            static final long serialVersionUID = 200744L;

            public Page getPage() {
              return app.getViewMeta().getPage(
                  "EntityUpdateTablePage",
View Full Code Here

   * @param viewContext
   *            view context
   */
  public static PageLink link(final ModelContext modelContext,
      final ViewContext viewContext) {
    PageLink link = new PageLink(viewContext.getWicketId(),
        new IPageLink() {
          static final long serialVersionUID = 200651L;
          public Page getPage() {
            return new EntityAddFormPage(modelContext, viewContext);
          }
View Full Code Here

      ModelContext entryModelContext = new ModelContext(modelContext);
      ViewContext entryViewContext = new ViewContext(viewContext);
      EntityDisplayPage entryPage = new EntityDisplayPage(
          entryModelContext, entryViewContext);
      Link moreLink = new PageLink("moreLink", entryPage);
      if (completeText) {
        moreLink.setVisible(false);
      }
      add(moreLink);
    } catch (Exception e) {
      log.error("Error in EntryDigestPanel: " + e.getMessage());
    }
View Full Code Here

  public HomePageMenuPanel(final String wicketId) {
    super(wicketId);
    try {
      final App app = (App) getApplication();

      Link homePageLink = new PageLink("home", app.getHomePage());
      homePageLink.setAutoEnable(true);
      add(homePageLink);

      Link loginLink = new PageLink("login", LoginPage.class);
      add(loginLink);
      Link logoutLink = new Link("logout") {
        static final long serialVersionUID = 200971L;

        public void onClick() {
          getAppSession().invalidate();
          setResponsePage(app.getViewMeta().getHomePageClass());
        }
      };
      add(logoutLink);
      if (getAppSession().isMemberLoggedIn()) {
        loginLink.setVisible(false);
      } else {
        logoutLink.setVisible(false);
      }
      if (!app.getModelConfig().isLogin()) {
        loginLink.setVisible(false);
      }

      if (app.getModelConfig().isI18n()) {
        ModelContext countryLanguageModelContext = new ModelContext();
        countryLanguageModelContext
            .setDomainModel(app.getDomainModel());
        CountryLanguages countryLanguages = (CountryLanguages) app
            .getEntry("CountryLanguages");
        countryLanguageModelContext.setEntities(countryLanguages);

        String languageCode = null;
        CountryLanguage defaultCountryLanguage = null;
        languageCode = getSession().getLocale().getLanguage();
        defaultCountryLanguage = (CountryLanguage) countryLanguages
            .retrieveByCode(languageCode);
        countryLanguageModelContext.setEntity(defaultCountryLanguage);
        ViewContext countryLanguageViewContext = new ViewContext();
        countryLanguageViewContext.setApp(app);
        countryLanguageViewContext.setPage(app.getViewMeta()
            .getHomePage());
        countryLanguageViewContext
            .setWicketId("countryLanguageChoicePanel");
        CountryLanguageChoicePanel countryLanguageChoicePanel = new CountryLanguageChoicePanel(
            countryLanguageModelContext, countryLanguageViewContext);
        add(countryLanguageChoicePanel);
      } else {
        Panel panel = new Panel("countryLanguageChoicePanel");
        add(panel);
        panel.setVisible(false);
      }

      ModelContext dmLiteEntryPageModelContext = new ModelContext();
      dmLiteEntryPageModelContext.setDomainModel(app.getDomainModel());

      ViewContext dmLiteEntryPageViewContext = new ViewContext();
      dmLiteEntryPageViewContext.setApp(app);

      WebPage dmLiteEntryPage = new DmLiteEntryPage(
          dmLiteEntryPageModelContext, dmLiteEntryPageViewContext);
      Link dmLiteEntryLink = new PageLink("dmLiteEntry", dmLiteEntryPage);
      add(dmLiteEntryLink);

      ModelConfig modelConfig = app.getDomainModel().getModelConfig();
      String modelKey = modelConfig.getCode();
      String modelName = getLocalizer().getString(modelKey, this);
View Full Code Here

TOP

Related Classes of wicket.markup.html.link.PageLink

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.