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


Java BooleanTableCellRenderer类代码示例

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


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

示例1: createDefaultRenderers

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Override
protected void createDefaultRenderers() {
  super.createDefaultRenderers();

  UIDefaults.LazyValue booleanRenderer = new UIDefaults.LazyValue() {
    @Override
    public Object createValue(@NotNull UIDefaults table) {
      DefaultCellEditor editor = new DefaultCellEditor(GuiUtils.createUndoableTextField());
      editor.setClickCountToStart(1);
      return new BooleanTableCellRenderer();
    }
  };
  //noinspection unchecked
  defaultRenderersByColumnClass.put(boolean.class, booleanRenderer);
  //noinspection unchecked
  defaultRenderersByColumnClass.put(Boolean.class, booleanRenderer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TableView.java

示例2: setTableEditor

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public void setTableEditor(JTable table) {
    this.table = table;
    TableColumnModel columnModel = table.getColumnModel();
    columnModel.getColumn(COL_CHECK).setCellRenderer(new BooleanTableCellRenderer());
    columnModel.getColumn(COL_CHECK).setCellEditor(new BooleanTableCellEditor());
    columnModel.getColumn(COL_CHECK).setPreferredWidth(50);
    columnModel.getColumn(COL_TABLE).setPreferredWidth(100);

    JTableHeader header = table.getTableHeader();
    header.setDefaultRenderer(new ClassTableHeaderRenderer(table, true));
}
 
开发者ID:Jamling,项目名称:Android-ORM-ASPlugin,代码行数:12,代码来源:ClassTableModel.java

示例3: getRenderer

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Override
public TableCellRenderer getRenderer(final IdeaPluginDescriptor ideaPluginDescriptor) {
  return new BooleanTableCellRenderer() {
    @Override
    public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int column) {
      return super.getTableCellRendererComponent(table, value == null ? Boolean.TRUE : value, isSelected, hasFocus, row, column);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:InstalledPluginsTableModel.java

示例4: methodsSize

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public void methodsSize(int methods) {
  myTableModel = new DefaultTableModel(methods, 2);
  myMethodsTable.setModel(myTableModel);

  TableColumn checkColumn = myMethodsTable.getColumnModel().getColumn(0);
  TableUtil.setupCheckboxColumn(checkColumn);
  checkColumn.setCellRenderer(new BooleanTableCellRenderer());
  checkColumn.setCellEditor(new DefaultCellEditor(new JCheckBox()));

  myMethodsTable.getColumnModel().getColumn(1).setHeaderValue("Test method");
  checkColumn.setHeaderValue("");
  getOKAction().setEnabled(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:CreateTestDialog.java

示例5: getTableCellRendererComponent

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, final boolean hasFocus, int row, int column) {
  JPanel panel = new JPanel();
  final Component component = super.getTableCellRendererComponent(table, ((Pair)value).getFirst(), isSelected, hasFocus, row, column);
  panel.add(component);

  final Component component1 =
    new BooleanTableCellRenderer().getTableCellRendererComponent(table, ((Pair)value).getSecond(), isSelected, hasFocus, row, column);
  panel.add(component1);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PyParameterTableModel.java

示例6: setColumns

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public static void setColumns(@NotNull JTable table) {
  StringResourceTableModel model = (StringResourceTableModel) table.getModel();

  Enumeration<TableColumn> columns = table.getColumnModel().getColumns();
  while (columns.hasMoreElements()) {
    TableColumn column = columns.nextElement();
    if (column.getModelIndex() == ConstantColumn.UNTRANSLATABLE.ordinal()) {
      column.setCellRenderer(new BooleanTableCellRenderer());
    }
    else {
      column.setCellRenderer(CELL_RENDERER);
    }
    int index = column.getModelIndex();
    FontMetrics fontMetrics = table.getFontMetrics(table.getFont());
    Locale locale = model.localeOfColumn(index);
    HeaderCellRenderer renderer =
      locale == null ? new ConstantHeaderCellRenderer(index, fontMetrics) : new TranslationHeaderCellRenderer(fontMetrics, locale);
    column.setHeaderRenderer(renderer);
    // Sets Key and Default Value columns to initially display at full width and all others to be collapsed
    int width;
    if (ConstantColumn.KEY.ordinal() == index ||
        ConstantColumn.DEFAULT_VALUE.ordinal() == index) {
      width = renderer.getFullExpandedWidth();
    } else {
      width = renderer.getCollapsedWidth();
    }
    setPreferredWidth(column, width);
  }

  expandToViewportWidthIfNecessary(table, -1);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ColumnUtil.java

示例7: CloudLibraryTable

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
CloudLibraryTable(List<CloudLibrary> libraries) {
  super(new CloudLibraryTableModel(libraries));
  setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  setDefaultRenderer(CloudLibrary.class, new CloudLibraryRenderer());
  setDefaultRenderer(Boolean.class, new BooleanTableCellRenderer());
  setDefaultEditor(Boolean.class, new BooleanTableCellEditor());
  TableUtil.setupCheckboxColumn(getColumnModel().getColumn(1));
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:9,代码来源:GoogleCloudApiSelectorPanel.java

示例8: getRenderer

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public TableCellRenderer getRenderer(final IdeaPluginDescriptor ideaPluginDescriptor) {
  return new BooleanTableCellRenderer() {
    @Override
    public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean isSelected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int column) {
      return super.getTableCellRendererComponent(table, value == null ? Boolean.TRUE : value, isSelected, hasFocus, row, column);
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:InstalledPluginsTableModel.java

示例9: getRenderer

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Override
public TableCellRenderer getRenderer(final IdeaPluginDescriptor ideaPluginDescriptor) {
  return new BooleanTableCellRenderer() {
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
      return super.getTableCellRendererComponent(table, value == null ? Boolean.TRUE : value, isSelected, hasFocus, row, column);
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:PluginAdvertiserPluginModel.java

示例10: createTablePanel

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
private JScrollPane createTablePanel() {
  myTableModel = new MyTableModel();
  myTable = new Table(myTableModel);
  myTable.setSurrendersFocusOnKeystroke(true);
  myTable.getTableHeader().setReorderingAllowed(false);

  final TableColumnModel columnModel = myTable.getColumnModel();
  columnModel.getColumn(SKIP_SETTER).setCellRenderer(new BooleanTableCellRenderer());

  myTable.registerKeyboardAction(
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        final int[] selectedRows = myTable.getSelectedRows();
        for (final int selectedRow : selectedRows) {
          final ParameterData parameterData = myTableModel.getParamData(selectedRow);
          if (parameterData.getDefaultValue() != null) {
            parameterData.setInsertSetter(!parameterData.isInsertSetter());
          }
        }
        TableUtil.selectRows(myTable, selectedRows);
      }
    },
    KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
    JComponent.WHEN_FOCUSED
  );

  myTable.setPreferredScrollableViewportSize(new Dimension(550, myTable.getRowHeight() * 12));
  myTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
  //final Border titledBorder = IdeBorderFactory.createBoldTitledBorder("Parameters to Pass to the Builder");
  //final Border emptyBorder = BorderFactory.createEmptyBorder(0, 5, 5, 5);
  //final Border border = BorderFactory.createCompoundBorder(titledBorder, emptyBorder);
  //scrollPane.setBorder(border);

  return scrollPane;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:38,代码来源:ReplaceConstructorWithBuilderDialog.java

示例11: BooleanColumnInfo

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
public BooleanColumnInfo(final String name) {
  super(name, new BooleanTableCellRenderer());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BooleanColumnInfo.java

示例12: getRenderer

import com.intellij.ui.BooleanTableCellRenderer; //导入依赖的package包/类
@Nullable
@Override
public TableCellRenderer getRenderer(AbstractVariableData data) {
  return new BooleanTableCellRenderer();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:AbstractParameterTablePanel.java


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