Skip to main content



      Home
Home » Eclipse Projects » GEF » dynamic palette items based on editor selection
dynamic palette items based on editor selection [message #18193] Tue, 27 August 2002 13:42 Go to next message
Eclipse UserFriend
Hi-
I'm relatively new to GEF and was wondering--is it possible to use a
GraphicalEditorWithPalette where some of the palette items (or categories)
are dynamic based on the selection in the editor.

For example (based a bit on the logic editor). The logic editor palette
consists of 3 categories--the default category that contains the Marquee and
Connection tools, the Components category that contains many of the
low-level elements to a circuit (OR, XOR, AND, LED, etc.), and lastly a
Canned Parts category that contains composite logic elements. Lets say that
I want to expand the logic palette for different microprocessor items (ie.,
each processor family gets its own palette category). In order to prevent
the number of palette items from growing beyond the real estate of the
editor, I want to make them a bit more dynamic so that based on the active
selection in the editor, the palette category for that selection is
enabled/visible.

Ideally I would like to be able to show/hide the high-level categories based
on selection. If show/hide isn't possible, what about enable/disable.

Any help would be appreciated!
Erik
Re: dynamic palette items based on editor selection [message #18230 is a reply to message #18193] Tue, 27 August 2002 14:54 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.spam.com

The current model for the palette is simple and does not include any
notification mechanism. We have asked for help on the mailing list in
building requirements for a better palette.

That said, if you were to extend out Palette class and add a notification
mechanism, and then extend our SliderPaletteEditPart to make it listen to
your notification system, it would be trivial to have categories appear and
disappear. You would just have to call refresh() when the model fires.

On a side note, I don't think that a selection-based palette is the most
user friendly. If you have too many categories, maybe a drop-down combo box
in the last category would be a better way to cause the avaible items to
change. This way, changing selection wouldn't cause strange side-effects in
the palette.

"Erik Johnson" <ejohnson@avaya.com> wrote in message
news:akgd27$k5u$1@rogue.oti.com...
> Hi-
> I'm relatively new to GEF and was wondering--is it possible to use a
> GraphicalEditorWithPalette where some of the palette items (or categories)
> are dynamic based on the selection in the editor.
>
> For example (based a bit on the logic editor). The logic editor palette
> consists of 3 categories--the default category that contains the Marquee
and
> Connection tools, the Components category that contains many of the
> low-level elements to a circuit (OR, XOR, AND, LED, etc.), and lastly a
> Canned Parts category that contains composite logic elements. Lets say
that
> I want to expand the logic palette for different microprocessor items
(ie.,
> each processor family gets its own palette category). In order to prevent
> the number of palette items from growing beyond the real estate of the
> editor, I want to make them a bit more dynamic so that based on the active
> selection in the editor, the palette category for that selection is
> enabled/visible.
>
> Ideally I would like to be able to show/hide the high-level categories
based
> on selection. If show/hide isn't possible, what about enable/disable.
>
> Any help would be appreciated!
> Erik
>
>
Previous Topic:Grid
Next Topic:Sticky Selection of a tool
Goto Forum:
  


Current Time: Sun Jul 13 20:55:40 EDT 2025

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

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

Back to the top