diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java index c2ed239c579..bca406408a5 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/StructurePanel.java @@ -147,7 +147,7 @@ public void clear() { } void deleteSelectedStructure() { - if (!getSelectedStructure().isPresent()) { + if (getSelectedStructure().isEmpty()) { /* * No element is selected or the selected element is not a structure * but, for example, a physical division. @@ -508,7 +508,8 @@ private Collection buildStructureTreeRecursively(LogicalDivision structure .processIdFromUri(structure.getLink().getUri())) { StructuralElementViewInterface view = dataEditor.getRulesetManagement().getStructuralElementView( type, dataEditor.getAcquisitionStage(), dataEditor.getPriorityList()); - node = new StructureTreeNode(view.getLabel(), view.isUndefined(), true, structure); + node = new StructureTreeNode("[" + child.getId() + "] " + view.getLabel() + " - " + + child.getTitle(), view.isUndefined(), true, structure); } } catch (DataException e) { Helper.setErrorMessage("metadataReadError", e.getMessage(), logger, e); @@ -611,23 +612,20 @@ private String buildViewLabel(View view) { * Adds a tree node to the given parent node. The tree node is set to * ‘expanded’. * + * @param parentProcess + * parent process of current process * @param type * the internal name of the type of node, to be resolved through * the rule set - * @param linked - * whether the node is a link. If so, it will be marked with a - * link symbol. - * @param dataObject - * the internal object represented by the node * @param parent * parent node to which the new node is to be added * @return the generated node so that you can add children to it */ - private DefaultTreeNode addTreeNode(String type, boolean linked, Object dataObject, DefaultTreeNode parent) { + private DefaultTreeNode addTreeNode(Process parentProcess, String type, DefaultTreeNode parent) { StructuralElementViewInterface structuralElementView = dataEditor.getRulesetManagement().getStructuralElementView(type, dataEditor.getAcquisitionStage(), dataEditor.getPriorityList()); - return addTreeNode(structuralElementView.getLabel(), structuralElementView.isUndefined(), linked, dataObject, - parent); + return addTreeNode("[" + parentProcess.getId() + "] " + structuralElementView.getLabel() + " - " + + parentProcess.getTitle(), structuralElementView.isUndefined(), true, null, parent); } /** @@ -704,7 +702,7 @@ private void addParentLinksRecursive(Process child, DefaultTreeNode tree) { if (Objects.isNull(logicalDivision.getType())) { break; } else { - parentNode = addTreeNode(logicalDivision.getType(), true, null, parentNode); + parentNode = addTreeNode(parent, logicalDivision.getType(), parentNode); parentNode.setExpanded(true); } } @@ -1258,7 +1256,7 @@ void moveViews(LogicalDivision toElement, } } - private void checkLogicalDragDrop(StructureTreeNode dragNode, StructureTreeNode dropNode) throws Exception { + private void checkLogicalDragDrop(StructureTreeNode dragNode, StructureTreeNode dropNode) { LogicalDivision dragStructure = (LogicalDivision) dragNode.getDataObject(); LogicalDivision dropStructure = (LogicalDivision) dropNode.getDataObject();