Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] Mechanism for setting default tree images

Hi Heiko and riena-dev,

I've been thinking about the TreeRidgetLabelProvider today.

I'm not happy with the way it uses some hacks ("magic" strings from
the widget -- see TRLP.TREE_KIND_KEY and TRLP.TREE_KIND_NAVIGATION) to
use different default icons in trees from the navigation bundle.

Instead I propose to use a setter to configure a trio of default
images for open node, close node, leaf (strategy pattern). This would
remove any navigation specific code from TRLP and simplify the logic a
lot. The images are used when no image is given via a formatter or via
the model. API would look like this:

treeRidget.setDefaultImages(new NavigationTreeImages());

Riena would come with three strategies (the user can implement more):

(a) NavigationTreeImages: set when configuring the navigation tree
ridget in SWTModuleController - uses images from LnFKeyConstants
SUB_MODULE_TREE_FOLDER_{OPEN, CLOSED}_ICON
(b) WorkareaTreeImages: default strategy used when nothing else is
provided - uses images from
LnFKeyConstants.WORKAREA_TREE_FOLDER_{OPEN,CLOSED}_ICON
(c) SnippetTreeImages: uses SharedImages - the Ridget would use this
instead of WorkareaTreeImages when it detects no OSGi - needed for the
Snippets

Thoughts and feedback?

Kind regards,
Elias.

-- 
Elias Volanakis | Technical Lead | http://eclipsesource.com
elias@xxxxxxxxxxxxxxxxx | +1 503 929 5537 | @evolanakis


Back to the top