How to make width of palette persistent [message #245251] |
Fri, 29 August 2008 04:51  |
Eclipse User |
|
|
|
Originally posted by: yeronimuz.aol.com
I have a GEF plugin based on the logic diagram plugin example. In my
plugin and in the logic diagram example, the width of the palette is not
maintained in consecutive design sessions, all other views are
maintained through a magic platform mechanism.
How should I make the palette width persistent as well?
Regards,
Jeroen.
|
|
|
|
|
Re: How to make width of palette persistent [message #245266 is a reply to message #245256] |
Fri, 29 August 2008 07:21   |
Eclipse User |
|
|
|
Originally posted by: yeronimuz.aol.com
David BY Chan wrote:
> Jeroen Lankheet wrote:
>> I have a GEF plugin based on the logic diagram plugin example. In my
>> plugin and in the logic diagram example, the width of the palette is
>> not maintained in consecutive design sessions, all other views are
>> maintained through a magic platform mechanism.
>> How should I make the palette width persistent as well?
>>
>> Regards,
>> Jeroen.
> You need implement a interface called
> org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPref erences, in
> which some properties of Palette such as location, width, state will be
> set, and return it for GraphicalEditor, e.g:
>
> public class ModexEditor extends GraphicalEditorWithFlyoutPalette
> {
> .....
> private FlyoutPreferences palettePref = null;
> @override
> protected FlyoutPreferences getPalettePreferences() {
> return palettePref = new
> XXXPalettePreference(XXXPlugin.getPreferenceStore());
> }
> .....
> .....
> @override
> public void dispose() {
> super.dispose();
> persistPalettePreference(XXXPlugin.getPreferenceStore());
> }
> private void persistPalettePreference(IPrerenceStore store)
> {
> .....
> }
> }
Thanks,
I find it rather strange that I need a complete preference store to just
maintain the width. Why can't I just get the width from the
GraphicalEditorWithPalette and store it in the plugin's preference store?
|
|
|
|
Re: How to make width of palette persistent [message #245378 is a reply to message #245374] |
Mon, 08 September 2008 07:13  |
Eclipse User |
|
|
|
Originally posted by: yeronimuz.aol.com
Jeroen Lankheet wrote:
> I'm happy with the GraphicalEditorWithPalette I now have.
> I can store the width of the palette in the core.runtime .settings by
> overriding handlePaletteResized(), but I can't figure out how to
> initialize the palette with the stored value.
> I looked at PaletteViewerPreferences but somehow I think that the width
> is not part of those settings.
> So how do I change the initial size of the palette?
>
>
> sharad wrote:
>> you can also have your pallete in a view and then set its width height
>> in your perspective class or the xml file
>>
>> the viewID for palette is : PaletteView.ID
>> or "org.eclipse.gef.ui.palette_view"
Ooh, that was stupid... It was right in front of my nose.
Overriding the getInitialPaletteSize() did the trick.
|
|
|
Powered by
FUDForum. Page generated in 0.29751 seconds