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();
}
}
}
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());
}
Aggregations