mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-41423
This commit is contained in:
@@ -965,6 +965,11 @@ public final class GuiEditor extends JPanel implements DataProvider, ModuleProvi
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isUndoRedoInProgress() {
|
||||
UndoManager undoManager = UndoManager.getInstance(getProject());
|
||||
return undoManager.isUndoInProgress() || undoManager.isRedoInProgress();
|
||||
}
|
||||
|
||||
private boolean isActiveEditor() {
|
||||
return UIDesignerToolWindowManager.getInstance(getProject()).getActiveFormEditor() == this;
|
||||
}
|
||||
|
||||
+16
-13
@@ -240,25 +240,28 @@ public final class InplaceEditingLayer extends JComponent{
|
||||
* Finishes current inplace editing
|
||||
*/
|
||||
private void finishInplaceEditing(){
|
||||
if(myInplaceComponent == null || myInsideChange){ // nothing to finish
|
||||
if (myInplaceComponent == null || myInsideChange) { // nothing to finish
|
||||
return;
|
||||
}
|
||||
myInsideChange = true;
|
||||
try{
|
||||
// 1. Apply new value to the component
|
||||
LOG.assertTrue(myInplaceEditor != null);
|
||||
CommandProcessor.getInstance().executeCommand(
|
||||
myInplaceComponent.getProject(),
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
final Object value = myInplaceEditor.getValue();
|
||||
myInplaceProperty.setValue(myInplaceComponent, value);
|
||||
} catch (Exception ignored){}
|
||||
myEditor.refreshAndSave(true);
|
||||
}
|
||||
}, UIDesignerBundle.message("command.set.property.value"), null);
|
||||
|
||||
if (!myEditor.isUndoRedoInProgress()) {
|
||||
CommandProcessor.getInstance().executeCommand(
|
||||
myInplaceComponent.getProject(),
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
final Object value = myInplaceEditor.getValue();
|
||||
myInplaceProperty.setValue(myInplaceComponent, value);
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
}
|
||||
myEditor.refreshAndSave(true);
|
||||
}
|
||||
}, UIDesignerBundle.message("command.set.property.value"), null);
|
||||
}
|
||||
// 2. Remove editor from the layer
|
||||
|
||||
if (myInplaceEditorComponent != null) { // reenterability guard
|
||||
|
||||
+7
-3
@@ -654,14 +654,18 @@ public final class PropertyInspectorTable extends Table implements DataProvider{
|
||||
public void editingStopped(final ChangeEvent ignored){
|
||||
LOG.assertTrue(isEditing());
|
||||
LOG.assertTrue(editingRow!=-1);
|
||||
if (myStoppingEditing) return;
|
||||
if (myStoppingEditing) {
|
||||
return;
|
||||
}
|
||||
myStoppingEditing = true;
|
||||
final Property property=myProperties.get(editingRow);
|
||||
final PropertyEditor editor=property.getEditor();
|
||||
editor.removePropertyEditorListener(myPropertyEditorListener);
|
||||
try {
|
||||
final Object value = editor.getValue();
|
||||
setValueAt(value, editingRow, editingColumn);
|
||||
if (myEditor != null && !myEditor.isUndoRedoInProgress()) {
|
||||
final Object value = editor.getValue();
|
||||
setValueAt(value, editingRow, editingColumn);
|
||||
}
|
||||
}
|
||||
catch (final Exception exc) {
|
||||
showInvalidInput(exc);
|
||||
|
||||
Reference in New Issue
Block a user