Search in sources :

Example 1 with CheckedTreeNode

use of com.intellij.ui.CheckedTreeNode in project intellij-community by JetBrains.

the class BreakpointsFavoriteListProvider method updateChildren.

private void updateChildren() {
    if (myProject.isDisposed())
        return;
    myChildren.clear();
    List<BreakpointItem> items = new ArrayList<>();
    for (final BreakpointPanelProvider provider : myBreakpointPanelProviders) {
        provider.provideBreakpointItems(myProject, items);
    }
    getEnabledGroupingRules(myRulesEnabled);
    myTreeController.setGroupingRules(myRulesEnabled);
    myTreeController.rebuildTree(items);
    CheckedTreeNode root = myTreeController.getRoot();
    for (int i = 0; i < root.getChildCount(); i++) {
        TreeNode child = root.getChildAt(i);
        if (child instanceof DefaultMutableTreeNode) {
            replicate((DefaultMutableTreeNode) child, myNode, myChildren);
        }
    }
    myFavoritesManager.fireListeners(getListName(myProject));
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) TreeNode(javax.swing.tree.TreeNode) AbstractTreeNode(com.intellij.ide.util.treeView.AbstractTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CheckedTreeNode(com.intellij.ui.CheckedTreeNode) BreakpointItem(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem) CheckedTreeNode(com.intellij.ui.CheckedTreeNode) BreakpointPanelProvider(com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider)

Example 2 with CheckedTreeNode

use of com.intellij.ui.CheckedTreeNode in project intellij-plugins by JetBrains.

the class FlexBCTree method setChildrenCheckedRecursively.

private static void setChildrenCheckedRecursively(final CheckedTreeNode node, final boolean checked) {
    final Enumeration children = node.children();
    while (children.hasMoreElements()) {
        final CheckedTreeNode childNode = (CheckedTreeNode) children.nextElement();
        childNode.setChecked(checked);
        setChildrenCheckedRecursively(childNode, checked);
    }
}
Also used : Enumeration(java.util.Enumeration) CheckedTreeNode(com.intellij.ui.CheckedTreeNode)

Example 3 with CheckedTreeNode

use of com.intellij.ui.CheckedTreeNode in project intellij-plugins by JetBrains.

the class FlexBCTree method selectRow.

public void selectRow(final Module module, final FlexBuildConfiguration bc) {
    clearSelection();
    final CheckedTreeNode node = getBCNode(module.getName(), bc.getName());
    if (node != null) {
        TreeUtil.selectInTree(node, true, this);
    }
}
Also used : CheckedTreeNode(com.intellij.ui.CheckedTreeNode)

Example 4 with CheckedTreeNode

use of com.intellij.ui.CheckedTreeNode in project intellij-plugins by JetBrains.

the class FlexBCTree method createRenderer.

private static CheckboxTreeCellRenderer createRenderer() {
    return new CheckboxTree.CheckboxTreeCellRenderer() {

        public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            if (!(value instanceof CheckedTreeNode))
                return;
            final CheckedTreeNode node = (CheckedTreeNode) value;
            final Object userObject = node.getUserObject();
            if (userObject instanceof Project) {
                getTextRenderer().append(((Project) userObject).getName());
            } else if (userObject instanceof Module) {
                getTextRenderer().setIcon(ModuleType.get((Module) userObject).getIcon());
                getTextRenderer().append(((Module) userObject).getName());
            } else if (userObject instanceof FlexBuildConfiguration) {
                BCUtils.renderBuildConfiguration((FlexBuildConfiguration) userObject, null, false).appendToComponent(getTextRenderer());
                getTextRenderer().setIcon(((FlexBuildConfiguration) userObject).getIcon());
            }
        }
    };
}
Also used : Project(com.intellij.openapi.project.Project) FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration) CheckedTreeNode(com.intellij.ui.CheckedTreeNode) Module(com.intellij.openapi.module.Module)

Example 5 with CheckedTreeNode

use of com.intellij.ui.CheckedTreeNode in project intellij-plugins by JetBrains.

the class FlexBCTree method setCheckedStatusForAll.

public void setCheckedStatusForAll(final boolean checked) {
    final CheckedTreeNode node = (CheckedTreeNode) getModel().getRoot();
    node.setChecked(checked);
    setChildrenCheckedRecursively(node, checked);
}
Also used : CheckedTreeNode(com.intellij.ui.CheckedTreeNode)

Aggregations

CheckedTreeNode (com.intellij.ui.CheckedTreeNode)16 Module (com.intellij.openapi.module.Module)6 FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)4 Enumeration (java.util.Enumeration)4 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 AndroidLibrary (com.android.builder.model.AndroidLibrary)2 AndroidProject (com.android.builder.model.AndroidProject)2 Variant (com.android.builder.model.Variant)2 VariantCheckboxTreeCellRenderer (com.android.tools.idea.gradle.variant.ui.VariantCheckboxTreeCellRenderer)2 Project (com.intellij.openapi.project.Project)2 CheckboxTree (com.intellij.ui.CheckboxTree)2 BreakpointItem (com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem)2 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)2 NotNull (org.jetbrains.annotations.NotNull)2 PostfixTemplate (com.intellij.codeInsight.template.postfix.templates.PostfixTemplate)1 DetectedFrameworkDescription (com.intellij.framework.detection.DetectedFrameworkDescription)1 AbstractTreeNode (com.intellij.ide.util.treeView.AbstractTreeNode)1 TreeState (com.intellij.ide.util.treeView.TreeState)1 Language (com.intellij.lang.Language)1 ModuleManager (com.intellij.openapi.module.ModuleManager)1