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


Java JBTable.setIntercellSpacing方法代码示例

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


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

示例1: apply

import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
public static void apply(@Nonnull JBTable table) {
  table.setAutoResizeMode(AUTO_RESIZE_OFF);
  table.setTableHeader(createTableHeader(table.getColumnModel()));
  table.getTableHeader().setReorderingAllowed(false);
  //setOpaque(false);
  table.setGridColor(GRID_COLOR);
  table.setIntercellSpacing(new Dimension(1, 0));
  table.setShowGrid(false);
  table.setStriped(true);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:StripeTable.java

示例2: GitRebaseEditor

import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
protected GitRebaseEditor(@NotNull Project project, @NotNull VirtualFile gitRoot, @NotNull List<GitRebaseEntry> entries)
  throws IOException {
  super(project, true);
  myProject = project;
  myRoot = gitRoot;
  setTitle(GitBundle.getString("rebase.editor.title"));
  setOKButtonText(GitBundle.getString("rebase.editor.button"));

  myTableModel = new MyTableModel(entries);
  myCommitsTable = new JBTable(myTableModel);
  myCommitsTable.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
  myCommitsTable.setIntercellSpacing(JBUI.emptySize());

  final JComboBox editorComboBox = new ComboBox();
  for (Object option : GitRebaseEntry.Action.values()) {
    editorComboBox.addItem(option);
  }
  TableColumn actionColumn = myCommitsTable.getColumnModel().getColumn(MyTableModel.ACTION_COLUMN);
  actionColumn.setCellEditor(new DefaultCellEditor(editorComboBox));
  actionColumn.setCellRenderer(ComboBoxTableCellRenderer.INSTANCE);

  myCommitsTable.setDefaultRenderer(String.class, new ColoredTableCellRenderer() {
    @Override
    protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
      if (value != null) {
        append(value.toString());
        SpeedSearchUtil.applySpeedSearchHighlighting(myCommitsTable, this, true, selected);
      }
    }
  });

  myTableModel.addTableModelListener(new TableModelListener() {
    public void tableChanged(final TableModelEvent e) {
      validateFields();
    }
  });

  installSpeedSearch();
  myCopyProvider = new MyCopyProvider();

  adjustColumnWidth(0);
  adjustColumnWidth(1);
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:GitRebaseEditor.java

示例3: OrderPanel

import com.intellij.ui.table.JBTable; //导入方法依赖的package包/类
protected OrderPanel(Class<T> entryClass, boolean showCheckboxes) {
  super(new BorderLayout());

  myEntryClass = entryClass;

  myEntryTable = new JBTable(new MyTableModel(showCheckboxes));
  myEntryTable.setShowGrid(false);
  myEntryTable.setDragEnabled(false);
  myEntryTable.setShowHorizontalLines(false);
  myEntryTable.setShowVerticalLines(false);
  myEntryTable.setIntercellSpacing(new Dimension(0, 0));

  myEntryTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

  myEntryTable.registerKeyboardAction(
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if(getCheckboxColumn() == -1) return;

        final int[] selectedRows = myEntryTable.getSelectedRows();
        boolean currentlyMarked = true;
        for (int idx = 0; idx < selectedRows.length; idx++) {
          final int selectedRow = selectedRows[idx];
          if (selectedRow < 0 || !myEntryTable.isCellEditable(selectedRow, getCheckboxColumn())) {
            return;
          }
          currentlyMarked &= ((Boolean)myEntryTable.getValueAt(selectedRow, getCheckboxColumn())).booleanValue();
        }
        for (int idx = 0; idx < selectedRows.length; idx++) {
          myEntryTable.setValueAt(currentlyMarked? Boolean.FALSE : Boolean.TRUE, selectedRows[idx], getCheckboxColumn());
        }
      }
    },
    KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
    JComponent.WHEN_FOCUSED
  );

  add(ScrollPaneFactory.createScrollPane(myEntryTable), BorderLayout.CENTER);

  if (myEntryTable.getRowCount() > 0) {
    myEntryTable.getSelectionModel().setSelectionInterval(0,0);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:44,代码来源:OrderPanel.java


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