Search in sources :

Example 71 with TagDefinition

use of de.catma.tag.TagDefinition in project catma by forTEXT.

the class AnnotationPanel method handleTagSelection.

private void handleTagSelection(ItemClick<TagsetTreeItem> clickEvent, Consumer<TagDefinition> tagSelectionListener) {
    TagsetTreeItem selectedItem = clickEvent.getItem();
    if (selectedItem instanceof TagDataItem) {
        if (getSelectedEditableCollection() != null) {
            TagDefinition tag = ((TagDataItem) selectedItem).getTag();
            tagSelectionListener.accept(tag);
        } else {
            highlightCurrentEditableCollectionBox();
        }
    }
}
Also used : TagDefinition(de.catma.tag.TagDefinition)

Example 72 with TagDefinition

use of de.catma.tag.TagDefinition in project catma by forTEXT.

the class AnnotationConflictView method initData.

private void initData() {
    documentNameField.setReadOnly(false);
    documentNameField.setValue(kwicProvider.getSourceDocumentName());
    documentNameField.setReadOnly(true);
    collectionNameField.setReadOnly(false);
    collectionNameField.setValue(this.collectionConflict.getContentInfoSet().getTitle());
    collectionNameField.setReadOnly(true);
    TagInstance devTagInstance = this.annotationConflict.getDevTagInstance();
    TagInstance masterTagInstance = this.annotationConflict.getMasterTagInstance();
    TagDefinition tag = null;
    if (devTagInstance != null) {
        tag = tagManager.getTagLibrary().getTagDefinition(devTagInstance.getTagDefinitionId());
        String tagPath = tagManager.getTagLibrary().getTagPath(tag);
        String annotatedKwicText = AnnotatedTextProvider.buildAnnotatedKeywordInContext(this.annotationConflict.getDevTagReferences(), kwicProvider, tag, tagPath);
        annotatedKwic.setValue(annotatedKwicText);
    } else if (masterTagInstance != null) {
        tag = tagManager.getTagLibrary().getTagDefinition(masterTagInstance.getTagDefinitionId());
        String tagPath = tagManager.getTagLibrary().getTagPath(tag);
        String annotatedKwicText = AnnotatedTextProvider.buildAnnotatedKeywordInContext(this.annotationConflict.getMasterTagReferences(), kwicProvider, tag, tagPath);
        annotatedKwic.setValue(annotatedKwicText);
    }
    if (devTagInstance != null) {
        TreeDataProvider<PropertyTreeItem> leftPropertyTreeDataProvider = createPropertyTreeDataProvider(devTagInstance, tag);
        leftPropertyGrid.setDataProvider(leftPropertyTreeDataProvider);
        leftPropertyGrid.expandRecursively(leftPropertyTreeDataProvider.getTreeData().getRootItems(), 1);
    } else {
        leftPropertyGrid.setVisible(false);
        leftIsDeletedLabel.setVisible(true);
    }
    if (masterTagInstance != null) {
        TreeDataProvider<PropertyTreeItem> rightPropertyTreeDataProvider = createPropertyTreeDataProvider(masterTagInstance, tag);
        rightPropertyGrid.setDataProvider(rightPropertyTreeDataProvider);
        rightPropertyGrid.expandRecursively(rightPropertyTreeDataProvider.getTreeData().getRootItems(), 1);
    } else {
        rightPropertyGrid.setVisible(false);
        rightIsDeletedLabel.setVisible(true);
    }
    btBoth.setEnabled(annotationConflict.isBothPossible());
}
Also used : TagDefinition(de.catma.tag.TagDefinition) TagInstance(de.catma.tag.TagInstance)

Aggregations

TagDefinition (de.catma.tag.TagDefinition)72 ArrayList (java.util.ArrayList)31 PropertyDefinition (de.catma.tag.PropertyDefinition)28 TagsetDefinition (de.catma.tag.TagsetDefinition)28 List (java.util.List)23 IDGenerator (de.catma.util.IDGenerator)22 Pair (de.catma.util.Pair)22 UI (com.vaadin.ui.UI)19 Project (de.catma.project.Project)19 ErrorHandler (de.catma.ui.module.main.ErrorHandler)19 PropertyChangeEvent (java.beans.PropertyChangeEvent)19 PropertyChangeListener (java.beans.PropertyChangeListener)19 IOException (java.io.IOException)19 Collection (java.util.Collection)19 Collectors (java.util.stream.Collectors)19 Notification (com.vaadin.ui.Notification)17 Type (com.vaadin.ui.Notification.Type)17 Set (java.util.Set)17 TagManagerEvent (de.catma.tag.TagManager.TagManagerEvent)16 SaveCancelListener (de.catma.ui.dialog.SaveCancelListener)16