Java Code Examples for org.apache.wicket.markup.html.list.ListView

The following examples show how to use org.apache.wicket.markup.html.list.ListView. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
protected void onInitialize()
{
	super.onInitialize();
	List<EventDetail> detailsList = getDetails();
	add(new ListView<EventDetail>("detailsList", detailsList)
	{
		@Override
		protected void populateItem(ListItem<EventDetail> item)
		{
			EventDetail ref = item.getModelObject();
			item.add(new Label("key", Model.of(ref.getKey())).setRenderBodyOnly(true));
			Fragment frag = buildDetailsFragment(ref);
			item.add(frag);
		}
	});
}
 
Example 2
Source Project: syncope   Source File: BaseModal.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onInitialize() {
    super.onInitialize();

    final WebMarkupContainer dialog = (WebMarkupContainer) this.get("dialog");
    dialog.setMarkupId(this.getId());

    footer = (WebMarkupContainer) this.get("dialog:footer");
    footer.addOrReplace(new ListView<Component>("inputs", components) {

        private static final long serialVersionUID = 4949588177564901031L;

        @Override
        protected void populateItem(final ListItem<Component> item) {
            item.add(item.getModelObject());
        }
    }.setOutputMarkupId(true)).setOutputMarkupId(true);
}
 
Example 3
Source Project: inception   Source File: AnnotatedListIdentifiers.java    License: Apache License 2.0 6 votes vote down vote up
public SearchResultGroup(String aId, String aMarkupId, MarkupContainer aMarkupProvider,
    List<String> aResultList)
{
    super(aId, aMarkupId, aMarkupProvider);

    ListView<String> statementList = new ListView<String>("results")
    {
        private static final long serialVersionUID = 5811425707843441458L;

        @Override protected void populateItem(ListItem<String> aItem)
        {
            aItem.add(
                new Label("sentence", aItem.getModelObject())
                    .setEscapeModelStrings(false));
        }
    };
    statementList.setList(aResultList);
    add(statementList);
}
 
Example 4
Source Project: Orienteer   Source File: SocialNetworkPanel.java    License: Apache License 2.0 6 votes vote down vote up
private ListView<OAuth2Service> createSocialNetworksServices(String id) {
    return new ListView<OAuth2Service>(id, getModel()) {
        @Override
        protected void populateItem(ListItem<OAuth2Service> item) {
            IOAuth2Provider provider = item.getModelObject().getProvider();

            Image image = new Image("networkImage", provider.getIconResourceReference());
            image.setOutputMarkupPlaceholderTag(true);
            image.add(new AjaxEventBehavior("click") {
                @Override
                protected void onEvent(AjaxRequestTarget target) {
                    onSocialImageClick(target, item.getModel());
                }
            });
            image.add(new AttributeModifier("alt", new ResourceModel(provider.getLabel()).getObject()));

            item.add(image);
        }

        @Override
        protected void onInitialize() {
            super.onInitialize();
            setReuseItems(true);
        }
    };
}
 
Example 5
/**
 * Helper to create a listview for what needs to be shown
 * 
 * @param markupId wicket markup id
 * @param itemList ist of stuff
 * @return
 */
private ListView<ProcessedGradeItem> makeListView(final String markupId, final List<ProcessedGradeItem> itemList) {

	final ListView<ProcessedGradeItem> rval = new ListView<ProcessedGradeItem>(markupId, itemList) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void populateItem(final ListItem<ProcessedGradeItem> item) {

			final ProcessedGradeItem gradeItem = item.getModelObject();

			String displayTitle = gradeItem.getItemTitle();
			if (gradeItem.getType() == Type.COMMENT) {
				displayTitle = MessageHelper.getString("importExport.confirmation.commentsdisplay", gradeItem.getItemTitle());
			}

			item.add(new Label("title", displayTitle));
			item.add(new Label("points", gradeItem.getItemPointValue()));
		}
	};

	return rval;
}
 
Example 6
Source Project: onedev   Source File: Tabbable.java    License: MIT License 6 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	add(new ListView<Tab>("tabs", new LoadableDetachableModel<List<Tab>>() {

		@Override
		protected List<Tab> load() {
			return getTabs().stream().collect(Collectors.toList());
		}
		
	}) {

		@Override
		protected void populateItem(ListItem<Tab> item) {
			Tab tab = item.getModelObject();
			if (tab.isSelected())
				item.add(AttributeModifier.append("class", "active"));

			item.add(tab.render("tab"));
		}
		
	});
}
 
Example 7
Source Project: onedev   Source File: PropertyChangePanel.java    License: MIT License 6 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(new WebMarkupContainer("nameHeader").setVisible(showName));
	
	add(new ListView<PropertyChange>("properties", changes) {

		@Override
		protected void populateItem(ListItem<PropertyChange> item) {
			PropertyChange change = item.getModelObject();
			item.add(new Label("name", change.name).setVisible(showName));
			if (change.oldValue != null)
				item.add(new Label("oldValue", change.oldValue));
			else
				item.add(new Label("oldValue", "<i>empty</i>").setEscapeModelStrings(false));
			if (change.newValue != null)
				item.add(new Label("newValue", change.newValue));
			else
				item.add(new Label("newValue", "<i>empty</i>").setEscapeModelStrings(false));
		}
		
	});
}
 
Example 8
Source Project: Orienteer   Source File: FilterPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void addFilterPanels(WebMarkupContainer container, List<AbstractFilterPanel<?, ?>> panels, final List<FilterTab> tabs) {
    ListView<AbstractFilterPanel<?, ?>> listView = new ListView<AbstractFilterPanel<?, ?>>("filterPanels", panels) {
        private boolean first = true;
        @Override
        protected void populateItem(ListItem<AbstractFilterPanel<?, ?>> item) {
            if (first) {
                first = false;
                item.add(AttributeModifier.append("class", TAB_PANE_ACTIVE));
            } else item.add(AttributeModifier.append("class", TAB_PANE));
            item.add(AttributeModifier.append("class", FILTER_WIDTH));
            AbstractFilterPanel panel = item.getModelObject();
            for (FilterTab tab : tabs) {
                if (tab.getType().equals(panel.getFilterCriteriaType())) {
                    tab.setTabId(item.getMarkupId());
                    break;
                }
            }
            item.add(panel);
        }
    };
    listView.setOutputMarkupPlaceholderTag(true);
    listView.setReuseItems(true);
    container.add(listView);
}
 
Example 9
Source Project: yes-cart   Source File: PaymentPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Get the negative result fragment.
 * @return negative result fragment
 */
private MarkupContainer createNegativePaymentResultFragment() {

    error(getLocalizer().getString(NEGATIVE_PAYMENT_NOTES, this));

    final List<CustomerOrderPayment> payments = checkoutServiceFacade.findPaymentRecordsByOrderNumber(getOrderNumber());


    return new Fragment(RESULT_CONTAINER, NEGATIVE_RESULT_FRAGMENT, this)
            .add(
                    new ListView<CustomerOrderPayment>(PAYMENT_DETAIL_LIST, payments) {
                        @Override
                        protected void populateItem(final ListItem<CustomerOrderPayment> item) {
                            final CustomerOrderPayment payment = item.getModelObject();
                            item.add(new Label(PAYMENT_ID_LABEL, String.valueOf(payment.getCustomerOrderPaymentId())));
                            item.add(new Label(PAYMENT_TRANS_ID, StringUtils.defaultIfEmpty(payment.getTransactionReferenceId(), StringUtils.EMPTY)));
                            item.add(new Label(PAYMENT_AUTH_CODE, StringUtils.defaultIfEmpty(payment.getTransactionAuthorizationCode(), StringUtils.EMPTY)));
                            item.add(new Label(PAYMENT_ERROR_CODE, StringUtils.defaultIfEmpty(payment.getTransactionOperationResultCode(), StringUtils.EMPTY)));
                            item.add(new Label(PAYMENT_ERROR_DESCR, StringUtils.defaultIfEmpty(payment.getTransactionOperationResultMessage(), StringUtils.EMPTY)));
                        }
                    }

            );
}
 
Example 10
Source Project: oodt   Source File: TypeBrowser.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param id
 *          The wicket:id identifier of the criteria form.
 */
public ExistingCriteriaForm(String id) {
  super(id);
  ListView<TermQueryCriteria> criteriaView = new ListView<TermQueryCriteria>(
      "criteria_selected_row", criteria) {

    @Override
    protected void populateItem(ListItem<TermQueryCriteria> item) {
      item.add(new Label("criteria_elem_name", item.getModelObject()
          .getElementName()));
      item.add(new Label("criteria_elem_value", item.getModelObject()
          .getValue()));
      item.add(new TermQueryCriteriaRemoveButton("criteria_elem_remove",
          item.getModelObject()));
    }
  };
  criteriaView.setReuseItems(true);
  add(criteriaView);
}
 
Example 11
@Override
public void onInitialize() {
	super.onInitialize();

	final List<Assignment> assignments = this.businessService.getGradebookAssignments(SortType.SORT_BY_SORTING);

	add(new ListView<Assignment>("gradeItemList", assignments) {
		@Override
		protected void populateItem(final ListItem<Assignment> assignmentItem) {
			final Assignment assignment = assignmentItem.getModelObject();
			assignmentItem.add(new Label("name", assignment.getName()));
			assignmentItem.add(new HiddenField<Long>("id",
					Model.of(assignment.getId())).add(
							new AttributeModifier("name",
									String.format("id", assignment.getId()))));
			assignmentItem.add(new HiddenField<Integer>("order",
					Model.of(assignment.getSortOrder())).add(
							new AttributeModifier("name",
									String.format("item_%s[order]", assignment.getId()))));
			assignmentItem.add(new HiddenField<Integer>("current_order",
					Model.of(assignment.getSortOrder())).add(
							new AttributeModifier("name",
									String.format("item_%s[current_order]", assignment.getId()))));
		}
	});
}
 
Example 12
Source Project: yes-cart   Source File: SkuAttributesSectionView.java    License: Apache License 2.0 6 votes vote down vote up
/**
 *
 * Some times need additional format for value (keyValue.getSecond()).
 *
 */
@Override
protected void onBeforeRender() {

    add(
            new Label(HEAD, headKeyValues.getFirst())
    );

    add(
            new ListView<Pair<String, String>>(KEY_VALUES_LIST, headKeyValues.getSecond()) {
                @Override
                protected void populateItem(ListItem<Pair<String, String>> pairListItem) {
                    final Pair<String, String> keyValue = pairListItem.getModelObject();
                    pairListItem.add(
                            new Label(KEY, keyValue.getFirst())
                    ).add(
                            new Label(VALUE, StringUtils.defaultIfEmpty(keyValue.getSecond(), StringUtils.EMPTY) )
                    );
                }
            }
    );
    super.onBeforeRender();
}
 
Example 13
Source Project: yes-cart   Source File: SkuAttributesView.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onBeforeRender() {

    add(
            new ListView<Pair<String, List<Pair<String, String>>>>(ATTR_GROUPS, attributesToShow) {

                @Override
                protected void populateItem(ListItem<Pair<String, List<Pair<String, String>>>> pairListItem) {
                    final Pair<String, List<Pair<String, String>>> item = pairListItem.getModelObject();
                    pairListItem.add(
                            new SkuAttributesSectionView(ATTR_GROUP, item)
                    );
                }

            }
    );

    super.onBeforeRender();
}
 
Example 14
Source Project: syncope   Source File: PlainAttrs.java    License: Apache License 2.0 6 votes vote down vote up
public PlainSchemasOwn(
        final String id,
        final Map<String, PlainSchemaTO> schemas,
        final IModel<List<Attr>> attrTOs) {

    super(id, schemas, attrTOs);

    add(new ListView<Attr>("schemas", attrTOs) {

        private static final long serialVersionUID = 9101744072914090143L;

        @Override
        protected void populateItem(final ListItem<Attr> item) {
            setPanel(schemas, item, false);
        }
    });
}
 
Example 15
Source Project: yes-cart   Source File: PriceTierView.java    License: Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
protected void onBeforeRender() {

    add(
        new ListView<PriceModel>(PRICE_TIERS_LIST, skuPrices) {
            @Override
            protected void populateItem(ListItem<PriceModel> listItem) {
                listItem.add(
                        new Label(QUANTITY_LABEL, String.valueOf(listItem.getModelObject().getQuantity().intValue()))
                );

                final PriceModel price = listItem.getModel().getObject();
                listItem.add(
                        new PriceView(PRICE_VIEW, price, null, true, false, price.isTaxInfoEnabled(), price.isTaxInfoShowAmount())
                );
            }
        }
    );
    super.onBeforeRender();
}
 
Example 16
Source Project: AppStash   Source File: OrderItemListPanel.java    License: Apache License 2.0 6 votes vote down vote up
private Component orderItemList() {
    return new ListView<OrderItemInfo>("orderItems", new PropertyModel<List<OrderItemInfo>>(getDefaultModel(), "orderItems")) {

        private int orderItemCounter = 1;
       
        @Override
        protected void populateItem(ListItem<OrderItemInfo> orderItem) {
            orderItem.add(new Label("orderItemCounter", Model.of(orderItemCounter++)));
            orderItem.add(new Label("product", new PropertyModel<String>(orderItem.getModel(), "product.name")));
            orderItem.add(new Label("description", new PropertyModel<String>(orderItem.getModel(), "product.description")));
            orderItem.add(new Label("totalSum", new PriceModel(new PropertyModel<>(orderItem.getModel(), "totalSum"))));
        }

        @Override
        protected void onDetach() {
            orderItemCounter = 1;
            super.onDetach();
        }
    };
}
 
Example 17
Source Project: webanno   Source File: TelemetryDetailsPanel.java    License: Apache License 2.0 6 votes vote down vote up
public TelemetryDetailsPanel(String aId, IModel<List<TelemetryDetail>> aModel)
{
    super(aId, aModel);
    
    ListView<TelemetryDetail> details = new ListView<TelemetryDetail>("details") {
        private static final long serialVersionUID = 5156853968330655499L;

        @Override
        protected void populateItem(ListItem<TelemetryDetail> aItem)
        {
            aItem.add(new Label("key", aItem.getModelObject().getKey()));
            aItem.add(new Label("value", aItem.getModelObject().getValue()));
            aItem.add(new Label("description", aItem.getModelObject().getDescription()));
        }
    };
    
    details.setModel(aModel);

    add(details);
}
 
Example 18
Source Project: syncope   Source File: PlainAttrs.java    License: Apache License 2.0 6 votes vote down vote up
public PlainSchemasMemberships(
        final String id,
        final Map<String, PlainSchemaTO> schemas,
        final IModel<Attributable> attributableTO) {

    super(id, schemas, attributableTO);

    add(new ListView<Attr>("schemas", new ListModel<Attr>(attributableTO.getObject().
            getPlainAttrs().stream().sorted(attrComparator).collect(Collectors.toList()))) {

        private static final long serialVersionUID = 5306618783986001008L;

        @Override
        protected void populateItem(final ListItem<Attr> item) {
            setPanel(schemas, item, false);
        }
    });
}
 
Example 19
Source Project: Orienteer   Source File: RangeFilterPanel.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public RangeFilterPanel(String id, IModel<List<T>> model, String filterId, IModel<OProperty> propertyModel,
                        IVisualizer visualizer, IFilterCriteriaManager manager) {
    super(id, model, filterId, propertyModel, visualizer, manager, Model.of(true));
    startComponent = (FormComponent<T>) createFilterComponent(Model.of());
    endComponent = (FormComponent<T>) createFilterComponent(Model.of());
    startComponent.setOutputMarkupId(true);
    endComponent.setOutputMarkupId(true);
    List<Component> rangeContainers = Lists.newArrayList();
    rangeContainers.add(getRangeContainer(startComponent, getFilterId(), true));
    rangeContainers.add(getRangeContainer(endComponent, getFilterId(), false));

    ListView<Component> listView = new ListView<Component>("rangeFilters", rangeContainers) {
        @Override
        protected void populateItem(ListItem<Component> item) {
            item.add(item.getModelObject());
        }
    };
    add(listView);
}
 
Example 20
Source Project: webanno   Source File: ActionBar.java    License: Apache License 2.0 6 votes vote down vote up
public ActionBar(String aId)
{
    super(aId);

    add(new ListView<ActionBarExtension>("items",
            LoadableDetachableModel.of(this::getExtensions))
    {
        private static final long serialVersionUID = -3124915140030491897L;

        @Override
        protected void populateItem(ListItem<ActionBarExtension> aItem)
        {
            aItem.add(aItem.getModelObject().createActionBarItem("item",
                    (AnnotationPageBase) getPage()));
        }
    });
}
 
Example 21
Source Project: webanno   Source File: KeyBindingsConfigurationPanel.java    License: Apache License 2.0 6 votes vote down vote up
private ListView<KeyBinding> createKeyBindingsList(String aId,
        IModel<List<KeyBinding>> aKeyBindings)
{
    return new ListView<KeyBinding>(aId, aKeyBindings)
    {
        private static final long serialVersionUID = 432136316377546825L;

        @Override
        protected void populateItem(ListItem<KeyBinding> aItem)
        {
            AnnotationFeature feature = KeyBindingsConfigurationPanel.this.getModelObject();
            FeatureSupport<?> fs = featureSupportRegistry.getFeatureSupport(feature);

            KeyBinding keyBinding = aItem.getModelObject();

            aItem.add(new Label("keyCombo", keyBinding.asHtml()).setEscapeModelStrings(false));

            aItem.add(
                    new Label("value", fs.renderFeatureValue(feature, keyBinding.getValue())));
            aItem.add(new LambdaAjaxLink("removeKeyBinding",
                _target -> removeKeyBinding(_target, aItem.getModelObject())));
        }
    };
}
 
Example 22
Source Project: webanno   Source File: ProjectCasDoctorPanel.java    License: Apache License 2.0 6 votes vote down vote up
private ListView<LogMessageSet> createMessageSetsView()
{
    return new ListView<LogMessageSet>("messageSets",
            PropertyModel.of(this, "formModel.messageSets"))
    {
        private static final long serialVersionUID = 8957632000765128508L;

        @Override
        protected void populateItem(ListItem<LogMessageSet> aItem)
        {
            IModel<LogMessageSet> set = aItem.getModel();
            aItem.add(new Label("name", PropertyModel.of(set, "name")));
            aItem.add(createMessagesView(set));
        }
    };
}
 
Example 23
Source Project: webanno   Source File: ProjectCasDoctorPanel.java    License: Apache License 2.0 6 votes vote down vote up
private ListView<LogMessage> createMessagesView(IModel<LogMessageSet> aModel)
{
    return new ListView<LogMessage>("messages", PropertyModel.of(aModel, "messages"))
    {
        private static final long serialVersionUID = 8957632000765128508L;

        @Override
        protected void populateItem(ListItem<LogMessage> aItem)
        {
            IModel<LogMessage> msg = aItem.getModel();
            aItem.add(new Label("level", PropertyModel.of(msg, "level")));
            aItem.add(new Label("source", PropertyModel.of(msg, "source")));
            aItem.add(new Label("message", PropertyModel.of(msg, "message")));
        }
    };
}
 
Example 24
@Override
public void onInitialize() {
	super.onInitialize();

	final List<Assignment> assignments = this.businessService.getGradebookAssignments(SortType.SORT_BY_SORTING);

	add(new ListView<Assignment>("gradeItemList", assignments) {
		@Override
		protected void populateItem(final ListItem<Assignment> assignmentItem) {
			final Assignment assignment = assignmentItem.getModelObject();
			assignmentItem.add(new Label("name", assignment.getName()));
			assignmentItem.add(new HiddenField<Long>("id",
					Model.of(assignment.getId())).add(
							new AttributeModifier("name",
									String.format("id", assignment.getId()))));
			assignmentItem.add(new HiddenField<Integer>("order",
					Model.of(assignment.getSortOrder())).add(
							new AttributeModifier("name",
									String.format("item_%s[order]", assignment.getId()))));
			assignmentItem.add(new HiddenField<Integer>("current_order",
					Model.of(assignment.getSortOrder())).add(
							new AttributeModifier("name",
									String.format("item_%s[current_order]", assignment.getId()))));
		}
	});
}
 
Example 25
/**
 * Helper to create a listview for what needs to be shown
 * 
 * @param markupId wicket markup id
 * @param itemList ist of stuff
 * @return
 */
private ListView<ProcessedGradeItem> makeListView(final String markupId, final List<ProcessedGradeItem> itemList) {

	final ListView<ProcessedGradeItem> rval = new ListView<ProcessedGradeItem>(markupId, itemList) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void populateItem(final ListItem<ProcessedGradeItem> item) {

			final ProcessedGradeItem gradeItem = item.getModelObject();

			String displayTitle = gradeItem.getItemTitle();
			if (gradeItem.getType() == Type.COMMENT) {
				displayTitle = MessageHelper.getString("importExport.confirmation.commentsdisplay", gradeItem.getItemTitle());
			}

			item.add(new Label("title", displayTitle));
			item.add(new Label("points", gradeItem.getItemPointValue()));
		}
	};

	return rval;
}
 
Example 26
/**
 * Helper to create a listview for what needs to be shown for new assignments
 * @param markupId wicket markup id
 * @param itemList list of Assignments populated by the item creation steps
 */
private ListView<Assignment> makeAssignmentsToCreateListView(final String markupId, final List<Assignment> itemList) {
	final ListView<Assignment> rval = new ListView<Assignment>(markupId, itemList) {
		@Override
		protected void populateItem(final ListItem<Assignment> item) {
			final Assignment assignment = item.getModelObject();

			String extraCredit = assignment.isExtraCredit() ? yes : no;
			String dueDate = FormatHelper.formatDate(assignment.getDueDate(), "");
			String releaseToStudents = assignment.isReleased() ? yes : no;
			String includeInCourseGrades = assignment.isCounted() ? yes : no;

			item.add(new Label("title", assignment.getName()));
			item.add(new Label("points", assignment.getPoints()));
			item.add(new Label("extraCredit", extraCredit));
			item.add(new Label("dueDate", dueDate));
			item.add(new Label("releaseToStudents", releaseToStudents));
			item.add(new Label("includeInCourseGrades", includeInCourseGrades));
		}
	};

	return rval;
}
 
Example 27
Source Project: ontopia   Source File: StartPage.java    License: Apache License 2.0 6 votes vote down vote up
private void addOtherTopicMapsSection() {
  // Alt. 2 Make a loadabledetachableModel for repository
  IModel<List<TopicMapReference>> eachNonOntopolyTopicMapModel = new LoadableDetachableModel<List<TopicMapReference>>() {
    @Override
    protected List<TopicMapReference> load() {
      OntopolyRepository repository = OntopolyContext.getOntopolyRepository();
      return repository.getNonOntopolyTopicMaps();
    }
  }; 

  ListView<TopicMapReference> eachTopicMap = new ListView<TopicMapReference>("eachNonOntopolyTopicMap", eachNonOntopolyTopicMapModel) {
    @Override
    protected void populateItem(ListItem<TopicMapReference> item) {
      final TopicMapReference ref = item.getModelObject();
      Map<String,String> pageParameterMap = new HashMap<String,String>();
      pageParameterMap.put("topicMapId",ref.getId());
      
      OntopolyBookmarkablePageLink link = new OntopolyBookmarkablePageLink(
          "nonOntTMLink", ConvertPage.class, new PageParameters(pageParameterMap), ref.getName());
      item.add(link);
    }
  };
  add(eachTopicMap);
}
 
Example 28
Source Project: Orienteer   Source File: SchemaPageHeader.java    License: Apache License 2.0 6 votes vote down vote up
public SchemaPageHeader(String id, IModel<OClass> oClassModel) {
	super(id, oClassModel);
	add(new BookmarkablePageLink<Object>("schema", SchemaPage.class)
					.setBody(new ResourceModel("menu.list.schema")));
	
	add(new ListView<OClass>("classes", classPathModel) {

		@Override
		protected void populateItem(ListItem<OClass> item) {
			item.add(new OClassPageLink("link", item.getModel()).setClassNameAsBody(false));
		}
	});
	childRepeatingView = new RepeatingView("child");
	add(childRepeatingView);
	add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALWAYS_FOR_CHANGING);
	add(new DefaultPageHeaderMenu("menu"));
}
 
Example 29
Source Project: syncope   Source File: DerAttrs.java    License: Apache License 2.0 5 votes vote down vote up
public DerSchemas(
        final String id,
        final Map<String, DerSchemaTO> schemas,
        final IModel<List<Attr>> attrTOs) {
    super(id);

    add(new ListView<Attr>("schemas", attrTOs) {

        private static final long serialVersionUID = 9101744072914090143L;

        @Override
        public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
            super.onComponentTagBody(markupStream, openTag);
            openTag.put("class", "empty");
        }

        @Override
        protected void populateItem(final ListItem<Attr> item) {
            Attr attrTO = item.getModelObject();

            IModel<String> model;
            List<String> values = attrTO.getValues();
            if (values == null || values.isEmpty()) {
                model = new ResourceModel("derived.emptyvalue.message", StringUtils.EMPTY);
            } else {
                model = new Model<>(values.get(0));
            }

            AjaxTextFieldPanel panel = new AjaxTextFieldPanel(
                    "panel",
                    schemas.get(attrTO.getSchema()).getLabel(SyncopeEnduserSession.get().getLocale()),
                    model,
                    false);
            panel.setEnabled(false);
            panel.setRequired(true);
            panel.setOutputMarkupId(true);
            item.add(panel);
        }
    });
}
 
Example 30
Source Project: inception   Source File: AccessSpecificSettingsPanel.java    License: Apache License 2.0 5 votes vote down vote up
private void setUpLocalSpecificSettings(WebMarkupContainer wmc)
{
    wmc.add(uploadForm("uploadForm", "uploadField"));

    // add link for clearing the knowledge base contents, enabled only, if there is
    // something to clear
    AjaxLink<Void> clearLink = clearLink("clear");
    wmc.add(clearLink);

    wmc.add(fileExtensionsExportList("exportButtons"));

    List<KnowledgeBaseProfile> localKBs = knowledgeBaseProfiles.values().stream()
        .filter(kb -> RepositoryType.LOCAL.equals(kb.getType()))
        .collect(Collectors.toList());

    listViewContainer = new WebMarkupContainer("listViewContainer");
    ListView<KnowledgeBaseProfile> suggestions = localSuggestionsList("localKBs", localKBs);
    listViewContainer.add(suggestions);
    listViewContainer.setOutputMarkupPlaceholderTag(true);

    LambdaAjaxLink addKbButton = new LambdaAjaxLink("addKbButton",
        this::actionDownloadKbAndSetIRIs);
    addKbButton.add(new Label("addKbLabel", new ResourceModel("kb.wizard.steps.local.addKb")));
    listViewContainer.add(addKbButton);

    infoContainerLocal = createKbInfoContainer("infoContainer");
    infoContainerLocal.setOutputMarkupId(true);
    wmc.add(infoContainerLocal);

    wmc.add(listViewContainer);
}