Search in sources :

Example 1 with TreeColumnInfo

use of com.intellij.ui.treeStructure.treetable.TreeColumnInfo in project intellij-plugins by JetBrains.

the class DartConfigurable method createUIComponents.

private void createUIComponents() {
    mySdkPathComboWithBrowse = new ComboboxWithBrowseButton(new ComboBox<>());
    myDartiumPathComboWithBrowse = new ComboboxWithBrowseButton(new ComboBox<>());
    final CheckboxTree.CheckboxTreeCellRenderer checkboxTreeCellRenderer = new CheckboxTree.CheckboxTreeCellRenderer() {

        @Override
        public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            if (!(value instanceof CheckedTreeNode))
                return;
            final boolean dartSupportEnabled = myEnableDartSupportCheckBox.isSelected();
            final CheckedTreeNode node = (CheckedTreeNode) value;
            final Object userObject = node.getUserObject();
            if (userObject instanceof Project) {
                if (!dartSupportEnabled) {
                    //disabled state is also used as partially selected, that's why we do not change 'enabled' state if dartSupportEnabled
                    getCheckbox().setEnabled(false);
                }
                getTextRenderer().setEnabled(dartSupportEnabled);
                getTextRenderer().append(DartBundle.message("project.0", ((Project) userObject).getName()));
            } else if (userObject instanceof Module) {
                getCheckbox().setEnabled(dartSupportEnabled);
                getTextRenderer().setEnabled(dartSupportEnabled);
                final Icon moduleIcon = ModuleType.get((Module) userObject).getIcon();
                getTextRenderer().setIcon(dartSupportEnabled ? moduleIcon : IconLoader.getDisabledIcon(moduleIcon));
                getTextRenderer().append(((Module) userObject).getName());
            }
        }
    };
    myModulesCheckboxTreeTable = new CheckboxTreeTable(null, checkboxTreeCellRenderer, new ColumnInfo[] { new TreeColumnInfo("") });
    myModulesCheckboxTreeTable.addCheckboxTreeListener(new CheckboxTreeAdapter() {

        @Override
        public void nodeStateChanged(@NotNull CheckedTreeNode node) {
            updateErrorLabel();
        }
    });
    //myModulesCheckboxTreeTable.setRowHeight(myModulesCheckboxTreeTable.getRowHeight() + 2);
    myModulesCheckboxTreeTable.getTree().addTreeWillExpandListener(new TreeWillExpandListener() {

        public void treeWillExpand(final TreeExpansionEvent event) throws ExpandVetoException {
        }

        public void treeWillCollapse(final TreeExpansionEvent event) throws ExpandVetoException {
            throw new ExpandVetoException(event);
        }
    });
}
Also used : TreeWillExpandListener(javax.swing.event.TreeWillExpandListener) ComboBox(com.intellij.openapi.ui.ComboBox) ColumnInfo(com.intellij.util.ui.ColumnInfo) TreeColumnInfo(com.intellij.ui.treeStructure.treetable.TreeColumnInfo) ExpandVetoException(javax.swing.tree.ExpandVetoException) Project(com.intellij.openapi.project.Project) Module(com.intellij.openapi.module.Module) TreeExpansionEvent(javax.swing.event.TreeExpansionEvent) TreeColumnInfo(com.intellij.ui.treeStructure.treetable.TreeColumnInfo)

Example 2 with TreeColumnInfo

use of com.intellij.ui.treeStructure.treetable.TreeColumnInfo in project android by JetBrains.

the class ToolComponentsPanel method createUIComponents.

private void createUIComponents() {
    myToolsLoadingIcon = new AsyncProcessIcon("Loading...");
    myToolsSummaryRootNode = new RootNode();
    myToolsDetailsRootNode = new RootNode();
    UpdaterTreeNode.Renderer renderer = new SummaryTreeNode.Renderer();
    ColumnInfo[] toolsSummaryColumns = new ColumnInfo[] { new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new VersionColumnInfo(), new StatusColumnInfo() };
    myToolsSummaryTable = new TreeTableView(new ListTreeTableModelOnColumns(myToolsSummaryRootNode, toolsSummaryColumns));
    SdkUpdaterConfigPanel.setTreeTableProperties(myToolsSummaryTable, renderer, myModificationListener);
    ColumnInfo[] toolsDetailColumns = new ColumnInfo[] { new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new VersionColumnInfo(), new StatusColumnInfo() };
    myToolsDetailTable = new TreeTableView(new ListTreeTableModelOnColumns(myToolsDetailsRootNode, toolsDetailColumns));
    SdkUpdaterConfigPanel.setTreeTableProperties(myToolsDetailTable, renderer, myModificationListener);
}
Also used : ListTreeTableModelOnColumns(com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns) AsyncProcessIcon(com.intellij.util.ui.AsyncProcessIcon) ColumnInfo(com.intellij.util.ui.ColumnInfo) TreeColumnInfo(com.intellij.ui.treeStructure.treetable.TreeColumnInfo) TreeTableView(com.intellij.ui.dualView.TreeTableView) TreeColumnInfo(com.intellij.ui.treeStructure.treetable.TreeColumnInfo)

Example 3 with TreeColumnInfo

use of com.intellij.ui.treeStructure.treetable.TreeColumnInfo in project android by JetBrains.

the class PlatformComponentsPanel method createUIComponents.

private void createUIComponents() {
    UpdaterTreeNode.Renderer renderer = new SummaryTreeNode.Renderer();
    myPlatformLoadingIcon = new AsyncProcessIcon("Loading...");
    myPlatformSummaryRootNode = new RootNode();
    myPlatformDetailsRootNode = new RootNode();
    ColumnInfo[] platformSummaryColumns = new ColumnInfo[] { new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new ApiLevelColumnInfo(), new RevisionColumnInfo(), new StatusColumnInfo() };
    myPlatformSummaryTable = new TreeTableView(new ListTreeTableModelOnColumns(myPlatformSummaryRootNode, platformSummaryColumns));
    SdkUpdaterConfigPanel.setTreeTableProperties(myPlatformSummaryTable, renderer, myModificationListener);
    ColumnInfo[] platformDetailColumns = new ColumnInfo[] { new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new ApiLevelColumnInfo(), new RevisionColumnInfo(), new StatusColumnInfo() };
    myPlatformDetailTable = new TreeTableView(new ListTreeTableModelOnColumns(myPlatformDetailsRootNode, platformDetailColumns));
    SdkUpdaterConfigPanel.setTreeTableProperties(myPlatformDetailTable, renderer, myModificationListener);
}
Also used : ListTreeTableModelOnColumns(com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns) AsyncProcessIcon(com.intellij.util.ui.AsyncProcessIcon) ColumnInfo(com.intellij.util.ui.ColumnInfo) TreeColumnInfo(com.intellij.ui.treeStructure.treetable.TreeColumnInfo) TreeTableView(com.intellij.ui.dualView.TreeTableView) TreeColumnInfo(com.intellij.ui.treeStructure.treetable.TreeColumnInfo)

Aggregations

TreeColumnInfo (com.intellij.ui.treeStructure.treetable.TreeColumnInfo)3 ColumnInfo (com.intellij.util.ui.ColumnInfo)3 TreeTableView (com.intellij.ui.dualView.TreeTableView)2 ListTreeTableModelOnColumns (com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns)2 AsyncProcessIcon (com.intellij.util.ui.AsyncProcessIcon)2 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 ComboBox (com.intellij.openapi.ui.ComboBox)1 TreeExpansionEvent (javax.swing.event.TreeExpansionEvent)1 TreeWillExpandListener (javax.swing.event.TreeWillExpandListener)1 ExpandVetoException (javax.swing.tree.ExpandVetoException)1