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);
}
}
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());
}
}
};
}
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);
}
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);
}
}
}
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);
}
}
}
Aggregations