diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java index b278e0ffeb..3f0c61e63b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRNoFixLayoutAdapter.java @@ -145,7 +145,6 @@ public class FRNoFixLayoutAdapter extends AbstractLayoutAdapter { @Override public void dragStart(XCreator xCreator, SelectionModel selectionModel) { selectionModel.removeCreator(xCreator, xCreator.getWidth(), xCreator.getHeight()); - selectionModel.fireCreatorDeleted(); selectionModel.setSelectedCreator(container); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 28456f799b..31bb62531d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -584,9 +584,4 @@ public class SelectionModel { selection.setSelectedCreators(rebuildSelection); fireCreatorSelected(); } - - public void fireCreatorDeleted() { - designer.getEditListenerTable().fireCreatorModified(selection.getSelectedCreator(), - DesignerEvent.CREATOR_DELETED); - } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 2b9a4f6be1..6a0ad09521 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -166,11 +166,12 @@ public class FormCreatorDropTarget extends DropTarget { private void undoWhenDropFail() { JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - if (jt != null && jt.getUndoManager().canUndo()) { + if (jt != null) { UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { - jt.undo(); + FormUndoState current = (FormUndoState) jt.getUndoState(); + current.applyState(); } }); }