Search in sources :

Example 1 with AnnotationPageBase

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase in project webanno by webanno.

the class AutoOpenDialogBehavior method respond.

@Override
protected void respond(AjaxRequestTarget aTarget) {
    AnnotationPageBase page = (AnnotationPageBase) getComponent().getPage();
    // trying to open it.
    if (page.getModelObject().getDocument() != null) {
        return;
    }
    page.getModelObject().getSelection().clear();
    page.getFooterItems().getObject().stream().filter(component -> component instanceof OpenDocumentDialog).map(component -> (OpenDocumentDialog) component).findFirst().ifPresent(dialog -> dialog.show(aTarget));
}
Also used : OpenDocumentDialog(de.tudarmstadt.ukp.clarin.webanno.api.annotation.actionbar.open.OpenDocumentDialog) AnnotationPageBase(de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase) Component(org.apache.wicket.Component) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AbstractDefaultAjaxBehavior(org.apache.wicket.ajax.AbstractDefaultAjaxBehavior) OnLoadHeaderItem(org.apache.wicket.markup.head.OnLoadHeaderItem) IHeaderResponse(org.apache.wicket.markup.head.IHeaderResponse) OpenDocumentDialog(de.tudarmstadt.ukp.clarin.webanno.api.annotation.actionbar.open.OpenDocumentDialog) AnnotationPageBase(de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase)

Aggregations

OpenDocumentDialog (de.tudarmstadt.ukp.clarin.webanno.api.annotation.actionbar.open.OpenDocumentDialog)1 AnnotationPageBase (de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase)1 Component (org.apache.wicket.Component)1 AbstractDefaultAjaxBehavior (org.apache.wicket.ajax.AbstractDefaultAjaxBehavior)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 IHeaderResponse (org.apache.wicket.markup.head.IHeaderResponse)1 OnLoadHeaderItem (org.apache.wicket.markup.head.OnLoadHeaderItem)1