Search in sources :

Example 6 with TreeTableTree

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);
}
Also used : Project(com.intellij.openapi.project.Project) TreeTableTree(com.intellij.ui.treeStructure.treetable.TreeTableTree)

Example 7 with TreeTableTree

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);
}
Also used : TreePath(javax.swing.tree.TreePath) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CompilerOptionInfo(com.intellij.flex.model.bc.CompilerOptionInfo) TreeTableTree(com.intellij.ui.treeStructure.treetable.TreeTableTree) DefaultTreeModel(javax.swing.tree.DefaultTreeModel)

Example 8 with TreeTableTree

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;
}
Also used : TreeTableTree(com.intellij.ui.treeStructure.treetable.TreeTableTree)

Aggregations

TreeTableTree (com.intellij.ui.treeStructure.treetable.TreeTableTree)8 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 TreePath (javax.swing.tree.TreePath)4 Project (com.intellij.openapi.project.Project)3 Nullable (org.jetbrains.annotations.Nullable)3 CompilerOptionInfo (com.intellij.flex.model.bc.CompilerOptionInfo)2 ColumnInfo (com.intellij.util.ui.ColumnInfo)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 ChangeEvent (javax.swing.event.ChangeEvent)2 TableCellRenderer (javax.swing.table.TableCellRenderer)2 CompilerUIConfigurable (com.intellij.compiler.options.CompilerUIConfigurable)1 AddedFileInfo (com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddedFileInfo)1 Location (com.intellij.execution.Location)1 BuildConfigurationNature (com.intellij.flex.model.bc.BuildConfigurationNature)1 ValueSource (com.intellij.flex.model.bc.ValueSource)1 FlexBundle (com.intellij.lang.javascript.flex.FlexBundle)1 FlexUtils (com.intellij.lang.javascript.flex.FlexUtils)1 FlexProjectLevelCompilerOptionsHolder (com.intellij.lang.javascript.flex.projectStructure.FlexProjectLevelCompilerOptionsHolder)1 CompilerOptions (com.intellij.lang.javascript.flex.projectStructure.model.CompilerOptions)1