use of com.intellij.ui.treeStructure.treetable.TreeTableTree in project intellij-community by JetBrains.
the class CollapseAllAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
final TreeTableTree tree = DynamicToolWindowWrapper.getInstance(project).getTreeTable().getTree();
TreeUtil.collapseAll(tree, 0);
}
use of com.intellij.ui.treeStructure.treetable.TreeTableTree in project intellij-plugins by JetBrains.
the class CompilerOptionsConfigurable method updateTreeTable.
private void updateTreeTable() {
final TreeTableTree tree = myTreeTable.getTree();
final TreePath selectionPath = tree.getSelectionPath();
final List<TreePath> expandedPaths = TreeUtil.collectExpandedPaths(tree);
final DefaultTreeModel treeModel = (DefaultTreeModel) tree.getModel();
final DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
final CompilerOptionInfo[] optionInfos = CompilerOptionInfo.getRootInfos();
final boolean showAll = myShowAllOptionsCheckBox.isSelected();
updateChildNodes(rootNode, optionInfos, showAll);
treeModel.reload(rootNode);
TreeUtil.restoreExpandedPaths(tree, expandedPaths);
tree.setSelectionPath(selectionPath);
}
use of com.intellij.ui.treeStructure.treetable.TreeTableTree in project android by JetBrains.
the class CheckboxClickListener method onClick.
@Override
public boolean onClick(@NotNull MouseEvent e, int clickCount) {
Object source = e.getSource();
if (source instanceof JComponent && !((JComponent) source).isEnabled()) {
return false;
}
TreeTableTree tree = myTreeTable.getTree();
int row = tree.getRowForLocation(e.getX(), e.getY());
if (row < 0) {
return false;
}
Rectangle rowBounds = tree.getRowBounds(row);
myRenderer.setBounds(rowBounds);
Rectangle checkBounds = myRenderer.myCheckbox.getBounds();
checkBounds.setLocation(rowBounds.getLocation());
if (checkBounds.height == 0) {
checkBounds.height = checkBounds.width = rowBounds.height;
}
if (checkBounds.contains(e.getPoint())) {
UpdaterTreeNode node = (UpdaterTreeNode) tree.getPathForRow(row).getLastPathComponent();
node.cycleState();
myTreeTable.repaint();
return true;
}
return false;
}
Aggregations