Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Print is disabled in generated code
Print is disabled in generated code [message #74319] Sat, 04 November 2006 17:11 Go to next message
Eclipse UserFriend
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 #74393 is a reply to message #74319] Sun, 05 November 2006 12:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cedric.jeanneret.epfl.ch

Open your GMF Gen model and select the "Gen Plugin" item. In the
property view, you'll find "Printing Enabled" attribute. Set it to true
and re-generate your diagram editor.

Cédric

Michael Moser a écrit :
> 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 #74411 is a reply to message #74393] Mon, 06 November 2006 04:05 Go to previous messageGo to next message
Eclipse UserFriend
Thanks - worked!
Along similar lines: Can one also somehow define the ruler and grid to
be visible by default?

Ideally I also would prefer to have measurements in centimeters and a
specific grid spacing set by default. Or is that taken from the
workspace settings or somewhere else?

Michael


"Cédric Jeanneret" <cedric.jeanneret@epfl.ch> wrote in message
news:eil6vb$mbf$1@utils.eclipse.org...
> Open your GMF Gen model and select the "Gen Plugin" item. In the
> property view, you'll find "Printing Enabled" attribute. Set it to
> true and re-generate your diagram editor.
>
> Cédric
>
> Michael Moser a écrit :
>> 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 #74708 is a reply to message #74411] Mon, 06 November 2006 11:30 Go to previous messageGo to next message
Eclipse UserFriend
The generated diagram code uses the
DiagramPreferenceInitializer#initializeDefaultPreferences() method to
initialize the preferences to their defaults.

You should have a class that extends DiagramPreferenceInitializer. You
can update its initializeDefaultPreferences method to change the default
preferences.

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
}

David


Michael Moser wrote:
> Thanks - worked!
> Along similar lines: Can one also somehow define the ruler and grid to
> be visible by default?
>
> Ideally I also would prefer to have measurements in centimeters and a
> specific grid spacing set by default. Or is that taken from the
> workspace settings or somewhere else?
>
> Michael
>
>
> "Cédric Jeanneret" <cedric.jeanneret@epfl.ch> wrote in message
> news:eil6vb$mbf$1@utils.eclipse.org...
>> Open your GMF Gen model and select the "Gen Plugin" item. In the
>> property view, you'll find "Printing Enabled" attribute. Set it to
>> true and re-generate your diagram editor.
>>
>> Cédric
>>
>> Michael Moser a écrit :
>>> 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 #75201 is a reply to message #74708] Tue, 07 November 2006 07:36 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Print is disabled in generated code [message #75951 is a reply to message #75201] Wed, 08 November 2006 12:44 Go to previous message
Eclipse UserFriend
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
>
>
>
>
Previous Topic:Map-file diagram editor! Bravo!
Next Topic:Display of upper/lower bounds in the ecore diagram editor
Goto Forum:
  


Current Time: Wed Jul 23 16:52:24 EDT 2025

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

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

Back to the top