Page 1 of 1

Refreh triggering stylesFilter

Posted: Mon Oct 01, 2012 3:56 pm
by SNO
Hallo,

I am using the Oxygen Eclipse Plugin and I am trying to refresh the editoPage after downloading a graphic from my CMS.

My usecase is following:
  • I queried a graphic publicID from my CMS (without real content).
  • I dragged the Graphic Item into the Oxygen Editor Page and added the Image tag with the publicID of the image.
  • I download the Image on Drop
The Problem is that the Editor has no graphic to display after inserting the image tag. Therefor I need to refresh the editor after downloading the graphic.

If I use the F5 shortcut everything works fine but not with the refresh method of the editorPage.

Code: Select all

IEditorPart activeEditor = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
if (activeEditor instanceof WSEditor) {
WSEditor editor = (WSEditor) activeEditor;
WSEditorPage editorPage = editor.getCurrentPage();

if (editorPage instanceof WSAuthorEditorPage) {
WSAuthorEditorPage authorEditorPage = (WSAuthorEditorPage) editorPage;

authorEditorPage.refresh();
}
}
Am I doing something wrong?
Best Regards
Stefan

Re: Refreh triggering stylesFilter

Posted: Mon Oct 01, 2012 4:19 pm
by Radu
Hi Stefan,

Does the StylesFilter provide the means to resolve the image?

Could you try two things?

1) Call the refresh API a little bit later using Display.getDefault().asyncExec

2) Also call this code:

Code: Select all

ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().clearImageCache();
before calling the refresh API.

Regards,
Radu

Re: Refresh triggering stylesFilter

Posted: Thu Oct 04, 2012 12:24 pm
by SNO
Hi Radu,

thanx very much for your quick answer!!

Your advise 2) calling the clearImageCache() works fine and triggers the reload of my images.

My call to to the refresh is already late enough so i just had to call the clearImageCache before.

We use the stylesfilter to retrieve the graphics absolute path.

Best Regards,
Stefan