Search in sources :

Example 6 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 7 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 8 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)

Example 9 with CheckedTreeNode

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

the class PostfixTemplatesCheckboxTree method visit.

private void visit(@NotNull Consumer<PostfixTemplateCheckedTreeNode> consumer) {
    Enumeration languages = myRoot.children();
    while (languages.hasMoreElements()) {
        final CheckedTreeNode langNode = (CheckedTreeNode) languages.nextElement();
        Enumeration templates = langNode.children();
        while (templates.hasMoreElements()) {
            final PostfixTemplateCheckedTreeNode template = (PostfixTemplateCheckedTreeNode) templates.nextElement();
            consumer.consume(template);
        }
    }
}
Also used : Enumeration(java.util.Enumeration) CheckedTreeNode(com.intellij.ui.CheckedTreeNode)

Example 10 with CheckedTreeNode

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

the class DetectedFrameworksTree method onNodeStateChanged.

@Override
protected void onNodeStateChanged(CheckedTreeNode node) {
    final List<DetectedFrameworkDescription> checked = Arrays.asList(getCheckedNodes(DetectedFrameworkDescription.class, null));
    final List<DetectedFrameworkDescription> disabled = FrameworkDetectionUtil.getDisabledDescriptions(checked, Collections.<DetectedFrameworkDescription>emptyList());
    for (DetectedFrameworkDescription description : disabled) {
        final DefaultMutableTreeNode treeNode = TreeUtil.findNodeWithObject(getRoot(), description);
        if (treeNode instanceof CheckedTreeNode) {
            ((CheckedTreeNode) treeNode).setChecked(false);
        }
    }
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) DetectedFrameworkDescription(com.intellij.framework.detection.DetectedFrameworkDescription) 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