public NumericLiteralValuePresenter(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); add(new Label("value")); } }
public NumericLiteralValuePresenter(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); add(new Label("value")); } }
public StringLiteralValuePresenter(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); add(new Label("value")); add(new Label("language") { private static final long serialVersionUID = 3436068825093393740L; @Override protected void onConfigure() { super.onConfigure(); String language = (String) this.getDefaultModelObject(); setVisible(StringUtils.isNotEmpty(language)); } }); } }
public StringLiteralValuePresenter(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); add(new Label("value")); add(new Label("language") { private static final long serialVersionUID = 3436068825093393740L; @Override protected void onConfigure() { super.onConfigure(); String language = (String) this.getDefaultModelObject(); setVisible(StringUtils.isNotEmpty(language)); } }); } }
public NamedEntityLinkerTraitsEditor(String aId, IModel<Recommender> aRecommender) { super(aId, aRecommender); traits = toolFactory.readTraits(aRecommender.getObject()); Form<NamedEntityLinkerTraits> form = new Form<NamedEntityLinkerTraits>(MID_FORM, CompoundPropertyModel.of(Model.of(traits))) { private static final long serialVersionUID = -3109239605742291123L; @Override protected void onSubmit() { super.onSubmit(); toolFactory.writeTraits(aRecommender.getObject(), traits); } }; add(form); } }
public NamedEntityLinkerTraitsEditor(String aId, IModel<Recommender> aRecommender) { super(aId, aRecommender); traits = toolFactory.readTraits(aRecommender.getObject()); Form<NamedEntityLinkerTraits> form = new Form<NamedEntityLinkerTraits>(MID_FORM, CompoundPropertyModel.of(Model.of(traits))) { private static final long serialVersionUID = -3109239605742291123L; @Override protected void onSubmit() { super.onSubmit(); toolFactory.writeTraits(aRecommender.getObject(), traits); } }; add(form); } }
public NumericLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); // Clear the value if it is not an instance of number if (! (aModel.getObject().getValue() instanceof Number)) { aModel.getObject().setValue(0); } value = new NumberTextField<>("value", Double.class); value.setOutputMarkupId(true); value.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> t.add(getParent()))); add(value); }
@Override protected void populateItem(ListItem<AnnotationListItem> aItem) { aItem.setModel(CompoundPropertyModel.of(aItem.getModel())); aItem.add(new Label("type", aItem.getModelObject().layer.getUiName())); LambdaAjaxLink link = new LambdaAjaxLink("annotationLink", _target -> actionSelect(_target, aItem.getModelObject())); link.add(new Label("label")); aItem.add(link); } };
public NumericLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); // Clear the value if it is not an instance of number if (! (aModel.getObject().getValue() instanceof Number)) { aModel.getObject().setValue(0); } value = new NumberTextField<>("value", Double.class); value.setOutputMarkupId(true); value.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> t.add(getParent()))); add(value); }
public ContentPanel(String aId, IModel<State> aModel) { super(aId, aModel); form = new Form<>("form", CompoundPropertyModel.of(aModel)); form.add(new Label("content").setEscapeModelStrings(false)); form.add(new Label("feedback")); form.add(new LambdaAjaxButton<>("confirm", ConfirmationDialog.this::onConfirmInternal)); form.add(new LambdaAjaxLink("cancel", ConfirmationDialog.this::onCancelInternal)); add(form); } }
@Override protected void populateItem(ListItem<AnnotationListItem> aItem) { aItem.setModel(CompoundPropertyModel.of(aItem.getModel())); aItem.add(new Label("type", aItem.getModelObject().layer.getUiName())); LambdaAjaxLink link = new LambdaAjaxLink("annotationLink", _target -> actionSelect(_target, aItem.getModelObject())); link.add(new Label("label")); aItem.add(link); } };
public StringLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); value = new TextArea<>("value"); value.setOutputMarkupId(true); add(value); add(new TextField<>("language")); }
public StringLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); value = new TextArea<>("value"); value.setOutputMarkupId(true); add(value); add(new TextField<>("language")); }
public BooleanLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); value = new CheckBox("value"); value.setOutputMarkupId(true); value.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> t.add(getParent()))); add(value); }
public BooleanLiteralValueEditor(String aId, IModel<KBStatement> aModel) { super(aId, CompoundPropertyModel.of(aModel)); value = new CheckBox("value"); value.setOutputMarkupId(true); value.add(new LambdaAjaxFormComponentUpdatingBehavior("change", t -> t.add(getParent()))); add(value); }
public IRIValuePresenter(String id, IModel<KBStatement> aModel, IModel<KnowledgeBase> aKBModel) { super(id, aModel); kbModel = aKBModel; kbObject = CompoundPropertyModel.of(LoadableDetachableModel.of(this::getKBObject)); add(new IriInfoBadge("iriInfoBadge", LoadableDetachableModel .of(() -> ((IRI) getModelObject().getValue()).stringValue()))); LambdaAjaxLink link = new LambdaAjaxLink("link", t -> actionIRILinkClicked(t, kbObject.getObject())); link.add(new Label("label", LoadableDetachableModel.of(() -> getLabel(kbObject.getObject())))); add(link); }
public IRIValuePresenter(String id, IModel<KBStatement> aModel, IModel<KnowledgeBase> aKBModel) { super(id, aModel); kbModel = aKBModel; kbObject = CompoundPropertyModel.of(LoadableDetachableModel.of(this::getKBObject)); add(new IriInfoBadge("iriInfoBadge", LoadableDetachableModel .of(() -> ((IRI) getModelObject().getValue()).stringValue()))); LambdaAjaxLink link = new LambdaAjaxLink("link", t -> actionIRILinkClicked(t, kbObject.getObject())); link.add(new Label("label", LoadableDetachableModel.of(() -> getLabel(kbObject.getObject())))); add(link); }
public TagSetImportPanel(String aId, IModel<Project> aModel, IModel<TagSet> aTagSet) { super(aId); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); preferences = Model.of(new Preferences()); selectedProject = aModel; selectedTagSet = aTagSet; Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences)); form.add(new BootstrapSelect<>("format", LambdaModel.of(this::supportedFormats)) .setRequired(true)); form.add(new CheckBox("overwrite")); form.add(fileUpload = new FileUploadField("content", new ListModel<>())); fileUpload.setRequired(true); form.add(new LambdaAjaxButton<>("import", this::actionImport)); add(form); }
public TagSetImportPanel(String aId, IModel<Project> aModel, IModel<TagSet> aTagSet) { super(aId); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); preferences = Model.of(new Preferences()); selectedProject = aModel; selectedTagSet = aTagSet; Form<Preferences> form = new Form<>("form", CompoundPropertyModel.of(preferences)); form.add(new BootstrapSelect<>("format", LambdaModel.of(this::supportedFormats)) .setRequired(true)); form.add(new CheckBox("overwrite")); form.add(fileUpload = new FileUploadField("content", new ListModel<>())); fileUpload.setRequired(true); form.add(new LambdaAjaxButton<>("import", this::actionImport)); add(form); }
public TagEditorPanel(String aId, IModel<TagSet> aTagSet, IModel<Tag> aTag) { super(aId, aTag); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); selectedTagSet = aTagSet; selectedTag = aTag; Form<Tag> form = new Form<>("form", CompoundPropertyModel.of(aTag)); add(form); form.add(new TextField<String>("name") .add(new TagExistsValidator()) .setRequired(true)); form.add(new TextArea<String>("description")); form.add(new LambdaAjaxButton<>("save", this::actionSave)); form.add(new LambdaAjaxLink("delete", this::actionDelete) .onConfigure(_this -> _this.setVisible(form.getModelObject().getId() != null))); form.add(new LambdaAjaxLink("cancel", this::actionCancel)); }