Search in sources :

Example 1 with TreeTableView

use of com.intellij.ui.dualView.TreeTableView 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 2 with TreeTableView

use of com.intellij.ui.dualView.TreeTableView 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)

Example 3 with TreeTableView

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

the class CompareWithSelectedRevisionAction method showTreePopup.

private static void showTreePopup(final List<TreeItem<VcsFileRevision>> roots, final VirtualFile file, final Project project, final DiffProvider diffProvider) {
    final TreeTableView treeTable = new TreeTableView(new ListTreeTableModelOnColumns(new TreeNodeAdapter(null, null, roots), new ColumnInfo[] { BRANCH_COLUMN, REVISION_COLUMN, DATE_COLUMN, AUTHOR_COLUMN }));
    Runnable runnable = new Runnable() {

        @Override
        public void run() {
            int index = treeTable.getSelectionModel().getMinSelectionIndex();
            if (index == -1) {
                return;
            }
            VcsFileRevision revision = getRevisionAt(treeTable, index);
            if (revision != null) {
                DiffActionExecutor.showDiff(diffProvider, revision.getRevisionNumber(), file, project, VcsBackgroundableActions.COMPARE_WITH);
            }
        }
    };
    treeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    new PopupChooserBuilder(treeTable).setTitle(VcsBundle.message("lookup.title.vcs.file.revisions")).setItemChoosenCallback(runnable).setSouthComponent(createCommentsPanel(treeTable)).setResizable(true).setDimensionServiceKey("Vcs.CompareWithSelectedRevision.Popup").createPopup().showCenteredInCurrentWindow(project);
    final int lastRow = treeTable.getRowCount() - 1;
    if (lastRow < 0)
        return;
    treeTable.getSelectionModel().addSelectionInterval(lastRow, lastRow);
    treeTable.scrollRectToVisible(treeTable.getCellRect(lastRow, 0, true));
}
Also used : ListTreeTableModelOnColumns(com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns) ColumnInfo(com.intellij.util.ui.ColumnInfo) PopupChooserBuilder(com.intellij.openapi.ui.popup.PopupChooserBuilder) TreeTableView(com.intellij.ui.dualView.TreeTableView)

Example 4 with TreeTableView

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

the class AddMultipleFilesOptionsDialog method createTree.

private void createTree() {
    DefaultMutableTreeNode root = new DefaultMutableTreeNode();
    for (AddedFileInfo myRoot : myRoots) {
        root.add(myRoot);
    }
    myModel = new ListTreeTableModelOnColumns(root, COLUMNS);
    myTreeTable = new TreeTableView(myModel);
    int comboHeight = new JComboBox().getPreferredSize().height;
    int checkBoxHeight = new JCheckBox().getPreferredSize().height;
    myTreeTable.setMinRowHeight(Math.max(comboHeight, checkBoxHeight) + 2);
    myTreeTable.setRootVisible(false);
    final JTableHeader tableHeader = myTreeTable.getTableHeader();
    tableHeader.setReorderingAllowed(false);
    tableHeader.setResizingAllowed(false);
    final TreeTableTree tree = myTreeTable.getTree();
    myTreeTable.addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            final int keyCode = e.getKeyCode();
            if (keyCode == KeyEvent.VK_SPACE) {
                final int selectedColumn = myTreeTable.getSelectedColumn();
                if (selectedColumn == 0) {
                    return;
                }
                final int[] selectedRows = myTreeTable.getSelectedRows();
                if (selectedRows.length == 0) {
                    return;
                }
                final boolean included = !((AddedFileInfo) myTreeTable.getValueAt(selectedRows[0], 1)).included();
                for (int selectedRow : selectedRows) {
                    final AddedFileInfo addedFileInfo = (AddedFileInfo) myTreeTable.getValueAt(selectedRow, 1);
                    addedFileInfo.setIncluded(included);
                    myModel.nodeChanged(addedFileInfo);
                }
            }
        }
    });
    tree.setCellRenderer(new AddedFileCellRenderer());
    TreeUtil.installActions(tree);
}
Also used : ListTreeTableModelOnColumns(com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) KeyAdapter(java.awt.event.KeyAdapter) JTableHeader(javax.swing.table.JTableHeader) TreeTableView(com.intellij.ui.dualView.TreeTableView) KeyEvent(java.awt.event.KeyEvent) TreeTableTree(com.intellij.ui.treeStructure.treetable.TreeTableTree) AddedFileInfo(com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddedFileInfo)

Aggregations

TreeTableView (com.intellij.ui.dualView.TreeTableView)4 ListTreeTableModelOnColumns (com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns)4 ColumnInfo (com.intellij.util.ui.ColumnInfo)3 TreeColumnInfo (com.intellij.ui.treeStructure.treetable.TreeColumnInfo)2 AsyncProcessIcon (com.intellij.util.ui.AsyncProcessIcon)2 AddedFileInfo (com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddedFileInfo)1 PopupChooserBuilder (com.intellij.openapi.ui.popup.PopupChooserBuilder)1 TreeTableTree (com.intellij.ui.treeStructure.treetable.TreeTableTree)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 JTableHeader (javax.swing.table.JTableHeader)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1