diff options
author | Dani Megert | 2010-07-12 09:24:51 +0000 |
---|---|---|
committer | Dani Megert | 2010-07-12 09:24:51 +0000 |
commit | e02f7bffe5308738edc0ff83cb4dc80a961e01e7 (patch) | |
tree | cd6e52ecfb31855272d154e65fb730c32c18ecaf | |
parent | edf4aa9d9f958ade92839c9661d042a6d0e4e7c7 (diff) | |
download | eclipse.platform.text-e02f7bffe5308738edc0ff83cb4dc80a961e01e7.tar.gz eclipse.platform.text-e02f7bffe5308738edc0ff83cb4dc80a961e01e7.tar.xz eclipse.platform.text-e02f7bffe5308738edc0ff83cb4dc80a961e01e7.zip |
Backported fixed for bug 317282: [implementation] AbstractTextEditor does not dispose its SaveAction.
-rw-r--r-- | org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java index d2dfee9964a..459384fa3a7 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java @@ -192,6 +192,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.Saveable; import org.eclipse.ui.SaveablesLifecycleEvent; import org.eclipse.ui.actions.ActionFactory; +import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; import org.eclipse.ui.actions.CommandNotMappedException; import org.eclipse.ui.actions.ContributedAction; import org.eclipse.ui.dialogs.PropertyDialogAction; @@ -2528,11 +2529,16 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit /** * Key binding support for the quick assist assistant. - * * @since 3.5 */ private KeyBindingSupportForAssistant fKeyBindingSupportForContentAssistant; + /** + * The save action. + * @since 3.6.1 + */ + private IWorkbenchAction fSaveAction; + /** * Creates a new text editor. If not explicitly set, this editor uses @@ -4331,6 +4337,11 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit fInformationPresenter= null; } + if (fSaveAction != null) { + fSaveAction.dispose(); + fSaveAction= null; + } + super.dispose(); } @@ -5510,7 +5521,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit */ protected void createActions() { - ResourceAction action; + ResourceAction action; action= new TextOperationAction(EditorMessages.getBundleForConstructedKeys(), "Editor.Cut.", this, ITextOperationTarget.CUT); //$NON-NLS-1$ action.setHelpContextId(IAbstractTextEditorHelpContextIds.CUT_ACTION); @@ -5634,7 +5645,8 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_INCREMENTAL_REVERSE); setAction(ITextEditorActionConstants.FIND_INCREMENTAL_REVERSE, action); - setAction(ITextEditorActionConstants.SAVE, ActionFactory.SAVE.create(getSite().getWorkbenchWindow())); + fSaveAction= ActionFactory.SAVE.create(getSite().getWorkbenchWindow()); + setAction(ITextEditorActionConstants.SAVE, fSaveAction); action= new RevertToSavedAction(EditorMessages.getBundleForConstructedKeys(), "Editor.Revert.", this); //$NON-NLS-1$ action.setHelpContextId(IAbstractTextEditorHelpContextIds.REVERT_TO_SAVED_ACTION); |