Why the Palette Model has changed [message #68195] |
Tue, 04 March 2003 15:34 |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: none.us.ibm.com
Two big changes have happened to the palette. First, all interfaces were
removed and the default implementations were renamed to the interface names.
The reason for this is to allow for evolution of the palette. If we shipped
with interfaces, we could never add to those interfaces for fear of breaking
someone who decided to reimplement them. Also, there is no reason to have
both interface and implementation in this case. An example of a feature we
might add in the future would be the ability to disable a Tool (i.e. it
becomes gray).
The other change was in PaletteToolEntry. The Logic example *used* to create
a new palette model for every Editor that was opened. This worked fine for
that example. But, given the new cusomization feature, it is more likely
that the palette model is a SINGLETON on the plugin. Thus, when the user
makes changes to the palette (re-ordering, hiding stuff he doesn't use,
etc), these changes will take effect for all Editors of the same type at
once. So, there were concerns with having a single palette model shared
across multiple open editors. The old PaletteToolEntry.getTool() method
looked like it was safe to return the same tool whenever asked. This is not
the case. If the connection tool were being shared across two editors, it
would lead to serious bugs. So, PaletteToolEntries became a "tool factory".
The method was renamed createTool(), and two editors sharing the same
palette would get two separate tool instances.
|
|
|
Powered by
FUDForum. Page generated in 0.02505 seconds