Skip to main content



      Home
Home » Eclipse Projects » GEF » How to make width of palette persistent
How to make width of palette persistent [message #245251] Fri, 29 August 2008 04:51 Go to next message
Eclipse UserFriend
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 #245256 is a reply to message #245251] Fri, 29 August 2008 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lifesting.gmail.com

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)
{
.....
}
}
Re: How to make width of palette persistent [message #245261 is a reply to message #245251] Fri, 29 August 2008 06:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

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"
Re: How to make width of palette persistent [message #245266 is a reply to message #245256] Fri, 29 August 2008 07:21 Go to previous messageGo to next message
Eclipse UserFriend
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 #245374 is a reply to message #245261] Mon, 08 September 2008 06:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yeronimuz.aol.com

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"
Re: How to make width of palette persistent [message #245378 is a reply to message #245374] Mon, 08 September 2008 07:13 Go to previous message
Eclipse UserFriend
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.
Previous Topic:container edit part
Next Topic:Setting SnapToGrid
Goto Forum:
  


Current Time: Wed Jul 16 04:32:52 EDT 2025

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

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

Back to the top