Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2009 itemis AG ( and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at /
 package org.eclipse.xtext.ui.editor;
An implementation of IDirtyStateManager can be used to register a currently edited resource and listen to changes on those resources.

Sebastian Zarnekow - Initial contribution and API
The IDirtyStateManager will raise specialized events that provide direct type-safe access to the source as IDirtyStateManager.

No longer used. org.eclipse.xtext.resource.impl.ResourceDescriptionChangeEvents are fired instead.
Sebastian Zarnekow - Initial contribution and API
	interface Event extends IResourceDescription.Event {

The sender is guaranteed to be of type IDirtyStateManager.

Initially try to manage the given resource and its dirty state. True will be returned, if the resource with the given URI was not managed before. However clients are free to call announceDirtyStateChanged(org.eclipse.xtext.ui.editor.IDirtyResource) even if false was returned. A call to manageDirtyState(org.eclipse.xtext.ui.editor.IDirtyResource) does not raise any events.

true if this resource is the first one that has been registered for its org.eclipse.emf.common.util.URI
	boolean manageDirtyState(IDirtyResource dirtyResource);

Mark the given dirty resource as unmanaged. This method may be called even if manageDirtyState has not been called before. Another dirty resource with the same org.eclipse.emf.common.util.URI will not become unmanaged. A call to this method will raise an event.

	void discardDirtyState(IDirtyResource dirtyResource);

Announce the dirty state of the given resource. Clients should decide on their own when to call this method. The dirty state manager will not refuse any announcement due to incorrect internal state of the resource. Listeners will be notified about the changed dirty state. It is up to the implementor to decide about the actual point in time. Implementations are free to collect various announcement before actually raising an event. Events may be fired in a different thread. If there is no managed resource in the state manager, the change will be refused and no change will be announced.
New to GrepCode? Check out our FAQ X