public ImportDocumentsPanel(String aId, IModel<Project> aProject) { super(aId); projectModel = aProject; Form<Void> form = new Form<>("form"); add(form); format = Model.of(); List<String> readableFormats = listReadableFormats(); if (!readableFormats.isEmpty()) { if (readableFormats.contains("Plain text")) { format.setObject("Plain text"); } else { format.setObject(readableFormats.get(0)); } } form.add(fileUpload = new FileUploadField("documents")); DropDownChoice<String> formats = new BootstrapSelect<>("format"); formats.setModel(format); formats.setChoices(LambdaModel.of(this::listReadableFormats)); form.add(formats); form.add(new LambdaAjaxButton<>("import", this::actionImport)); }
public UimaStringTraitsEditor(String aId, IModel<AnnotationFeature> aFeature) { super(aId); DropDownChoice<TagSet> tagset = new BootstrapSelect<>("tagset"); tagset.setOutputMarkupPlaceholderTag(true); tagset.setOutputMarkupId(true); tagset.setChoiceRenderer(new ChoiceRenderer<>("name")); tagset.setNullValid(true); tagset.setModel(PropertyModel.of(aFeature, "tagset")); tagset.setChoices(LoadableDetachableModel.of(() -> annotationService .listTagSets(aFeature.getObject().getProject()))); add(tagset); } }
public ImportDocumentsPanel(String aId, IModel<Project> aProject) { super(aId); projectModel = aProject; Form<Void> form = new Form<>("form"); add(form); format = Model.of(); List<String> readableFormats = listReadableFormats(); if (!readableFormats.isEmpty()) { if (readableFormats.contains("Plain text")) { format.setObject("Plain text"); } else { format.setObject(readableFormats.get(0)); } } form.add(fileUpload = new FileUploadField("documents")); DropDownChoice<String> formats = new BootstrapSelect<>("format"); formats.setModel(format); formats.setChoices(LambdaModel.of(this::listReadableFormats)); form.add(formats); form.add(new LambdaAjaxButton<>("import", this::actionImport)); }
dd.setChoiceRenderer( new EnumChoiceRenderer(DynamicDimensionsTabPanel.this)); dd.setModel( (IModel<DefaultValuePolicy>) property.getModel(itemModel)); f.add(dd);
public UimaStringTraitsEditor(String aId, IModel<AnnotationFeature> aFeature) { super(aId); DropDownChoice<TagSet> tagset = new BootstrapSelect<>("tagset"); tagset.setOutputMarkupPlaceholderTag(true); tagset.setOutputMarkupId(true); tagset.setChoiceRenderer(new ChoiceRenderer<>("name")); tagset.setNullValid(true); tagset.setModel(PropertyModel.of(aFeature, "tagset")); tagset.setChoices(LoadableDetachableModel.of(() -> annotationService .listTagSets(aFeature.getObject().getProject()))); add(tagset); } }
layerColor.setModel(Model.of(prefs.colorPerLayer.get(layer.getId()))); layerColor.setChoiceRenderer(new ChoiceRenderer<>("descriptiveName")); layerColor.setChoices(asList(ColoringStrategyType.values()));
valueType.setModel(Model.of( valueTypeRegistry.getValueType(aStatement.getObject(), property.getObject())));
valueType.setModel(Model.of( valueTypeRegistry.getValueType(aStatement.getObject(), property.getObject())));
logLevel.setModel(Model.of(LogAccess.get().getLogLevel())); logLevel.add(new AjaxFormComponentUpdatingBehavior("onchange") {
tagset.setChoiceRenderer(new ChoiceRenderer<>("name")); tagset.setNullValid(true); tagset.setModel(PropertyModel.of(aFeatureModel, "tagset")); tagset.setChoices(LambdaModel.of(() -> annotationService .listTagSets(aFeatureModel.getObject().getProject())));
public DocumentMetadataAnnotationSelectionPanel(String aId, IModel<Project> aProject, IModel<SourceDocument> aDocument, IModel<String> aUsername, JCasProvider aJCasProvider, DocumentMetadataAnnotationDetailPanel aDetails, AnnotationPage aAnnotationPage) { super(aId, aProject); setOutputMarkupPlaceholderTag(true); annotationPage = aAnnotationPage; sourceDocument = aDocument; username = aUsername; jcasProvider = aJCasProvider; detailPanel = aDetails; selectedLayer = Model.of(); add(createAnnotationList()); DropDownChoice<AnnotationLayer> layer = new BootstrapSelect<>("layer"); layer.setModel(selectedLayer); layer.setChoices(this::listMetadataLayers); layer.setChoiceRenderer(new ChoiceRenderer<>("uiName")); layer.add(new LambdaAjaxFormComponentUpdatingBehavior("change")); add(layer); add(new LambdaAjaxLink("create", this::actionCreate)); }
public NewStatementGroupFragment(String aId) { super(aId, "newStatementGroup", StatementGroupPanel.this, groupModel); IModel<KBHandle> property = Model.of(); Form<KBHandle> form = new Form<>("form", property); DropDownChoice<KBHandle> type = new BootstrapSelect<>("property"); type.setModel(property); type.setChoiceRenderer(new ChoiceRenderer<>("uiLabel")); type.setChoices(getUnusedProperties()); type.setRequired(true); type.setOutputMarkupId(true); form.add(type); focusComponent = type; form.add(new LambdaAjaxButton<>("create", this::actionNewProperty)); form.add(new LambdaAjaxLink("cancel", this::actionCancelNewProperty)); add(form); }
tagset.setChoiceRenderer(new ChoiceRenderer<>("name")); tagset.setNullValid(true); tagset.setModel(PropertyModel.of(aFeatureModel, "tagset")); tagset.setChoices(LambdaModel.of(() -> annotationService .listTagSets(aFeatureModel.getObject().getProject())));
public DocumentMetadataAnnotationSelectionPanel(String aId, IModel<Project> aProject, IModel<SourceDocument> aDocument, IModel<String> aUsername, JCasProvider aJCasProvider, DocumentMetadataAnnotationDetailPanel aDetails, AnnotationPage aAnnotationPage) { super(aId, aProject); setOutputMarkupPlaceholderTag(true); annotationPage = aAnnotationPage; sourceDocument = aDocument; username = aUsername; jcasProvider = aJCasProvider; detailPanel = aDetails; selectedLayer = Model.of(); add(createAnnotationList()); DropDownChoice<AnnotationLayer> layer = new BootstrapSelect<>("layer"); layer.setModel(selectedLayer); layer.setChoices(this::listMetadataLayers); layer.setChoiceRenderer(new ChoiceRenderer<>("uiName")); layer.add(new LambdaAjaxFormComponentUpdatingBehavior("change")); add(layer); add(new LambdaAjaxLink("create", this::actionCreate)); }
public NewStatementGroupFragment(String aId) { super(aId, "newStatementGroup", StatementGroupPanel.this, groupModel); IModel<KBHandle> property = Model.of(); Form<KBHandle> form = new Form<>("form", property); DropDownChoice<KBHandle> type = new BootstrapSelect<>("property"); type.setModel(property); type.setChoiceRenderer(new ChoiceRenderer<>("uiLabel")); type.setChoices(getUnusedProperties()); type.setRequired(true); type.setOutputMarkupId(true); form.add(type); focusComponent = type; form.add(new LambdaAjaxButton<>("create", this::actionNewProperty)); form.add(new LambdaAjaxLink("cancel", this::actionCancelNewProperty)); add(form); }
t.addChildren(getPage(), IFeedback.class); })); ddc.setModel(aKbModel); ddc.setChoiceRenderer(new ChoiceRenderer<>("name")); add(ddc);
t.addChildren(getPage(), IFeedback.class); })); ddc.setModel(aKbModel); ddc.setChoiceRenderer(new ChoiceRenderer<>("name")); add(ddc);
private Form<Void> createSessionControlForm() { Form<Void> form = new Form<>(CID_SESSION_CONTROL_FORM); DropDownChoice<AnnotationLayer> layersDropdown = new BootstrapSelect<>(CID_SELECT_LAYER); layersDropdown.setModel(alStateModel.bind("layer")); layersDropdown.setChoices(LoadableDetachableModel.of(this::listLayersWithRecommenders)); layersDropdown.setChoiceRenderer(new LambdaChoiceRenderer<>(AnnotationLayer::getUiName)); layersDropdown.add(LambdaBehavior.onConfigure(it -> it.setEnabled(!alStateModel .getObject().isSessionActive()))); layersDropdown.setOutputMarkupId(true); layersDropdown.setRequired(true); form.add(layersDropdown); form.add(new LambdaAjaxSubmitLink(CID_START_SESSION_BUTTON, this::actionStartSession) .add(visibleWhen(() -> !alStateModel.getObject().isSessionActive()))); form.add(new LambdaAjaxLink(CID_STOP_SESSION_BUTTON, this::actionStopSession) .add(visibleWhen(() -> alStateModel.getObject().isSessionActive()))); form.add(visibleWhen(() -> alStateModel.getObject().isDoExistRecommenders())); return form; }
private Form<Void> createSessionControlForm() { Form<Void> form = new Form<>(CID_SESSION_CONTROL_FORM); DropDownChoice<AnnotationLayer> layersDropdown = new BootstrapSelect<>(CID_SELECT_LAYER); layersDropdown.setModel(alStateModel.bind("layer")); layersDropdown.setChoices(LoadableDetachableModel.of(this::listLayersWithRecommenders)); layersDropdown.setChoiceRenderer(new LambdaChoiceRenderer<>(AnnotationLayer::getUiName)); layersDropdown.add(LambdaBehavior.onConfigure(it -> it.setEnabled(!alStateModel .getObject().isSessionActive()))); layersDropdown.setOutputMarkupId(true); layersDropdown.setRequired(true); form.add(layersDropdown); form.add(new LambdaAjaxSubmitLink(CID_START_SESSION_BUTTON, this::actionStartSession) .add(visibleWhen(() -> !alStateModel.getObject().isSessionActive()))); form.add(new LambdaAjaxLink(CID_STOP_SESSION_BUTTON, this::actionStopSession) .add(visibleWhen(() -> alStateModel.getObject().isSessionActive()))); form.add(visibleWhen(() -> alStateModel.getObject().isDoExistRecommenders())); return form; }
featureType.setNullValid(false); featureType.setChoiceRenderer(new ChoiceRenderer<>("uiName")); featureType.setModel(LambdaModelAdapter.of( () -> featureSupportRegistry.getFeatureType(getModelObject()), (v) -> getModelObject().setType(v.getName())));