use of javax.swing.table.TableCellEditor in project intellij-plugins by JetBrains.
the class AddRemoveTableRowsDialog method doOKAction.
protected void doOKAction() {
final TableCellEditor cellEditor = myTable.getCellEditor();
if (cellEditor != null) {
// apply currently edited value if any
cellEditor.stopCellEditing();
}
super.doOKAction();
}
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 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 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
}
use of javax.swing.table.TableCellEditor in project intellij-community by JetBrains.
the class BindToNewBeanStep method _commit.
public void _commit(boolean finishChosen) throws CommitStepException {
// Stop editing if any
final TableCellEditor cellEditor = myTable.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
// Check that all included fields are bound to valid bean properties
final PsiNameHelper nameHelper = PsiNameHelper.getInstance(myData.myProject);
for (int i = 0; i < myData.myBindings.length; i++) {
final FormProperty2BeanProperty binding = myData.myBindings[i];
if (binding.myBeanProperty == null) {
continue;
}
if (!nameHelper.isIdentifier(binding.myBeanProperty.myName)) {
throw new CommitStepException(UIDesignerBundle.message("error.X.is.not.a.valid.property.name", binding.myBeanProperty.myName));
}
}
myData.myGenerateIsModified = myChkIsModified.isSelected();
}
Aggregations