|
|
Re: activate print preview dialog [message #219855 is a reply to message #219847] |
Tue, 24 February 2009 10:58 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
Adrian Gygax schrieb:
> Hi Ralf,
>
> Do you want to create your own print preview dialog or do you just want
> to enable the default one?
>
> In the latter case, just set the property "Printing Enabled" for "Gen
> Plugin" in your gmfgen file to true.
I want to enable the default one. The property is set to true, yet. But
I get only the Print dialog, not the Print Preview dialog. In general,
how can I add an arbitrary ItemProvider to the application? I think, if
I activate the ContributionItemProvider with its
RenderedPrintPreviewAction inside then I could solve the problem.
Greetings,
Ralf.
>
> R. Heydenreich schrieb:
>> Hi all,
>> I've modeled a GMF application which runs fine. No I want to add a
>> print preview dialog. I see that in the generated classes
>> (..processmodel.model.diagram.providers) is a class
>> (ProjectnameContributionItemProvider) that holds a createAction method
>> which in turn calls RenderedPrintPreviewAction. But I don't know where
>> I have to activate this class. In the extension points I'm not able to
>> add this class for an item because it's not in the list.
>>
>> How can I do this? Thanks in advance,
>> Ralf.
|
|
|
SOLVED: activate print preview dialog [message #220169 is a reply to message #219855] |
Fri, 27 February 2009 10:12 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
R. Heydenreich schrieb:
> Adrian Gygax schrieb:
>> Hi Ralf,
>>
>> Do you want to create your own print preview dialog or do you just
>> want to enable the default one?
>>
>> In the latter case, just set the property "Printing Enabled" for "Gen
>> Plugin" in your gmfgen file to true.
>
> I want to enable the default one. The property is set to true, yet. But
> I get only the Print dialog, not the Print Preview dialog. In general,
> how can I add an arbitrary ItemProvider to the application? I think, if
> I activate the ContributionItemProvider with its
> RenderedPrintPreviewAction inside then I could solve the problem.
>
> Greetings,
> Ralf.
>
>>
>> R. Heydenreich schrieb:
>>> Hi all,
>>> I've modeled a GMF application which runs fine. No I want to add a
>>> print preview dialog. I see that in the generated classes
>>> (..processmodel.model.diagram.providers) is a class
>>> (ProjectnameContributionItemProvider) that holds a createAction
>>> method which in turn calls RenderedPrintPreviewAction. But I don't
>>> know where I have to activate this class. In the extension points I'm
>>> not able to add this class for an item because it's not in the list.
>>>
>>> How can I do this? Thanks in advance,
>>> Ralf.
Hi all,
after a bunch of sleepless nights I found the solution ;-) I have to
overwrite the init() method in my DiagramActionBarContributor:
/**
* @generated NOT
*/
public void init(IActionBars bars, IWorkbenchPage page) {
super.init(bars, page);
// print preview
IMenuManager fileMenu =
bars.getMenuManager().findMenuUsingPath(IWorkbenchActionCons tants.M_FILE);
assert fileMenu != null;
IAction printPreviewAction = new RenderedPrintPreviewAction(new
EnhancedPrintActionHelper());
fileMenu.insertBefore("close", printPreviewAction); //$NON-NLS-1$
IAction pageSetupAction = new
org.eclipse.gmf.runtime.diagram.ui.actions.internal.PageSetu pAction();
}
That's all.
Greetz,
R.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03247 seconds