use of com.intellij.openapi.graph.view.NodeLabel in project intellij-plugins by JetBrains.
the class StrutsDataModel method addNode.
private void addNode(final BasicStrutsNode node) {
if (!node.getIdentifyingElement().isValid()) {
return;
}
myNodes.add(node);
if (isGroupElements()) {
final XmlElement element = node.getIdentifyingElement().getXmlElement();
assert element != null;
final PsiFile file = element.getContainingFile();
if (file != null && !myGroups.containsKey(file)) {
final String name = file.getName();
final BasicNodesGroup group = new BasicNodesGroup(name) {
@Nullable
public GroupNodeRealizer getGroupNodeRealizer() {
final GroupNodeRealizer groupNodeRealizer = super.getGroupNodeRealizer();
assert groupNodeRealizer != null;
final NodeLabel nodeLabel = groupNodeRealizer.getLabel();
nodeLabel.setText(" " + getGroupName());
nodeLabel.setModel(NodeLabel.INTERNAL);
nodeLabel.setPosition(NodeLabel.TOP_RIGHT);
return groupNodeRealizer;
}
};
// collapse all other files
group.setClosed(file != myFile);
myGroups.put(file, group);
}
}
}
Aggregations