Palette Drawer Preferences [message #249413] |
Wed, 24 June 2009 08:39  |
Eclipse User |
|
|
|
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 09:02   |
Eclipse User |
|
|
|
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 10:02   |
Eclipse User |
|
|
|
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 #249435 is a reply to message #249420] |
Fri, 26 June 2009 09:28  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04455 seconds