palette reload [message #184013] |
Thu, 09 June 2005 10:04 |
Eclipse User |
|
|
|
Originally posted by: penzhan8451.yahoo.com
Hi,
Now , I want to dynamic config my editor's palette according to a value
defined in property file (example : if 'yes', i will display a tool in the
palette; or disappear the tool).
how could i reach it ? would you like to help me ?
Thanks & best regards.
|
|
|
Re: palette reload [message #184049 is a reply to message #184013] |
Thu, 09 June 2005 17:59 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
Hi There,
I had asked a similar question earlier. If you want to dynamically add a
tool based on some criteria such as you outlined, from the editor you need
to get the PaletteRoot. From the PaletteRoot, I will assume you are using
Drawer's to group objects and that the Tool Entries are of type
CombinedTemplateCreationEntry. Then you simply append the tool to the
group. Here is a psuedo example.
//Get the drawer of interest from the PaletteRoot (You might want to
expose this for ease of use)
PaletteDrawer socDrawer = _DelegatePaletteCreator.getSocDrawer();
//Create the tool entry (if not already done)
CombinedTemplateCreationEntry dpEntry = new
CombinedTemplateCreationEntry(...)
//And now simply add
socDrawer.add(dpEntry);
It will dynamically show up in the palette. You can do the reverse just
as easily by removing the dpEntry.
Regards,
Harsh
|
|
|
|
Powered by
FUDForum. Page generated in 0.02516 seconds