protected void onImportComplete(AjaxRequestTarget aTarget) throws Exception { if (importCompleteAction != null) { importCompleteAction.accept(aTarget); } }
private AjaxLink<Void> clearLink(String aId) { AjaxLink<Void> clearLink = new LambdaAjaxLink(aId, this::actionClear) { private static final long serialVersionUID = -6272361381689154558L; @Override public boolean isEnabled() { return !kbService.isEmpty(kbModel.getObject().getKb()); } }; return clearLink; }
@Override public void onAfterSubmit() { if (triggerAfterSubmit) { action(); } }
public TagSetSelectionPanel(String id, IModel<Project> aProject, IModel<TagSet> aTagset) { super(id, aProject); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); selectedProject = aProject; overviewList = new OverviewListChoice<>("tagset"); overviewList.setChoiceRenderer(new ChoiceRenderer<>("name")); overviewList.setModel(aTagset); overviewList.setChoices(LambdaModel.of(this::listTagSets)); overviewList.add(new LambdaAjaxFormComponentUpdatingBehavior("change", this::onChange)); add(overviewList); add(new LambdaAjaxLink("create", this::actionCreate)); }
public ButtonsForm(String id, final ModalWindow modalWindow) { super(id); add(new LambdaAjaxLink("openButton", OpenDocumentDialogPanel.this::actionOpenDocument) .add(enabledWhen(() -> selectedDocument != null))); add(new LambdaAjaxLink("cancelButton", OpenDocumentDialogPanel.this::actionCancel)); } }
/** * Adds behaviors to the embedded link, e.g. to add hot keys. */ @Override public Component add(Behavior... aBehaviors) { link.add(aBehaviors); return this; }
public static <T extends Serializable> LambdaModelAdapter<T> of( SerializableSupplier<T> aSupplier, SerializableConsumer<T> aConsumer) { return new LambdaModelAdapter<T>(aSupplier, aConsumer); }
@Override public void onDetach(RequestCycle aCycle) { LambdaModel.this.detach(); } });
@Override protected void onConfigure() { super.onConfigure(); if (onConfigureAction != null) { onConfigureAction.run(this); } } }
public TagSelectionPanel(String id, IModel<TagSet> aTagset, IModel<Tag> aTag) { super(id, aTagset); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); selectedTagSet = aTagset; overviewList = new OverviewListChoice<>("tag"); overviewList.setChoiceRenderer(new ChoiceRenderer<>("name")); overviewList.setModel(aTag); overviewList.setChoices(LambdaModel.of(this::listTags)); overviewList.add(new LambdaAjaxFormComponentUpdatingBehavior("change", this::onChange)); add(overviewList); add(new LambdaAjaxLink("create", this::actionCreate)); }
private AjaxLink<Void> clearLink(String aId) { AjaxLink<Void> clearLink = new LambdaAjaxLink(aId, this::actionClear) { private static final long serialVersionUID = -6272361381689154558L; @Override public boolean isEnabled() { return !kbService.isEmpty(kbModel.getObject().getKb()); } }; return clearLink; }
protected void onChange(AjaxRequestTarget aTarget) throws Exception { if (changeAction != null) { changeAction.accept(aTarget); } }
public LambdaModelAdapter<T> build() { return new LambdaModelAdapter<T>(supplier, consumer); } }
@Override public void onSubmit() { if (!triggerAfterSubmit) { action(); } }
public TagSelectionPanel(String id, IModel<TagSet> aTagset, IModel<Tag> aTag) { super(id, aTagset); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); selectedTagSet = aTagset; overviewList = new OverviewListChoice<>("tag"); overviewList.setChoiceRenderer(new ChoiceRenderer<>("name")); overviewList.setModel(aTag); overviewList.setChoices(LambdaModel.of(this::listTags)); overviewList.add(new LambdaAjaxFormComponentUpdatingBehavior("change", this::onChange)); add(overviewList); add(new LambdaAjaxLink("create", this::actionCreate)); }
private LambdaAjaxLink createRemoveLabelIcon() { return new LambdaAjaxLink("removeLabel", this::removeSelectedLabel); }
protected void onCreate(AjaxRequestTarget aTarget) throws Exception { if (createAction != null) { createAction.accept(aTarget); } }
public TagSetSelectionPanel(String id, IModel<Project> aProject, IModel<TagSet> aTagset) { super(id, aProject); setOutputMarkupId(true); setOutputMarkupPlaceholderTag(true); selectedProject = aProject; overviewList = new OverviewListChoice<>("tagset"); overviewList.setChoiceRenderer(new ChoiceRenderer<>("name")); overviewList.setModel(aTagset); overviewList.setChoices(LambdaModel.of(this::listTagSets)); overviewList.add(new LambdaAjaxFormComponentUpdatingBehavior("change", this::onChange)); add(overviewList); add(new LambdaAjaxLink("create", this::actionCreate)); }
private LambdaAjaxLink createRemoveLabelIcon() { return new LambdaAjaxLink("removeLabel", this::removeSelectedLabel); }
protected void onImportComplete(AjaxRequestTarget aTarget) throws Exception { if (importCompleteAction != null) { importCompleteAction.accept(aTarget); } }