Package org.dmrad.view.context

Examples of org.dmrad.view.context.ViewContext


      add(new FeedbackPanel("feedbackPanel"));

      ModelContext entityAddFormPanelModelContext = new ModelContext(
          modelContext);

      ViewContext entityAddFormPanelViewContext = new ViewContext(
          viewContext);
      entityAddFormPanelViewContext.setPage(this);
      entityAddFormPanelViewContext.setWicketId("entityAddFormPanel");

      add(app.getViewMeta().getPanel("EntityAddFormPanel",
          entityAddFormPanelModelContext,
          entityAddFormPanelViewContext));
    } catch (Exception e) {
View Full Code Here


      MultiLineLabel entryBodyLabel = new MultiLineLabel("entryBody",
          entryBody);
      add(entryBodyLabel);

      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);
View Full Code Here

            .getModelObjectAsString());

        ModelContext keywordSelectionModelContext = new ModelContext(
            modelContext);

        ViewContext keywordSelectionViewContext = new ViewContext(
            viewContext);
        keywordSelectionViewContext.getMoreArgs().add("keywords",
            keywords);
        keywordSelectionViewContext.getMoreArgs().add("andKeywords",
            andKeywords);

        setResponsePage(viewContext.getApp().getViewMeta().getPage(
            "EntityPropertyKeywordSelectPage",
            keywordSelectionModelContext,
View Full Code Here

      if (entityEditFormModelContext.getUpdateEntity() == null) {
        afterEntity = modelContext.getEntity().copy();
        entityEditFormModelContext.setUpdateEntity(afterEntity);
      }
     
      ViewContext entityEditFormViewContext = new ViewContext(viewContext);
      entityEditFormViewContext.setWicketId("entityUpdateForm");

      add(app.getViewMeta().getForm("EntityEditForm",
          entityEditFormModelContext, entityEditFormViewContext));
    } catch (Exception e) {
      log.error("Error in EntityEditFormPanel: "
View Full Code Here

      App app = viewContext.getApp();

      ModelContext entityDisplayTablePanelModelContext = new ModelContext(
          modelContext);

      ViewContext entityDisplayTablePanelViewContext = new ViewContext(
          viewContext);
      entityDisplayTablePanelViewContext
          .setWicketId("entityDisplayTablePanel");
      entityDisplayTablePanelViewContext.setContextPage(this);
      entityDisplayTablePanelViewContext.setPage(this);
      entityDisplayTablePanelViewContext.setUpdate(false);

      add(app.getViewMeta().getPanel("EntityDisplayTablePanel",
          entityDisplayTablePanelModelContext,
          entityDisplayTablePanelViewContext));
    } catch (Exception e) {
View Full Code Here

      ModelContext parentModelContext = new ModelContext(modelContext,
          true);
      parentModelContext.setEntity(parentEntity);

      ViewContext parentViewContext = new ViewContext(viewContext, true);
      parentViewContext.setWicketId("parentProperty");

      PropertyConfig parentPropertyConfig = parentModelContext
          .getPropertyConfig();
      Panel parentPropertyPanel;
      String propertyType = parentPropertyConfig.getPropertyClass();
      if (propertyType.equals("java.net.URL")
          || propertyType.equals("org.dmlite.type.email.Email")) {
        parentPropertyPanel = new ExternalLinkPanel(parentModelContext,
            parentViewContext);
        item.add(parentPropertyPanel);
      } else if (parentPropertyConfig.getPropertyClass().equals(
          "java.lang.String")
          && parentPropertyConfig.isValidateType()) {
        if (parentPropertyConfig.getValidationType().equals(
            "java.net.URL")
            || parentPropertyConfig.getValidationType().equals(
                "org.dmlite.type.email.Email")) {
          parentPropertyPanel = new ExternalLinkPanel(
              parentModelContext, parentViewContext);
          item.add(parentPropertyPanel);
        } else {
          parentPropertyPanel = new LabelPanel(parentModelContext,
              parentViewContext);
          item.add(parentPropertyPanel);
        }
      } else {
        parentPropertyPanel = new LabelPanel(parentModelContext,
            parentViewContext);
        item.add(parentPropertyPanel);
      }
      if (!app.isPropertyDisplayAllowed(getAppSession(),
          parentPropertyConfig)) {
        parentPropertyPanel.setVisible(false);
      }

      ModelContext childModelContext = new ModelContext(modelContext,
          true);
      childModelContext.setEntity(parentEntity);

      ViewContext childViewContext = new ViewContext(viewContext, true);
      childViewContext.setWicketId("childPropertyList");

      item.add(app.getViewMeta().getPanel(
          "ChildPropertyDisplayListPanel", childModelContext,
          childViewContext));
    } catch (Exception e) {
View Full Code Here

    super(modelContext, viewContext);
    try {
      ModelContext entriesModelContext = new ModelContext(modelContext);
      IEntities entries = entriesModelContext.getEntities();
      if (entries != null) {
        ViewContext entriesViewContext = new ViewContext(viewContext);
        entriesViewContext.setWicketId("entryList");
        EntryList entryList = new EntryList(entriesModelContext,
            entriesViewContext);
        add(entryList);
      }
    } catch (Exception e) {
View Full Code Here

        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);
View Full Code Here

  protected void populateItem(final ListItem item) {
    try {
      Entry entry = (Entry) item.getModelObject();
      ModelContext entriesModelContext = new ModelContext(modelContext);
      entriesModelContext.setEntity(entry);
      ViewContext entriesViewContext = new ViewContext(viewContext);
      entriesViewContext.setWicketId("entryDigestPanel");
      EntryDigestPanel entryDigestPanel = new EntryDigestPanel(
          entriesModelContext, entriesViewContext);
      item.add(entryDigestPanel);
    } catch (Exception e) {
      log.error("Error in LinkList: " + e.getMessage());
View Full Code Here

      App app = viewContext.getApp();
     
      ModelContext entityDisplayTablePanelModelContext = new ModelContext(
          modelContext);

      ViewContext entityDisplayListPanelViewContext = new ViewContext(
          viewContext);
      entityDisplayListPanelViewContext.setContextPage(this);
      entityDisplayListPanelViewContext.setPage(this);
      entityDisplayListPanelViewContext.setUpdate(false);
      entityDisplayListPanelViewContext
          .setWicketId("entityDisplayListPanel");

      add(app.getViewMeta().getPanel("EntityDisplayListPanel",
          entityDisplayTablePanelModelContext,
          entityDisplayListPanelViewContext));
View Full Code Here

TOP

Related Classes of org.dmrad.view.context.ViewContext

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.