Skip to content
Snippets Groups Projects
Commit 8cfd0d02 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

fixed saveable for editors

refs 151
parent 56fb6afd
No related branches found
No related tags found
No related merge requests found
......@@ -18,11 +18,13 @@ $Id$
package org.fortiss.tooling.kernel.ui.internal.editor;
import java.util.Collection;
import java.util.EventObject;
import org.conqat.ide.commons.ui.logging.LoggingUtils;
import org.conqat.lib.commons.collections.IdentityHashSet;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
......@@ -30,6 +32,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.ISaveablePart;
import org.eclipse.ui.IWorkbenchPartConstants;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
......@@ -55,10 +59,11 @@ import org.fortiss.tooling.kernel.ui.service.IPropertiesService;
* @author hoelzlf
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 1924980FA5DF4510707A559F25799E8A
* @ConQAT.Rating RED Hash: 67AEFFDC48991458A33D3BF44819965E
*/
public class BindingEditor extends MultiPageEditorPart implements
ITabbedPropertySheetPageContributor {
ITabbedPropertySheetPageContributor, CommandStackListener,
ISaveablePart {
/** The editor's ID. */
public static String ID = BindingEditor.class.getName();
......@@ -154,6 +159,9 @@ public class BindingEditor extends MultiPageEditorPart implements
setTitleImage(handler.getIcon());
editedObject.eAdapters().add(editedObjectChangeAdapter);
ICommandStackService.INSTANCE.addCommandStackListener(editedObject,
this);
}
/** {@inheritDoc} */
......@@ -196,6 +204,8 @@ public class BindingEditor extends MultiPageEditorPart implements
/** {@inheritDoc} */
@Override
public void dispose() {
ICommandStackService.INSTANCE.removeCommandStackListener(editedObject,
this);
editedObject.eAdapters().remove(editedObjectChangeAdapter);
super.dispose();
}
......@@ -244,4 +254,10 @@ public class BindingEditor extends MultiPageEditorPart implements
public void gotoMarker(@SuppressWarnings("unused") IMarker marker) {
// TODO (FH): implement marker goto
}
/** {@inheritDoc} */
@Override
public void commandStackChanged(EventObject event) {
firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment