Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Problems view not refreshed after undo / redo
Problems view not refreshed after undo / redo [message #1151264] Wed, 23 October 2013 08:25 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi all,

I recently implemented some kind of diagram validation.
My validator is executed a first time when I instanciate my "GraphitiToolBehaviorProvider" so that markers are created and displayed in the problems view when the diagram is first loaded.

	public GraphitiToolBehaviorProvider(IDiagramTypeProvider diagramTypeProvider) {
		super(diagramTypeProvider);
		if ((diagValidator = ((GraphitiDiagramTypeProvider)diagramTypeProvider).getDiagramValidator()) != null)
			diagValidator.validate(getFeatureProvider());
	}


Then, the validator is run again in my GraphitiToolBehaviorProvider#postExecute implementation. Actually validation occurs only for some determined features.

	public void postExecute(IExecutionInfo executionInfo) {
		if (diagValidator != null) {
			IFeatureAndContext[] array = executionInfo.getExecutionList();
			if (array.length > 0) {
				IFeatureAndContext fac = array[0];
				if (fac.getFeature() instanceof IAddFeature || fac.getFeature() instanceof IRemoveFeature
						|| fac.getFeature() instanceof IDeleteFeature || fac.getFeature() instanceof IDirectEditingFeature
						|| fac.getFeature() instanceof IUpdateFeature)
					diagValidator.validate(fac.getFeature().getFeatureProvider());
			}
		}
	}


All this works fine, except with undo / redo. In this case, there's no invocation of postExecute. So, validation is not triggered and the problems view not refreshed accordingly.

It seems a validator invocation is missing elsewhere.
Could somebody please tell where to add it ?

Regards,

Laurent
Re: Problems view not refreshed after undo / redo [message #1151462 is a reply to message #1151264] Wed, 23 October 2013 11:13 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Laurent,

that appears to be a gap, there is no global hook to be called when
undo/redo is performed. There are however callbacks in the feature, butthat
would require you to call to validation in each features undo and redo
method...

Would you please file an enhamcement bugzilla for this against Graphiti? I
think there should be hooks postUndo() and postRedo() just like the
postExecute().

Thanks,
Michael
Re: Problems view not refreshed after undo / redo [message #1151499 is a reply to message #1151462] Wed, 23 October 2013 11:41 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
It's done : https://bugs.eclipse.org/bugs/show_bug.cgi?id=420161

Regards,

Laurent
Previous Topic:Create from Custom Feature
Next Topic:How to avoid flickering of zoom slider in graphiti
Goto Forum:
  


Current Time: Thu Apr 25 12:23:10 GMT 2024

Powered by FUDForum. Page generated in 0.03028 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top