Skip to content

Commit

Permalink
Merge pull request #4914 from effective-webwork/linked-processes-label
Browse files Browse the repository at this point in the history
Show id and title of linked processes in metadata editor
  • Loading branch information
Kathrin-Huber authored Feb 2, 2022
2 parents 10b99d8 + 4fff8cd commit f4a2c1f
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -508,7 +508,8 @@ private Collection<View> 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);
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f4a2c1f

Please sign in to comment.