Commit dcc33ebe authored by yannick legoc's avatar yannick legoc
Browse files

Adding * in the tree item for components with duplicated names

parent 8b20a521
......@@ -362,11 +362,12 @@ public class Nomad3DEditor extends Application {
n3dImporter.read();
}
//n3dImporter.readEdition();
if (n3dImporter.getModel().getRoot() != null) {
model = n3dImporter.getModel();
// Check the component name duplication.
model.checkComponentNameDuplication();
// Reset the list of reference axes.
ReferenceAxisList.getInstance().init(model);
......
......@@ -81,23 +81,27 @@ public class HierarchyCell extends CheckBoxTreeCell<Component> {
}
@Override
public void updateItem(Component item, boolean empty) {
super.updateItem(item, empty);
public void updateItem(Component component, boolean empty) {
super.updateItem(component, empty);
if (empty || isEditing()) {
return;
} else {
String text = item.getName();
String text = component.getName();
if (item.getAxis().getController() != null) {
text += " (" + item.getAxis().getController().getName() + ")";
if (component.hasDuplicateName()) {
text += "*";
}
if (component.getAxis().getController() != null) {
text += " (" + component.getAxis().getController().getName() + ")";
}
setText(text);
setContextMenu(rigthClickMenu);
tooltip.setText(item.getName());
tooltip.setText(component.getName());
setTooltip(tooltip);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment