Package wicket.markup.html.panel

Examples of wicket.markup.html.panel.Panel


      ViewContext infoViewContext = new ViewContext();
      infoViewContext.setApp(app);
      infoViewContext.setContextPage(this);
      infoViewContext.setPage(this);
      infoViewContext.setWicketId("lastInfoPanel");
      Panel lastInfoMinPanel;
      if (lastInfo != null) {
        lastInfoMinPanel = new EntityDisplayMinPanel(infoModelContext,
            infoViewContext);
      } else {
        lastInfoMinPanel = new Panel("lastInfoPanel");
        lastInfoMinPanel.setVisible(false);
      }
      add(lastInfoMinPanel);

      ModelContext blogEntriesModelContext = new ModelContext();
      blogEntriesModelContext.setDomainModel(app.getDomainModel());
View Full Code Here


              PropertyConfig parentConceptPropertyConfig = (PropertyConfig) parentPropertyConfigEntity;
              if (parentConceptPropertyConfig.isEssential()) {
                IEntity parentEntity = entity
                    .getNeighborEntity(neighborConfig
                        .getCode());
                Panel parentPropertyPanel;
                if (parentEntity != null) {
                  parentModelContext.setEntity(parentEntity);
                  parentModelContext
                      .setPropertyConfig(parentConceptPropertyConfig);
                  parentViewContext.setWicketId("valuePanel");
                  parentViewContext.getMoreArgs().add(
                      "shortText", Boolean.TRUE);
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyPanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.lang.String")
                      && parentConceptPropertyConfig
                          .isValidateType()
                      && (parentConceptPropertyConfig
                          .getValidationType()
                          .equals("java.net.URL") || parentConceptPropertyConfig
                          .getValidationType()
                          .equals(
                              "org.dmlite.type.email.Email"))) {
                    parentPropertyPanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyPanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  } // if
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyPanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyPanel.setVisible(false);
                  }
                } else {
                  parentPropertyPanel = new Panel(
                      "valuePanel");
                  parentPropertyPanel.setVisible(false);
                }
                propertyValuePanels.add(parentPropertyPanel);
              } // if
            } // for
          } // if
        } // if
      } // for

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity propertyConfigEntity : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) propertyConfigEntity;
        if (propertyConfig.isEssential()) {
          entityModelContext.setPropertyConfig(propertyConfig);
          ViewContext propertiesViewContext = new ViewContext(
              viewContext);
          propertiesViewContext.setWicketId("valuePanel");
          propertiesViewContext.getMoreArgs().add("shortText",
              Boolean.TRUE);
          Panel essentialPropertyPanel;
          if (propertyConfig.getPropertyClass()
              .equals("java.net.URL")
              || propertyConfig.getPropertyClass().equals(
                  "org.dmlite.type.email.Email")) {
            essentialPropertyPanel = new ExternalLinkPanel(
                entityModelContext, propertiesViewContext);
          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.String")
              && propertyConfig.isValidateType()
              && (propertyConfig.getValidationType().equals(
                  "java.net.URL") || propertyConfig
                  .getValidationType().equals(
                      "org.dmlite.type.email.Email"))) {
            essentialPropertyPanel = new ExternalLinkPanel(
                entityModelContext, propertiesViewContext);
          } else {
            essentialPropertyPanel = new LabelPanel(
                entityModelContext, propertiesViewContext);
          } // end if
          if (!app.isPropertyDisplayAllowed(getAppSession(),
              propertyConfig)) {
            essentialPropertyPanel.setVisible(false);
          }

          propertyValuePanels.add(essentialPropertyPanel);
        } // end if (propertyConfig.isEssential()) {
      } // for
View Full Code Here

          entityContext.setPropertyConfig(propertyConfig);
          ViewContext propertiesViewContext = new ViewContext(
              viewContext);
          propertiesViewContext.setWicketId("valuePanel");
          Panel essentialPropertyPanel;
          if (propertyConfig.getPropertyClass()
              .equals("java.net.URL")
              || propertyConfig.getPropertyClass().equals(
                  "org.dmlite.type.email.Email")) {
            essentialPropertyPanel = new ExternalLinkPanel(
                entityContext, propertiesViewContext);
          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.String")
              && propertyConfig.isValidateType()
              && (propertyConfig.getValidationType().equals(
                  "java.net.URL") || propertyConfig
                  .getValidationType().equals(
                      "org.dmlite.type.email.Email"))) {
            essentialPropertyPanel = new ExternalLinkPanel(
                entityContext, propertiesViewContext);
          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.Boolean")) {
            essentialPropertyPanel = new CheckBoxPanel(
                entityContext, propertiesViewContext);
          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.String")
              && propertyConfig.getDisplayLengthInt() > App.MIN_LONG_TEXT_LENGTH) {
            essentialPropertyPanel = new MultiLineLabelPanel(
                entityContext, propertiesViewContext);
          } else {
            essentialPropertyPanel = new LabelPanel(entityContext,
                propertiesViewContext);
          }
          if (!app.isPropertyDisplayAllowed(getAppSession(),
              propertyConfig)) {
            essentialPropertyPanel.setVisible(false);
          }

          propertyNameLabelValuePanelPair
              .setPropertyValuePanel(essentialPropertyPanel);
          propertyNameLabelValuePanelPairs
View Full Code Here

                  ViewContext parentViewContext = new ViewContext(
                      viewContext);
                  parentViewContext.setWicketId("valuePanel");

                  Panel parentPropertyValuePanel;
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyValuePanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyValuePanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  }
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyNameLabel.setVisible(false);
                    parentPropertyValuePanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyNameLabel.setVisible(false);
                    parentPropertyValuePanel.setVisible(false);
                  }

                  propertyNameLabelValuePanelPair
                      .setPropertyValuePanel(parentPropertyValuePanel);
                  propertyNameLabelValuePanelPairs
                      .add(propertyNameLabelValuePanelPair);
                } // if
              } // if
            } // for
          } // if
        } // if
      } // for

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity propertyConfigEntity : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) propertyConfigEntity;
        if (!propertyConfig.isReference()) {
          String propertyKey = conceptConfig.getCode() + "."
              + propertyConfig.getCode();
          String propertyName = getLocalizer().getString(propertyKey,
              this);
          Label propertyNameLabel = new Label("propertyName",
              propertyName);
          PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
          propertyNameLabelValuePanelPair
              .setPropertyNameLabel(propertyNameLabel);
          entityContext.setPropertyConfig(propertyConfig);
          ViewContext propertiesViewContext = new ViewContext(
              viewContext);
          propertiesViewContext.setWicketId("valuePanel");
          Panel propertyValuePanel;
          if (propertyConfig.getPropertyClass()
              .equals("java.net.URL")
              || propertyConfig.getPropertyClass().equals(
                  "org.dmlite.type.email.Email")) {
            propertyValuePanel = new ExternalLinkPanel(entityContext,
                propertiesViewContext);
          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.String")
              && propertyConfig.isValidateType()
              && (propertyConfig.getValidationType().equals(
                  "java.net.URL") || propertyConfig
                  .getValidationType().equals(
                      "org.dmlite.type.email.Email"))) {

            propertyValuePanel = new ExternalLinkPanel(entityContext,
                propertiesViewContext);

          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.Boolean")) {
            propertyValuePanel = new CheckBoxPanel(entityContext,
                propertiesViewContext);

          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.String")
              && propertyConfig.getDisplayLengthInt() > App.MIN_LONG_TEXT_LENGTH) {
            propertyValuePanel = new MultiLineLabelPanel(entityContext,
                propertiesViewContext);

          } else {
            propertyValuePanel = new LabelPanel(entityContext,
                propertiesViewContext);
          } // end if
          if (!app.isPropertyDisplayAllowed(getAppSession(),
              propertyConfig)) {
            propertyNameLabel.setVisible(false);
            propertyValuePanel.setVisible(false);
          }

          propertyNameLabelValuePanelPair
              .setPropertyValuePanel(propertyValuePanel);
          propertyNameLabelValuePanelPairs
View Full Code Here

                  ViewContext parentViewContext = new ViewContext(
                      viewContext);
                  parentViewContext.setWicketId("valuePanel");

                  Panel parentPropertyValuePanel;
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyValuePanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyValuePanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  }
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyNameLabel.setVisible(false);
                    parentPropertyValuePanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyNameLabel.setVisible(false);
                    parentPropertyValuePanel.setVisible(false);
                  }

                  propertyNameLabelValuePanelPair
                      .setPropertyValuePanel(parentPropertyValuePanel);
                  propertyNameLabelValuePanelPairs
                      .add(propertyNameLabelValuePanelPair);
                } // if
              } // if
            } // for
          } // if
        } // if
      } // for

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity config : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) config;
        String propertyCode = propertyConfig.getCode();
        String propertyKey = conceptConfig.getCode() + "."
            + propertyCode;
        String propertyName = getLocalizer().getString(propertyKey,
            this);
        PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
        Label propertyNameLabel = new Label("propertyName",
            propertyName);
        propertyNameLabelValuePanelPair
            .setPropertyNameLabel(propertyNameLabel);
        ModelContext entityModelContext = new ModelContext(modelContext);
        entityModelContext.setPropertyConfig(propertyConfig);
        Panel propertyValuePanel;
        if (propertyConfig.getPropertyClass().equals(
            "java.lang.Boolean")) {
          ViewContext checkBoxPanelContext = new ViewContext(
              viewContext);
          checkBoxPanelContext.setWicketId("valuePanel");
          propertyValuePanel = new CheckBoxPanel(entityModelContext,
              checkBoxPanelContext);
        } else if (propertyConfig.getPropertyClass().equals(
            "java.lang.String")
            && propertyConfig.getDisplayLengthInt() > App.MIN_LONG_TEXT_LENGTH) {
          ViewContext textAreaPanelContext = new ViewContext(
              viewContext);
          textAreaPanelContext.setWicketId("valuePanel");
          propertyValuePanel = new TextAreaPanel(entityModelContext,
              textAreaPanelContext);
        } else if (propertyConfig.isReference()) {
          String neighborCode = propertyConfig.getReferenceNeighbor();
          NeighborConfig neighborConfig = conceptConfig
              .getNeighborsConfig().getNeighborConfig(
                  neighborCode);
          String neighborConceptCode = neighborConfig
              .getDestination();
          IPersistentEntities persistentEntities = app.getDbContext()
              .getPersistentModel().getPersistentEntry(
                  neighborConceptCode);
          IOrderedEntities lookupEntities = null;
          if (persistentEntities != null) {
            lookupEntities = (IOrderedEntities) persistentEntities
                .getEntities();
          }
          if (lookupEntities != null) {
            ModelContext neighborModelContext = new ModelContext(
                modelContext);
            neighborModelContext.setPropertyConfig(propertyConfig);
            neighborModelContext.setLookupEntities(lookupEntities);
            ViewContext lookupViewContext = new ViewContext(
                viewContext);
            lookupViewContext.setWicketId("valuePanel");
            if (neighborConfig.getMinInt() == 0) {
              propertyValuePanel = new LookupEmptyPanel(
                  neighborModelContext, lookupViewContext);

            } else {
              propertyValuePanel = new LookupPanel(
                  neighborModelContext, lookupViewContext);
            }
          } else {
            ViewContext textFieldPanelContext = new ViewContext(
                viewContext);
            textFieldPanelContext.setWicketId("valuePanel");
            propertyValuePanel = new TextFieldPanel(entityModelContext,
                textFieldPanelContext);
          }
        } else if (propertyConfig.isValidateType()
            && propertyConfig
                .isValidatationTypeEntities(domainModel)) {
          ViewContext dropDownChoicePanelContext = new ViewContext(
              viewContext);
          dropDownChoicePanelContext.setWicketId("valuePanel");
          propertyValuePanel = new TypeValueDropDownChoicePanel(
              entityModelContext, dropDownChoicePanelContext);
        } else {
          ViewContext textFieldPanelContext = new ViewContext(
              viewContext);
          textFieldPanelContext.setWicketId("valuePanel");
          propertyValuePanel = new TextFieldPanel(entityModelContext,
              textFieldPanelContext);
        } // end if
        if (!app.isPropertyDisplayAllowed(getAppSession(),
            propertyConfig)) {
          propertyNameLabel.setVisible(false);
          propertyValuePanel.setVisible(false);
        } else if (!app.isPropertyUpdateAllowed(getAppSession(),
            propertyConfig)) {
          ViewContext labelPanelContext = new ViewContext(viewContext);
          labelPanelContext.setWicketId("valuePanel");
          propertyValuePanel = new LabelPanel(entityModelContext,
View Full Code Here

   * @param item
   *            list item
   */
  protected void populateItem(ListItem item) {
    try {
      Panel propertyValuePanel = (Panel) item.getModelObject();
      item.add(propertyValuePanel);
    } catch (Exception e) {
      log.error("Error in PropertyValuePanelListView: " + e.getMessage());
    }
  }
View Full Code Here

   * @param item
   *            list item
   */
  protected void populateItem(ListItem item) {
    try {
      Panel panel = (Panel) item.getModelObject();
      item.add(panel);
    } catch (Exception e) {
      log.error("Error in PanelListView: " + e.getMessage());
    }
  }
View Full Code Here

      PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = (PropertyNameLabelValuePanelPair) item
          .getModelObject();
      Label propertyNameLabel = propertyNameLabelValuePanelPair
          .getPropertyNameLabel();
      item.add(propertyNameLabel);
      Panel propertyValuePanel = propertyNameLabelValuePanelPair
          .getPropertyValuePanel();
      item.add(propertyValuePanel);
    } catch (Exception e) {
      log.error("Error in PropertyNameLabelValuePanelListView: "
          + e.getMessage());
View Full Code Here

                      .setPropertyConfig(parentConceptPropertyConfig);

                  ViewContext parentViewContext = new ViewContext(
                      viewContext);
                  parentViewContext.setWicketId("valuePanel");
                  Panel parentPropertyPanel;
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyPanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyPanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  } // if
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyPanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyPanel.setVisible(false);
                  }

                  propertyNameLabelValuePanelPair
                      .setPropertyValuePanel(parentPropertyPanel);
                  propertyNameLabelValuePanelPairs
                      .add(propertyNameLabelValuePanelPair);
                } // if
              } // if
            } // for
          } // if
        } // if
      } // for

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity propertyConfigEntity : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) propertyConfigEntity;
        if (!propertyConfig.isReference()) {
          String propertyKey = conceptCode + "."
              + propertyConfig.getCode();
          String propertyName = getLocalizer().getString(propertyKey,
              this);
          Label propertyNameLabel = new Label("propertyName",
              propertyName);
          PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
          propertyNameLabelValuePanelPair
              .setPropertyNameLabel(propertyNameLabel);

          entityModelContext.setPropertyConfig(propertyConfig);
          ViewContext propertiesViewContext = new ViewContext(
              viewContext);
          propertiesViewContext.setWicketId("valuePanel");
          Panel propertyValuePanel;
          if (propertyConfig.getPropertyClass()
              .equals("java.net.URL")
              || propertyConfig.getPropertyClass().equals(
                  "org.dmlite.type.email.Email")) {
            propertyValuePanel = new ExternalLinkPanel(
                entityModelContext, propertiesViewContext);
          } else if (propertyConfig.getPropertyClass().equals(
              "java.lang.String")
              && propertyConfig.isValidateType()
              && (propertyConfig.getValidationType().equals(
                  "java.net.URL") || propertyConfig
                  .getValidationType().equals(
                      "org.dmlite.type.email.Email"))) {
            propertyValuePanel = new ExternalLinkPanel(
                entityModelContext, propertiesViewContext);
          } else {
            propertyValuePanel = new LabelPanel(entityModelContext,
                propertiesViewContext);
          }
          if (!app.isPropertyDisplayAllowed(getAppSession(),
              propertyConfig)) {
            propertyNameLabel.setVisible(false);
            propertyValuePanel.setVisible(false);
          }

          propertyNameLabelValuePanelPair
              .setPropertyValuePanel(propertyValuePanel);
          propertyNameLabelValuePanelPairs
              .add(propertyNameLabelValuePanelPair);
        }
      }

      ListView propertyNameLabelValuePanelListView = new PropertyNameLabelValuePanelListView(
          "propertyNameLabelValuePanelListView",
          propertyNameLabelValuePanelPairs);
      item.add(propertyNameLabelValuePanelListView);
      if (!app.isConceptDisplayAllowed(getAppSession(), conceptConfig)) {
        propertyNameLabelValuePanelListView.setVisible(false);
      }

      List<Panel> childList = new ArrayList<Panel>();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("child")) {
          String childCode = neighborConfig.getCode();
          IDomainModel domainModel = app.getDomainModel();
          IOrderedEntities childEntities = (IOrderedEntities) domainModel
              .getModelMeta().getNeighborEntities(entity,
                  childCode);
          ModelContext childEntitiesContext = new ModelContext(
              modelContext);
          childEntitiesContext.setEntities(childEntities);
          ViewContext entityDisplayListPanelContext = new ViewContext(
              viewContext);
          entityDisplayListPanelContext
              .setWicketId("entityDisplayListPanel");
          Panel entityDisplayListPanel = app.getViewMeta().getPanel(
              "EntityDisplayListPanel", childEntitiesContext,
              entityDisplayListPanelContext);
          childList.add(entityDisplayListPanel);
          if (!app.isNeighborDisplayAllowed(getAppSession(),
              neighborConfig)) {
            entityDisplayListPanel.setVisible(false);
          }
        } // if (neighborConfig.getType().equals("child")) {
      } // for

      item.add(new PanelListView("childEntityListPanelListView",
View Full Code Here

      confirmationViewContext.setApp(app);
      confirmationViewContext.setContextPage(this);
      confirmationViewContext.setPage(this);
      confirmationViewContext.setWicketId("newMemberConfirmPanel");
      confirmationViewContext.setUpdate(true);
      Panel newMemberConfirmPanel = app.getViewMeta().getNewMemberConfirmPanel(
          confirmationModelContext, confirmationViewContext);
      add(newMemberConfirmPanel);
      if (!app.getDomainModel().getModelConfig().isLogup()) {
        newMemberConfirmPanel.setVisible(false);
      }
    } catch (Exception e) {
      log.error("Error in LoginPage: " + e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of wicket.markup.html.panel.Panel

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.