use of javax.swing.tree.DefaultTreeModel in project intellij-community by JetBrains.
the class PyCharmEduInitialConfigurator method patchMainMenu.
private static void patchMainMenu() {
final CustomActionsSchema schema = new CustomActionsSchema();
final JTree actionsTree = new Tree();
Group rootGroup = new Group("root", null, null);
final DefaultMutableTreeNode root = new DefaultMutableTreeNode(rootGroup);
DefaultTreeModel model = new DefaultTreeModel(root);
actionsTree.setModel(model);
schema.fillActionGroups(root);
for (int i = 0; i < root.getChildCount(); i++) {
final DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) root.getChildAt(i);
if ("Main menu".equals(getItemId(treeNode))) {
hideActionFromMainMenu(root, schema, treeNode);
}
hideActions(schema, root, treeNode, HIDDEN_ACTIONS);
}
CustomActionsSchema.getInstance().copyFrom(schema);
}
use of javax.swing.tree.DefaultTreeModel in project intellij-community by JetBrains.
the class DesignerToolWindow method update.
public void update(GuiEditor designer) {
clearTreeBuilder();
myComponentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
myComponentTree.setEditor(designer);
myPropertyInspector.setEditor(designer);
if (designer == null) {
myComponentTree.setFormEditor(null);
} else {
myComponentTree.setFormEditor(designer.getEditor());
myComponentTreeBuilder = new ComponentTreeBuilder(myComponentTree, designer);
}
}
use of javax.swing.tree.DefaultTreeModel in project intellij-community by JetBrains.
the class InternalCompilerRefServiceView method showHierarchyInfo.
public static void showHierarchyInfo(CompilerReferenceHierarchyTestInfo info, PsiElement element) {
final InternalCompilerRefServiceView view = createViewTab(element);
final DefaultMutableTreeNode node = info.asTree();
node.setUserObject(element);
((DefaultTreeModel) view.myTree.getModel()).setRoot(node);
}
use of javax.swing.tree.DefaultTreeModel in project intellij-community by JetBrains.
the class InternalCompilerRefServiceView method showFindUsages.
public static void showFindUsages(CompilerReferenceFindUsagesTestInfo info, PsiElement element) {
final InternalCompilerRefServiceView view = createViewTab(element);
final DefaultMutableTreeNode node = info.asTree();
node.setUserObject(element);
((DefaultTreeModel) view.myTree.getModel()).setRoot(node);
}
use of javax.swing.tree.DefaultTreeModel in project jdk8u_jdk by JetBrains.
the class bug8023474 method createAndShowGUI.
private static void createAndShowGUI() {
try {
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (Exception e) {
throw new RuntimeException(e);
}
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
DefaultMutableTreeNode item = new DefaultMutableTreeNode("item");
DefaultMutableTreeNode subItem = new DefaultMutableTreeNode("subItem");
root.add(item);
item.add(subItem);
DefaultTreeModel model = new DefaultTreeModel(root);
tree = new JTree(model);
tree.setCellEditor(new Editor());
tree.setEditable(true);
tree.setRowHeight(30);
tree.setCellRenderer(new CheckboxCellRenderer());
JFrame frame = new JFrame("bug8023474");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new JScrollPane(tree));
frame.setSize(400, 300);
frame.setVisible(true);
}
Aggregations