本文整理汇总了Java中com.intellij.util.ui.ColumnInfo类的典型用法代码示例。如果您正苦于以下问题:Java ColumnInfo类的具体用法?Java ColumnInfo怎么用?Java ColumnInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColumnInfo类属于com.intellij.util.ui包,在下文中一共展示了ColumnInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setElements
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public void setElements(List<? extends DetectedRootData> roots) {
Set<String> rootTypes = new HashSet<String>();
for (DetectedRootData root : roots) {
for (DetectedProjectRoot projectRoot : root.getAllRoots()) {
rootTypes.add(projectRoot.getRootTypeName());
}
}
myModel.setColumnInfos(new ColumnInfo[]{myIncludedColumn, ROOT_COLUMN, ROOT_TYPE_COLUMN});
int max = 0;
for (String rootType : rootTypes) {
max = Math.max(max, myTable.getFontMetrics(myTable.getFont()).stringWidth(rootType));
}
final TableColumn column = myTable.getColumnModel().getColumn(2);
int width = max + 20;//add space for combobox button
column.setPreferredWidth(width);
column.setMaxWidth(width);
myTable.updateColumnSizes();
List<DetectedRootData> sortedRoots = new ArrayList<DetectedRootData>(roots);
Collections.sort(sortedRoots, new Comparator<DetectedRootData>() {
@Override
public int compare(DetectedRootData o1, DetectedRootData o2) {
return o1.getDirectory().compareTo(o2.getDirectory());
}
});
myModel.setItems(sortedRoots);
}
示例2: createTreeColumns
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
private ColumnInfo[] createTreeColumns(DualViewColumnInfo[] columns) {
Collection<ColumnInfo> result = new ArrayList<ColumnInfo>();
final ColumnInfo firstColumn = columns[0];
ColumnInfo firstTreeColumn = new ColumnInfo(firstColumn.getName()) {
public Object valueOf(Object object) {
return firstColumn.valueOf(object);
}
public Class getColumnClass() {
return TreeTableModel.class;
}
public boolean isCellEditable(Object o) {
return true;
}
};
result.add(firstTreeColumn);
for (int i = 1; i < columns.length; i++) {
DualViewColumnInfo column = columns[i];
if (column.shouldBeShownIsTheTree()) result.add(column);
}
return result.toArray(new ColumnInfo[result.size()]);
}
示例3: setValueAt
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
@Override
public void setValueAt(Object newValue, int rowIndex, int columnIndex) {
if (rowIndex < getRowCount()) {
@SuppressWarnings("unchecked")
ColumnInfo<T, Object> column = (ColumnInfo<T, Object>)getColumnInfos()[columnIndex];
T item = getItem(rowIndex);
Object oldValue = column.valueOf(item);
if (column.getColumnClass() == String.class
? !Comparing.strEqual(((String)oldValue), ((String)newValue))
: !Comparing.equal(oldValue, newValue)) {
column.setValue(helper.getMutable(item, rowIndex), newValue);
if (dataChangedListener != null) {
dataChangedListener.dataChanged(column, rowIndex);
}
}
}
}
示例4: createUIComponents
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
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);
MouseListener modificationListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
refreshModified();
}
};
myPlatformSummaryTable.addMouseListener(modificationListener);
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);
myPlatformDetailTable.addMouseListener(modificationListener);
}
示例5: loadValues
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public void loadValues(AbstractProperty.AbstractPropertyContainer container) {
if (myColumnWidthProperty != null) {
BaseTableView.restoreWidth(myColumnWidthProperty.get(container), getComponent().getColumnModel());
}
myModel.setItems(myProperty.getModifiableList(container));
if (myModel.isSortable()) {
final ColumnInfo[] columnInfos = myModel.getColumnInfos();
int sortByColumn = -1;
for (int idx = 0; idx < columnInfos.length; idx++) {
ColumnInfo columnInfo = columnInfos[idx];
if (columnInfo.isSortable()) {
sortByColumn = idx;
break;
}
}
}
TableUtil.ensureSelectionExists(getComponent());
}
示例6: TestRunResultsView
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public TestRunResultsView(Project project) {
this.model = new ListTreeTableModelOnColumns(null, COLUMNS.toArray(new ColumnInfo[COLUMNS.size()]));
this.tree = new TreeTable(this.model);
this.tree.getColumnModel().getColumn(0).setMinWidth(TestMeasureColumnInfo.MeasureProperty.GROUP.width * 2);
for (TestMeasureColumnInfo.MeasureProperty prop : TestMeasureColumnInfo.MeasureProperty.values()) {
//first column is name column which is not included in MeasureProperties, that's why we add 1.
this.tree.getColumnModel().getColumn(prop.ordinal() + 1).setMinWidth(prop.width);
}
this.panel = JBUI.Panels.simplePanel().addToCenter(ScrollPaneFactory.createScrollPane(this.tree));
//set text when no tests were fetched yet
this.setEmptyText(Messages.getMessage("execution.result.ui.loading"));
//add rightclick dialog
DefaultActionGroup dag = new DefaultActionGroup();
dag.add(new OpenInEditorAction(() -> {
TestResultNode node = this.getSelectedNode();
if (node != null) {
return node.getResult();
}
return null;
}, project));
PopupHandler.installUnknownPopupHandler(this.tree, dag, ActionManager.getInstance());
}
开发者ID:Dynatrace,项目名称:Dynatrace-AppMon-IntelliJ-IDEA-Integration-Plugin,代码行数:26,代码来源:TestRunResultsView.java
示例7: PluginTable
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public PluginTable(final PluginTableModel model) {
super(model);
getColumnModel().setColumnMargin(0);
for (int i = 0; i < model.getColumnCount(); i++) {
TableColumn column = getColumnModel().getColumn(i);
final ColumnInfo columnInfo = model.getColumnInfos()[i];
column.setCellEditor(columnInfo.getEditor(null));
if (columnInfo.getColumnClass() == Boolean.class) {
final int width = new JCheckBox().getPreferredSize().width;
column.setWidth(width);
column.setPreferredWidth(width);
column.setMaxWidth(width);
column.setMinWidth(width);
}
}
setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
setShowGrid(false);
setStriped(true);
}
示例8: initAuthor
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
private void initAuthor() {
AUTHOR = new ColumnInfo<Object, String>("Author") {
@Override
public String valueOf(Object o) {
if (o instanceof GitHeavyCommit) {
return ((GitHeavyCommit)o).getAuthor();
}
return "";
}
@Override
public TableCellRenderer getRenderer(Object o) {
return myAuthorRenderer;
}
};
}
示例9: impl
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
private void impl(RootsHolder rootsHolder, GitLogFilters filters) {
final GitCommitsSequentialIndex commitsSequentially = new GitCommitsSequentialIndex();
final MediatorImpl mediator = new MediatorImpl(myProject, commitsSequentially);
final LoadController controller = new LoadController(myProject, mediator, null, commitsSequentially);
mediator.setLoader(controller);
final BigTableTableModel tableModel = new BigTableTableModel(Collections.<ColumnInfo>emptyList(), EmptyRunnable.getInstance());
mediator.setTableModel(tableModel);
tableModel.setRootsHolder(rootsHolder);
final Semaphore semaphore = new Semaphore();
final MyUIRefresh refresh = new MyUIRefresh(semaphore);
mediator.setUIRefresh(refresh);
final long start = System.currentTimeMillis();
semaphore.down();
mediator.reload(rootsHolder, Collections.<String>emptyList(), Collections.<String>emptyList(), filters, true);
semaphore.waitFor(300000);
refresh.assertMe();
final long end = System.currentTimeMillis();
System.out.println("Time: " + (end - start));
}
示例10: JsonTreeTableView
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public JsonTreeTableView(TreeNode rootNode, ColumnInfo[] columnInfos) {
super(new ListTreeTableModelOnColumns(rootNode, columnInfos));
this.columns = columnInfos;
final TreeTableTree tree = getTree();
tree.setShowsRootHandles(true);
tree.setRootVisible(false);
UIUtil.setLineStyleAngled(tree);
setTreeCellRenderer(new KeyCellRenderer());
TreeUtil.expand(tree, 2);
new TreeTableSpeedSearch(this, new Convertor<TreePath, String>() {
@Override
public String convert(final TreePath path) {
final NoSqlTreeNode node = (NoSqlTreeNode) path.getLastPathComponent();
NodeDescriptor descriptor = node.getDescriptor();
return descriptor.getFormattedKey();
}
});
}
示例11: createColumnList
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
@Nonnull
private DualViewColumnInfo[] createColumnList(@Nonnull Project project,
@Nonnull VcsHistoryProvider provider,
@Nullable ColumnInfo[] additionalColumns) {
ArrayList<DualViewColumnInfo> columns = new ArrayList<>();
columns.add(new RevisionColumnInfo(myRevisionsInOrderComparator));
if (!provider.isDateOmittable()) columns.add(new DateColumnInfo());
columns.add(new AuthorColumnInfo());
ArrayList<DualViewColumnInfo> additionalColumnInfo = new ArrayList<>();
if (additionalColumns != null) {
for (ColumnInfo additionalColumn : additionalColumns) {
additionalColumnInfo.add(new FileHistoryColumnWrapper(additionalColumn) {
@Override
protected DualView getDualView() {
return myDualView;
}
});
}
}
columns.addAll(additionalColumnInfo);
columns.add(new MessageColumnInfo(project));
return columns.toArray(new DualViewColumnInfo[columns.size()]);
}
示例12: setColumns
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
/**
* @param columns
* @return true if changed
*/
public boolean setColumns(ColumnInfo[] columns) {
if (myColumns != null && Arrays.equals(myColumns, columns)) {
return false;
}
myColumns = columns;
return true;
}
示例13: getCellRenderer
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
@Override
public TableCellRenderer getCellRenderer(int row, int column) {
final ColumnInfo<Item, ?> columnInfo = getListTableModel().getColumnInfos()[convertColumnIndexToModel(column)];
final Item item = getRow(row);
final TableCellRenderer renderer = columnInfo.getCustomizedRenderer(item, columnInfo.getRenderer(item));
if (renderer == null) {
return super.getCellRenderer(row, column);
}
else {
return renderer;
}
}
示例14: CheckboxTreeTable
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public CheckboxTreeTable(CheckedTreeNode root, CheckboxTree.CheckboxTreeCellRenderer renderer, final ColumnInfo[] columns) {
super(new ListTreeTableModelOnColumns(root, columns));
final TreeTableTree tree = getTree();
myEventDispatcher = EventDispatcher.create(CheckboxTreeListener.class);
CheckboxTreeHelper helper = new CheckboxTreeHelper(CheckboxTreeHelper.DEFAULT_POLICY, myEventDispatcher);
helper.initTree(tree, this, renderer);
tree.setSelectionRow(0);
}
示例15: TableModelEditor
import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
/**
* source will be copied, passed list will not be used directly
*
* Implement {@link DialogItemEditor} instead of {@link CollectionItemEditor} if you want provide dialog to edit.
*/
public TableModelEditor(@NotNull List<T> items, @NotNull ColumnInfo[] columns, @NotNull CollectionItemEditor<T> itemEditor, @NotNull String emptyText) {
super(itemEditor);
model = new MyListTableModel(columns, new ArrayList<T>(items));
table = new TableView<T>(model);
table.setDefaultEditor(Enum.class, ComboBoxTableCellEditor.INSTANCE);
table.setStriped(true);
table.setEnableAntialiasing(true);
preferredScrollableViewportHeightInRows(JBTable.PREFERRED_SCROLLABLE_VIEWPORT_HEIGHT_IN_ROWS);
new TableSpeedSearch(table);
ColumnInfo firstColumn = columns[0];
if ((firstColumn.getColumnClass() == boolean.class || firstColumn.getColumnClass() == Boolean.class) && firstColumn.getName().isEmpty()) {
TableUtil.setupCheckboxColumn(table.getColumnModel().getColumn(0));
}
boolean needTableHeader = false;
for (ColumnInfo column : columns) {
if (!StringUtil.isEmpty(column.getName())) {
needTableHeader = true;
break;
}
}
if (!needTableHeader) {
table.setTableHeader(null);
}
table.getEmptyText().setText(emptyText);
MyRemoveAction removeAction = new MyRemoveAction();
toolbarDecorator = ToolbarDecorator.createDecorator(table, this).setRemoveAction(removeAction).setRemoveActionUpdater(removeAction);
if (itemEditor instanceof DialogItemEditor) {
addDialogActions();
}
}