use of javax.swing.table.TableCellEditor in project intellij-community by JetBrains.
the class ProcessorProfilePanel method createTablePanel.
private static JPanel createTablePanel(final JBTable table) {
return ToolbarDecorator.createDecorator(table).disableUpAction().disableDownAction().setAddAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton anActionButton) {
final TableCellEditor cellEditor = table.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
final TableModel model = table.getModel();
((EditableModel) model).addRow();
TableUtil.editCellAt(table, model.getRowCount() - 1, 0);
}
}).createPanel();
}
use of javax.swing.table.TableCellEditor in project intellij-community by JetBrains.
the class EncapsulateFieldsDialog method doAction.
protected void doAction() {
if (myTable.isEditing()) {
TableCellEditor editor = myTable.getCellEditor();
if (editor != null) {
editor.stopCellEditing();
}
}
String errorString = validateData();
if (errorString != null) {
// were errors
CommonRefactoringUtil.showErrorMessage(REFACTORING_NAME, errorString, HelpID.ENCAPSULATE_FIELDS, myProject);
return;
}
if (getCheckedRows().length == 0) {
CommonRefactoringUtil.showErrorMessage(REFACTORING_NAME, "Nothing found to encapsulate", HelpID.ENCAPSULATE_FIELDS, myProject);
return;
}
invokeRefactoring(new EncapsulateFieldsProcessor(myProject, this));
JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
settings.ENCAPSULATE_FIELDS_USE_ACCESSORS_WHEN_ACCESSIBLE = myCbUseAccessorsWhenAccessible.isSelected();
}
use of javax.swing.table.TableCellEditor in project intellij-community by JetBrains.
the class ArrangementMatchingRulesControl method hideEditor.
public void hideEditor() {
if (myEditorRow < 0) {
return;
}
if (isEditing()) {
TableCellEditor editor = getCellEditor();
if (editor != null) {
editor.stopCellEditing();
}
}
mySkipSelectionChange = true;
try {
ArrangementMatchingRulesModel model = getModel();
model.removeRow(myEditorRow);
if (myEditorRow > 0 && model.getElementAt(myEditorRow - 1) instanceof EmptyArrangementRuleComponent) {
model.removeRow(myEditorRow - 1);
}
} finally {
mySkipSelectionChange = false;
}
myEditorRow = -1;
}
use of javax.swing.table.TableCellEditor in project intellij-community by JetBrains.
the class RegistryUi method show.
public boolean show() {
DialogWrapper dialog = new DialogWrapper(true) {
{
setTitle("Registry");
setModal(true);
init();
revaliateActions();
}
private AbstractAction myCloseAction;
@Nullable
@Override
protected JComponent createNorthPanel() {
if (!ApplicationManager.getApplication().isInternal()) {
JLabel warningLabel = new JLabel(XmlStringUtil.wrapInHtml("<b>Changing these values may cause unwanted behavior of " + ApplicationNamesInfo.getInstance().getFullProductName() + ". Please do not change these unless you have been asked.</b>"));
warningLabel.setIcon(UIUtil.getWarningIcon());
warningLabel.setForeground(JBColor.RED);
return warningLabel;
}
return null;
}
@Override
protected JComponent createCenterPanel() {
return myContent;
}
@Override
protected void dispose() {
super.dispose();
RegistryUi.this.dispose();
}
@Override
protected String getDimensionServiceKey() {
return "Registry";
}
@Override
public JComponent getPreferredFocusedComponent() {
return myTable;
}
@NotNull
@Override
protected Action[] createActions() {
return new Action[] { myRestoreDefaultsAction, myCloseAction };
}
@Override
protected void createDefaultActions() {
super.createDefaultActions();
myCloseAction = new AbstractAction("Close") {
@Override
public void actionPerformed(@NotNull ActionEvent e) {
processClose();
doOKAction();
}
};
myCloseAction.putValue(DialogWrapper.DEFAULT_ACTION, true);
}
@Override
public void doCancelAction() {
final TableCellEditor cellEditor = myTable.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
processClose();
super.doCancelAction();
}
};
return dialog.showAndGet();
}
use of javax.swing.table.TableCellEditor in project intellij-community by JetBrains.
the class BindToExistingBeanStep method _commit.
public void _commit(boolean finishChosen) {
// Stop editing if any
final TableCellEditor cellEditor = myTable.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
myData.myGenerateIsModified = myChkIsModified.isSelected();
// TODO[vova] check that at least one binding field exists
}
Aggregations