Package org.dmrad.view.context

Examples of org.dmrad.view.context.ModelContext


   */
  public EntryDisplayTablePage(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      ModelContext entryDisplayTablePanelModelContext = new ModelContext(
          modelContext);

      ViewContext entryDisplayTablePanelViewContext = new ViewContext(
          viewContext);
      entryDisplayTablePanelViewContext
View Full Code Here


    super(getNewModelContext(modelContext), viewContext);
  }

  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Users users = (Users) modelContext.getEntities();
    Users orderedUsers = users.getUsersOrderedByLastFirstName(true);
    newModelContext.setEntities(orderedUsers);
    return newModelContext;
  }
View Full Code Here

  public PropertyListPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      ModelContext propertiesModelContext = new ModelContext(modelContext);
      ViewContext propertiesViewContext = new ViewContext(viewContext);
      propertiesViewContext.setWicketId("propertyList");
      PropertyList propertyList = new PropertyList(
          propertiesModelContext, propertiesViewContext);
      add(propertyList);
View Full Code Here

  public ConceptListPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      ModelContext conceptsModelContext = new ModelContext(modelContext);
      IEntities concepts = conceptsModelContext.getEntities();
      if (concepts != null) {
        ViewContext conceptsViewContext = new ViewContext(viewContext);
        conceptsViewContext.setWicketId("conceptList");
        ConceptList conceptList = new ConceptList(conceptsModelContext,
            conceptsViewContext);
View Full Code Here

      Concept concept = (Concept) item.getModelObject();
      String conceptName = concept.getCode().toUpperCase();
      Label conceptNameLabel = new Label("conceptName", conceptName);
      item.add(conceptNameLabel);

      ModelContext propertiesModelContext = new ModelContext(modelContext);
      Properties properties = concept.getProperties();
      propertiesModelContext.setEntities(properties);
      ViewContext propertiesViewContext = new ViewContext(viewContext);
      propertiesViewContext.setWicketId("propertyListPanel");
      PropertyListPanel propertyListPanel = new PropertyListPanel(
          propertiesModelContext, propertiesViewContext);
      item.add(propertyListPanel);

      ModelContext neighborsModelContext = new ModelContext(modelContext);
      Neighbors neighbors = concept.getNeighbors();
      neighborsModelContext.setEntities(neighbors);
      ViewContext neighborsViewContext = new ViewContext(viewContext);
      neighborsViewContext.setWicketId("neighborListPanel");
      NeighborListPanel neighborListPanel = new NeighborListPanel(
          neighborsModelContext, neighborsViewContext);
      item.add(neighborListPanel);
View Full Code Here

      ConceptConfig conceptConfig = entity.getConceptConfig();
      String conceptKey = conceptConfig.getCode();
      String conceptName = getLocalizer().getString(conceptKey, this);
      add(new Label("conceptName", conceptName));

      ModelContext entityContext = new ModelContext(modelContext);

      List<PropertyNameLabelValuePanelPair> propertyNameLabelValuePanelPairs = new ArrayList<PropertyNameLabelValuePanelPair>();

      // Properties absorbed from parents.
      NeighborsConfig neighborsConfig = conceptConfig
          .getNeighborsConfig();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("parent")
            && neighborConfig.getMax().equals("1")
            && neighborConfig.isAbsorb()) {
          ConceptConfig parentConceptConfig = neighborConfig
              .getNeighborDestinationConceptConfig();
          if (parentConceptConfig != null) {
            PropertiesConfig parentConceptPropertiesConfig = parentConceptConfig
                .getPropertiesConfig();
            for (IEntity parentPropertyConfigEntity : parentConceptPropertiesConfig) {
              PropertyConfig parentConceptPropertyConfig = (PropertyConfig) parentPropertyConfigEntity;
              if (parentConceptPropertyConfig.isEssential()) {
                IEntity parentEntity = entity
                    .getNeighborEntity(neighborConfig
                        .getCode());
                if (parentEntity != null) {
                  String parentCode = parentEntity
                      .getConceptConfig().getCode();
                  String parentPropertyKey = parentCode
                      + "."
                      + parentConceptPropertyConfig
                          .getCode();
                  String parentPropertyName = getLocalizer()
                      .getString(parentPropertyKey, this);
                  Label parentPropertyNameLabel = new Label(
                      "propertyName", parentPropertyName);
                  PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
                  propertyNameLabelValuePanelPair
                      .setPropertyNameLabel(parentPropertyNameLabel);

                  ModelContext parentModelContext = new ModelContext(
                      modelContext);
                  parentModelContext.setEntity(parentEntity);
                  parentModelContext
                      .setPropertyConfig(parentConceptPropertyConfig);

                  ViewContext parentViewContext = new ViewContext(
                      viewContext);
                  parentViewContext.setWicketId("valuePanel");
View Full Code Here

  public NeighborListPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      ModelContext neighborsModelContext = new ModelContext(modelContext);
      ViewContext neighborsViewContext = new ViewContext(viewContext);
      neighborsViewContext.setWicketId("neighborList");
      NeighborList neighborList = new NeighborList(neighborsModelContext,
          neighborsViewContext);
      add(neighborList);
View Full Code Here

  public DmRadDisplayPage(final ModelContext modelContext,
      final ViewContext viewContext) {
    try {
      App app = viewContext.getApp();

      ModelContext menuModelContext = new ModelContext(modelContext);
      ViewContext menuViewContext = new ViewContext(viewContext);
      menuViewContext.setWicketId("dmRadMenuPanel");
      add(app.getViewMeta().getDmRadMenuPanel(menuModelContext,
          menuViewContext));
    } catch (Exception e) {
View Full Code Here

   *            model context
   * @return model context
   */
  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Projects projects = (Projects) modelContext.getEntities();
    projects = projects.getProjectsOrderedByName();
    newModelContext.setEntities(projects);
    return newModelContext;
  }
View Full Code Here

   *            model context
   * @return model context
   */
  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Projects projects = (Projects) modelContext.getEntities();
    projects = projects.getProjectsOrderedByName();
    newModelContext.setEntities(projects);
    return newModelContext;
  }
View Full Code Here

TOP

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

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.