|Print from multi-page editor w/ a GEF page [message #216821]
||Thu, 25 May 2006 11:16
Originally posted by: eclipse.chris-lott.org|
I know about GEF's PrintAction and it works well for a single-page editor.
Now I'm extending the editor to have multiple pages. One page has a GEF
viewer, another page just has some text. I would like the print action to
work on both pages. I register a print action in the action bar
contributor and in the editor, and GEF print fires up fine. The problem
is that I need to use different print actions for the different pages: the
GEF print action for the GEF page, and a text print action for the other
page. I don't know how to do this. I guess I could implement some kind
of delegating print action, but I don't think I have found the plain-text
print action used in stock Eclipse editors.
If it is impossible to have different print actions, then it would be ok
if I could simply disable print when the non-GEF page is showing, but I
have not figured that out either. Something has to manage the enablement
of the Print item in the File menu.
The plugin manifest editor demonstrates something like this: the forms
pages cannot be printed, but the plain-text pages (plugin.xml,
MANIFEST.MF) can be printed just fine. I think this comes from
AbstractTextEditor.createActions() where a TextOperationAction is created
and registered. But I have not been able to find how that multi-page
editor manages the enablement of the print action.
I feel like the pieces of this puzzle are right in front of me, yet I
cannot quite fit them together. Thanks in advance for any and all help!
Powered by FUDForum
. Page generated in 0.31770 seconds