org.eclipse.gmf.runtime.common.ui.resources.FileChangeManager Java Examples

The following examples show how to use org.eclipse.gmf.runtime.common.ui.resources.FileChangeManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CrossflowValidationDecoratorProvider.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
/**
* @generated
*/
public void deactivate() {
	if (viewId == null) {
		return;
	}

	// remove self from global decorators registry
	List list = (List) allDecorators.get(viewId);
	if (list != null) {
		list.remove(this);
		if (list.isEmpty()) {
			allDecorators.remove(viewId);
		}
	}

	// stop listening to changes in resources if there are no more decorators
	if (fileObserver != null && allDecorators.isEmpty()) {
		FileChangeManager.getInstance().removeFileObserver(fileObserver);
		fileObserver = null;
	}
	super.deactivate();
}
 
Example #2
Source File: AbstractMarkerBasedDecorationProvider.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
public void deactivate() {
	if (viewId == null) {
		return;
	}

	// remove self from global decorators registry
	List<IDecorator> list = allDecorators.get(viewId);
	if (list != null) {
		list.remove(this);
		if (list.isEmpty()) {
			allDecorators.remove(viewId);
		}
	}

	// stop listening to changes in resources if there are no more
	// decorators
	if (fileObserver != null && allDecorators.isEmpty()) {
		FileChangeManager.getInstance().removeFileObserver(fileObserver);
		fileObserver = null;
	}
	super.deactivate();
}
 
Example #3
Source File: ProcessValidationDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
* @generated
*/
public void deactivate() {
	if (viewId == null) {
		return;
	}

	// remove self from global decorators registry
	List list = (List) allDecorators.get(viewId);
	if (list != null) {
		list.remove(this);
		if (list.isEmpty()) {
			allDecorators.remove(viewId);
		}
	}

	// stop listening to changes in resources if there are no more decorators
	if (fileObserver != null && allDecorators.isEmpty()) {
		FileChangeManager.getInstance().removeFileObserver(fileObserver);
		fileObserver = null;
	}
	super.deactivate();
}
 
Example #4
Source File: AbstractMarkerBasedDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void activate() {
	if (viewId == null) {
		return;
	}

	// add self to global decorators registry
	List<IDecorator> list = allDecorators.get(viewId);
	if (list == null) {
		list = new ArrayList<IDecorator>(2);
		list.add(this);
		allDecorators.put(viewId, list);
	} else if (!list.contains(this)) {
		list.add(this);
	}

	// start listening to changes in resources
	View view = (View) getDecoratorTarget().getAdapter(View.class);
	if (view == null) {
		return;
	}
	Diagram diagramView = view.getDiagram();
	if (diagramView == null) {
		return;
	}
	if (fileObserver == null) {
		FileChangeManager.getInstance().addFileObserver(fileObserver = new MarkerObserver(diagramView));
	}
}