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