• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ColumnInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.util.ui.ColumnInfo的典型用法代码示例。如果您正苦于以下问题:Java ColumnInfo类的具体用法?Java ColumnInfo怎么用?Java ColumnInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ColumnInfo类属于com.intellij.util.ui包,在下文中一共展示了ColumnInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DetectedRootsChooser.java


示例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()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DualView.java


示例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);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TableModelEditor.java


示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:PlatformComponentsPanel.java


示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UIPropertyBinding.java


示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:PluginTable.java


示例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;
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GitLogUI.java


示例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));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:GitLogPerformanceTest.java


示例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();
        }
    });
}
 
开发者ID:dboissier,项目名称:nosql4idea,代码行数:23,代码来源:JsonTreeTableView.java


示例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()]);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:FileHistoryPanelImpl.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ListTreeTableModelOnColumns.java


示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TableView.java


示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CheckboxTreeTable.java


示例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();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:TableModelEditor.java


示例16: apply

import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
@NotNull
public List<T> apply() {
  if (helper.hasModifiedItems()) {
    @SuppressWarnings("unchecked")
    final ColumnInfo<T, Object>[] columns = model.getColumnInfos();
    helper.process(new TObjectObjectProcedure<T, T>() {
      @Override
      public boolean execute(T newItem, @NotNull T oldItem) {
        for (ColumnInfo<T, Object> column : columns) {
          if (column.isCellEditable(newItem)) {
            column.setValue(oldItem, column.valueOf(newItem));
          }
        }

        if (itemEditor instanceof DialogItemEditor) {
          ((DialogItemEditor<T>)itemEditor).applyEdited(oldItem, newItem);
        }

        model.items.set(ContainerUtil.indexOfIdentity(model.items, newItem), oldItem);
        return true;
      }
    });
  }

  helper.reset(model.items);
  return model.items;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:TableModelEditor.java


示例17: showTreePopup

import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:CompareWithSelectedRevisionAction.java


示例18: buildColumnInfos

import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
private static ColumnInfo[] buildColumnInfos(final ChangeListColumn[] columns) {
  ColumnInfo[] result = new ColumnInfo[columns.length];
  for(int i=0; i<columns.length; i++) {
    result [i] = new ColumnInfoAdapter(columns [i]);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:CommittedChangesTableModel.java


示例19: reset

import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
public void reset() {
  IssueNavigationConfiguration configuration = IssueNavigationConfiguration.getInstance(myProject);
  myLinks = new ArrayList<IssueNavigationLink>();
  for(IssueNavigationLink link: configuration.getLinks()) {
    myLinks.add(new IssueNavigationLink(link.getIssueRegexp(), link.getLinkRegexp()));
  }
  myModel = new ListTableModel<IssueNavigationLink>(
    new ColumnInfo[] { ISSUE_COLUMN, LINK_COLUMN },
    myLinks,
    0);
  myLinkTable.setModel(myModel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:IssueNavigationConfigurationPanel.java


示例20: createColumns

import com.intellij.util.ui.ColumnInfo; //导入依赖的package包/类
private static ColumnInfo[] createColumns(ColumnInfo[] additionalColumns) {
  if (additionalColumns == null) {
    return COLUMNS;
  }

  ColumnInfo[] result = new ColumnInfo[additionalColumns.length + COLUMNS.length];

  System.arraycopy(COLUMNS, 0, result, 0, COLUMNS.length);
  System.arraycopy(additionalColumns, 0, result, COLUMNS.length, additionalColumns.length);

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:VcsHistoryDialog.java



注:本文中的com.intellij.util.ui.ColumnInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransactionCommitFailedException类代码示例发布时间:2022-05-21
下一篇:
Java TimeoutException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap