Print is disabled in generated code [message #74319] |
Sat, 04 November 2006 17:11  |
Eclipse User |
|
|
|
The "Print" command (File => Print) is always disabled in my generated
application. What's the reason for this? Do I have to add something or
enable this somehow? Or is this just "not-yet-implemented"?
Michael
|
|
|
|
|
|
|
Re: Print is disabled in generated code [message #75951 is a reply to message #75201] |
Wed, 08 November 2006 12:44  |
Eclipse User |
|
|
|
Michael,
You don't need a preference page to set the default preferences for your
diagram. The preference page simply allows users to modify their diagram
preferences through the eclipse preferences window.
You are correct in saying that GMF's diagram generation does not create
a preference page for your diagram. I don't think you can enable GMF to
generate that code, but perhaps somebody who is more familiar with the
diagram generation can confirm?
With that said, the GMF runtime provides several preference pages that
you can include in your plugin. Adding these pages to your plugin is
straightforward. You simply need to add an extension in your plugin.xml
and extend the GMF runtime preference page to use your plugin's
preference store.
Have a look at the org.eclipse.ui.preferencePages extension in the
LogicDiagram plugin.xml and the LogicRulerGridPreferencePage class.
David
Michael Moser wrote:
> Hi David,
>
> "David Cummings" <dcummin@ca.ibm.com> wrote in message
> news:eino26$296$1@utils.eclipse.org...
>> ..
>> Using the logic diagram code as an example, update
>> LogicPreferenceInitializer#initializeDefaultPreferences method to:
>>
>> public void initializeDefaultPreferences() {
>> super.initializeDefaultPreferences();
>>
>> // Resetting appearance settings in the logic preference store
>> IPreferenceStore store = getPreferenceStore();
>> LogicAppearancePreferencePage.initDefaults(store);
> ###############################
>
>> // begin new code
>> store.setDefault(IPreferenceConstants.PREF_SHOW_GRID, true);
>> store.setDefault(IPreferenceConstants.PREF_SHOW_RULERS, true);
>> store.setDefault(IPreferenceConstants.PREF_GRID_SPACING, 1.00);
>> store.setDefault(IPreferenceConstants.PREF_RULER_UNITS,
>> RulerProvider.UNIT_CENTIMETERS);
>> // end new code
>> }
>
> Thanks for writing actual code for me! Highly appreciated! ;-)
>
> One problem left: the pref-page's name (marked with #### above):
>
> I searched for <project>AppearancePreferencePage and
> <root-element-name>AppearancePreferencePage etc. but I can't seem to
> find any class whose name corresponds to
> "(Logic(Appearance))PreferencePage" in my code.
>
> What's the policy that GMF's diagram generation uses to generate the
> plugin's Preference page and in particular that name? Or actually,
> looking closer: my GMF generated plugin doesn't have any preference
> page, yet. Can one enable GMF to generate that code as well or would
> that have to be hand-written code?
>
> Michael
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05152 seconds