当前位置: 首页>>代码示例>>Java>>正文


Java ColumnInfo.getColumnClass方法代码示例

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


在下文中一共展示了ColumnInfo.getColumnClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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(@Nonnull List<T> items, @Nonnull ColumnInfo[] columns, @Nonnull CollectionItemEditor<T> itemEditor, @Nonnull String emptyText) {
  super(itemEditor);

  model = new MyListTableModel(columns, new ArrayList<>(items));
  table = new TableView<>(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:consulo,项目名称:consulo,代码行数:41,代码来源:TableModelEditor.java


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