本文整理汇总了Java中com.intellij.refactoring.ui.StringTableCellEditor类的典型用法代码示例。如果您正苦于以下问题:Java StringTableCellEditor类的具体用法?Java StringTableCellEditor怎么用?Java StringTableCellEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringTableCellEditor类属于com.intellij.refactoring.ui包,在下文中一共展示了StringTableCellEditor类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCenterPanel
import com.intellij.refactoring.ui.StringTableCellEditor; //导入依赖的package包/类
protected JComponent createCenterPanel() {
myTable = new JBTable(myTableModel);
myTable.setStriped(true);
TableColumn nameColumn = myTable.getColumnModel().getColumn(NAME_COLUMN);
TableColumn valueColumn = myTable.getColumnModel().getColumn(VALUE_COLUMN);
Project project = myClass.getProject();
nameColumn.setCellRenderer(new MyCellRenderer());
nameColumn.setCellEditor(new StringTableCellEditor(project));
valueColumn.setCellRenderer(new MyCodeFragmentTableCellRenderer());
valueColumn.setCellEditor(new JavaCodeFragmentTableCellEditor(project));
myTable.setPreferredScrollableViewportSize(new Dimension(210, myTable.getRowHeight() * 4));
myTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
myTable.getSelectionModel().setSelectionInterval(0, 0);
myTable.setSurrendersFocusOnKeystroke(true);
myTable.setCellSelectionEnabled(true);
myTable.setFocusCycleRoot(true);
if (myHideDefaultValueColumn) {
final TableColumn defaultValue = myTable.getColumnModel().getColumn(VALUE_COLUMN);
myTable.removeColumn(defaultValue);
myTable.getModel().addTableModelListener(new TableModelListener() {
@Override
public void tableChanged(TableModelEvent e) {
if (e.getType() == TableModelEvent.INSERT) {
myTable.getModel().removeTableModelListener(this);
final TableColumnAnimator animator = new TableColumnAnimator(myTable);
animator.setStep(20);
animator.addColumn(defaultValue, myTable.getWidth() / 2);
animator.startAndDoWhenDone(new Runnable() {
@Override
public void run() {
myTable.editCellAt(myTable.getRowCount() - 1, 0);
}
});
animator.start();
}
}
});
}
final JPanel panel = new JPanel(new BorderLayout());
panel.add(SeparatorFactory.createSeparator(RefactoringBundle.message("changeClassSignature.parameters.panel.border.title"), myTable), BorderLayout.NORTH);
panel.add(ToolbarDecorator.createDecorator(myTable).createPanel(), BorderLayout.CENTER);
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:ChangeClassSignatureDialog.java
示例2: doCreateEditor
import com.intellij.refactoring.ui.StringTableCellEditor; //导入依赖的package包/类
@Override
public TableCellEditor doCreateEditor(TableItem o) {
return new StringTableCellEditor(myProject);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ParameterTableModelBase.java
注:本文中的com.intellij.refactoring.ui.StringTableCellEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论