use of de.catma.tag.Property in project catma by forTEXT.
the class AnnotationDetailsPanel method handleEditAnnotationRequest.
private void handleEditAnnotationRequest(RendererClickEvent<AnnotationTreeItem> clickEvent) {
AnnotationDataItem item = (AnnotationDataItem) clickEvent.getItem();
final Annotation annotation = item.getAnnotation();
if (project.hasPermission(project.getRoleForCollection(annotation.getUserMarkupCollection().getUuid()), RBACPermission.COLLECTION_WRITE)) {
String tagId = annotation.getTagInstance().getTagDefinitionId();
TagDefinition tag = project.getTagManager().getTagLibrary().getTagDefinition(tagId);
if (tag.getUserDefinedPropertyDefinitions().isEmpty()) {
Notification.show("Info", "There are no Properties defined for the Tag of this Annotation!", Type.HUMANIZED_MESSAGE);
} else {
EditAnnotationPropertiesDialog editAnnotationPropertiesDialog = new EditAnnotationPropertiesDialog(project, annotation, new SaveCancelListener<List<Property>>() {
@Override
public void savePressed(List<Property> result) {
try {
collectionManager.updateProperty(annotation.getUserMarkupCollection(), annotation.getTagInstance(), result);
} catch (IOException e) {
((ErrorHandler) UI.getCurrent()).showAndLogError("error updating Annotation Properties", e);
}
}
});
editAnnotationPropertiesDialog.show();
}
} else {
Notification.show("Info", "You do not have the permission to make changes to the Collection of this Annotation, " + "please contact the Project maintainer!", Type.HUMANIZED_MESSAGE);
}
}
use of de.catma.tag.Property in project catma by forTEXT.
the class AnnotationConflictView method initComponents.
private void initComponents() {
setMargin(true);
setSpacing(true);
setSizeFull();
HorizontalLayout resourceInfoPanel = new HorizontalLayout();
resourceInfoPanel.setWidth("100%");
addComponent(resourceInfoPanel);
this.documentNameField = new TextField("Document");
this.documentNameField.setReadOnly(true);
this.documentNameField.setWidth("100%");
this.documentNameField.addStyleName("annotation-conflict-view-resource-field");
resourceInfoPanel.addComponent(documentNameField);
this.collectionNameField = new TextField("Collection");
this.collectionNameField.setReadOnly(true);
this.collectionNameField.setWidth("100%");
this.collectionNameField.addStyleName("annotation-conflict-view-resource-field");
resourceInfoPanel.addComponent(collectionNameField);
this.annotatedKwic = new Label();
this.annotatedKwic.setWidth("100%");
this.annotatedKwic.setContentMode(ContentMode.HTML);
addComponent(this.annotatedKwic);
HorizontalLayout comparisonPanel = new HorizontalLayout();
comparisonPanel.setSizeFull();
leftPropertyGrid = TreeGridFactory.createDefaultTreeGrid();
leftPropertyGrid.setSizeFull();
leftPropertyGrid.addStyleNames("flat-undecorated-icon-buttonrenderer");
leftPropertyGrid.addColumn(propertyTreeItem -> propertyTreeItem.getName()).setCaption("Property");
leftPropertyGrid.addColumn(propertyTreeItem -> propertyTreeItem.getValue()).setCaption("Value");
comparisonPanel.addComponent(leftPropertyGrid);
leftIsDeletedLabel = new Label("My Annotation is DELETED.");
leftIsDeletedLabel.setVisible(false);
comparisonPanel.addComponent(leftIsDeletedLabel);
rightPropertyGrid = TreeGridFactory.createDefaultTreeGrid();
rightPropertyGrid.setSizeFull();
rightPropertyGrid.addStyleNames("flat-undecorated-icon-buttonrenderer");
rightPropertyGrid.addColumn(propertyTreeItem -> propertyTreeItem.getName()).setCaption("Property");
rightPropertyGrid.addColumn(propertyTreeItem -> propertyTreeItem.getValue()).setCaption("Value");
comparisonPanel.addComponent(rightPropertyGrid);
rightIsDeletedLabel = new Label("Their Annotation is DELETED.");
rightIsDeletedLabel.setVisible(false);
comparisonPanel.addComponent(rightIsDeletedLabel);
addComponent(comparisonPanel);
setExpandRatio(comparisonPanel, 1f);
HorizontalLayout buttonPanel = new HorizontalLayout();
buttonPanel.setWidth("100%");
btMine = new Button("Take mine");
buttonPanel.addComponent(btMine);
buttonPanel.setComponentAlignment(btMine, Alignment.BOTTOM_CENTER);
btBoth = new Button("Take both");
buttonPanel.addComponent(btBoth);
buttonPanel.setComponentAlignment(btBoth, Alignment.BOTTOM_CENTER);
btTheirs = new Button("Take theirs");
buttonPanel.addComponent(btTheirs);
buttonPanel.setComponentAlignment(btTheirs, Alignment.BOTTOM_CENTER);
addComponent(buttonPanel);
}
Aggregations