Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Palette Drawer Preferences
Palette Drawer Preferences [message #249413] Wed, 24 June 2009 12:39 Go to next message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Hi,
Is there any way to persist the states of palette drawers? For example, I'd
like to be able to recover the expanded/collapsed and pinned states of the
drawers. Any way to add a listener?
thanks alot - Barry
Re: Palette Drawer Preferences [message #249416 is a reply to message #249413] Wed, 24 June 2009 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: modica.cs.tu-berlin.deNOSPAM

Barry Dresdner schrieb:
> Hi,
> Is there any way to persist the states of palette drawers? For example, I'd
> like to be able to recover the expanded/collapsed and pinned states of the
> drawers. Any way to add a listener?
> thanks alot - Barry

Hi Barry,

you can simply tell your FlyoutPaletteComposite to use your plugin
preferences. I found this snippet in my editor:

public void createControl(final Composite parent) {
Plugin plugin = ...
flyoutPaletteComposite = new FlyoutPaletteComposite(
parent,
SWT.NONE,
getSite().getPage(),
new PaletteViewerProvider(getEditDomain()),
FlyoutPaletteComposite.createFlyoutPreferences(
plugin.getPluginPreferences()));

// This sets the state of the flyout palette to "pinned open"
plugin.getPluginPreferences().setValue("org.eclipse.gef.pstate ", 4);
....}

The FlyoutPaletteComposite constructor adapts to the values it finds in
the plugin preferences and keeps them consistent with yout palette
states automatically. I hope this is of any use for you.

Regards,
Tony
Re: Palette Drawer Preferences [message #249420 is a reply to message #249416] Wed, 24 June 2009 14:02 Go to previous messageGo to next message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Hi Tony,
This is exactly what I needed!!
Thanks very much,
Barry

"Tony Modica" <modica@cs.tu-berlin.deNOSPAM> wrote in message
news:h1t858$a1j$1@build.eclipse.org...
> Barry Dresdner schrieb:
>> Hi,
>> Is there any way to persist the states of palette drawers? For example,
>> I'd like to be able to recover the expanded/collapsed and pinned states
>> of the drawers. Any way to add a listener?
>> thanks alot - Barry
>
> Hi Barry,
>
> you can simply tell your FlyoutPaletteComposite to use your plugin
> preferences. I found this snippet in my editor:
>
> public void createControl(final Composite parent) {
> Plugin plugin = ...
> flyoutPaletteComposite = new FlyoutPaletteComposite(
> parent,
> SWT.NONE,
> getSite().getPage(),
> new PaletteViewerProvider(getEditDomain()),
> FlyoutPaletteComposite.createFlyoutPreferences(
> plugin.getPluginPreferences()));
>
> // This sets the state of the flyout palette to "pinned open"
> plugin.getPluginPreferences().setValue("org.eclipse.gef.pstate ", 4);
> ...}
>
> The FlyoutPaletteComposite constructor adapts to the values it finds in
> the plugin preferences and keeps them consistent with yout palette states
> automatically. I hope this is of any use for you.
>
> Regards,
> Tony
Re: Palette Drawer Preferences [message #249422 is a reply to message #249420] Wed, 24 June 2009 18:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: modica.cs.tu-berlin.deNOSPAM

Barry Dresdner schrieb:
> Hi Tony,
> This is exactly what I needed!!
> Thanks very much,
> Barry
>

Glad to hear :-)
OMG, when trying the today's Galileo release I saw that the method
Plugin.getPluginPreferences() has become deprecated. I hope this is
still working correctly. Instead of testing itthoroughly, I better adapt
this part to using the new IEclipsePreferences.

Tony
Re: Palette Drawer Preferences [message #249433 is a reply to message #249422] Fri, 26 June 2009 12:30 Go to previous messageGo to next message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
That's good to know. I'll have to test this myself.
thanks

"Tony Modica" <modica@cs.tu-berlin.deNOSPAM> wrote in message
news:h1ts49$nj0$1@build.eclipse.org...
> Barry Dresdner schrieb:
>> Hi Tony,
>> This is exactly what I needed!!
>> Thanks very much,
>> Barry
>>
>
> Glad to hear :-)
> OMG, when trying the today's Galileo release I saw that the method
> Plugin.getPluginPreferences() has become deprecated. I hope this is still
> working correctly. Instead of testing itthoroughly, I better adapt this
> part to using the new IEclipsePreferences.
>
> Tony
Re: Palette Drawer Preferences [message #249435 is a reply to message #249420] Fri, 26 June 2009 13:28 Go to previous message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Hi Tony,
I am never seeing a call being made to
plugin.getPluginPreferences().setValue("org.eclipse.gef.pstate ", 4);
When I change the state to pinned open. My code looks just like yours:
new FlyoutPaletteComposite(parent, SWT.NONE, getSite().getPage(),
getPaletteViewerProvider(), plugin.getPluginPreferences());
Could I be missing something?
thanks again,
Barry

"Barry Dresdner" <barry.dresdner@softwareagusa.com> wrote in message
news:h1tblp$5lo$1@build.eclipse.org...
> Hi Tony,
> This is exactly what I needed!!
> Thanks very much,
> Barry
>
> "Tony Modica" <modica@cs.tu-berlin.deNOSPAM> wrote in message
> news:h1t858$a1j$1@build.eclipse.org...
>> Barry Dresdner schrieb:
>>> Hi,
>>> Is there any way to persist the states of palette drawers? For example,
>>> I'd like to be able to recover the expanded/collapsed and pinned states
>>> of the drawers. Any way to add a listener?
>>> thanks alot - Barry
>>
>> Hi Barry,
>>
>> you can simply tell your FlyoutPaletteComposite to use your plugin
>> preferences. I found this snippet in my editor:
>>
>> public void createControl(final Composite parent) {
>> Plugin plugin = ...
>> flyoutPaletteComposite = new FlyoutPaletteComposite(
>> parent,
>> SWT.NONE,
>> getSite().getPage(),
>> new PaletteViewerProvider(getEditDomain()),
>> FlyoutPaletteComposite.createFlyoutPreferences(
>> plugin.getPluginPreferences()));
>>
>> // This sets the state of the flyout palette to "pinned open"
>> plugin.getPluginPreferences().setValue("org.eclipse.gef.pstate ", 4);
>> ...}
>>
>> The FlyoutPaletteComposite constructor adapts to the values it finds in
>> the plugin preferences and keeps them consistent with yout palette states
>> automatically. I hope this is of any use for you.
>>
>> Regards,
>> Tony
>
>
Previous Topic:Shapes Exanple in a View with auto layout
Next Topic:FlowLayout not wrapping
Goto Forum:
  


Current Time: Thu Apr 25 01:04:44 GMT 2024

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

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

Back to the top