Order of Toolbars on the Coolbar [message #458314] |
Thu, 16 November 2006 18:02  |
Eclipse User |
|
|
|
Hi,
I have big problems with bad ordering of Toolbars in my RCP app. I am adding several Toolbars from fillCoolBar method and others from XML configuration. Its reversed etc etc.
Is it possible to explicitly re-order the toolbars on my coolbar? I want to have the toolbar with New-Open-Save actions first but I am not able to do this.
Thanks in advance for help.
Lukas
|
|
|
|
Re: Order of Toolbars on the Coolbar [message #458324 is a reply to message #458322] |
Fri, 17 November 2006 05:04   |
Eclipse User |
|
|
|
Originally posted by: peter_ossipov.mail.ru
Hello Bhupendra !
Thanks very much for the answer! It is very useful indeed, but it does
not just answer my question in full. :-)
Again, thanks for it.
It strikes me, that I can use menubarPath element. Though I do not
understand how to populate in a menumanger available menu paths. How do
I do that? For example, this path file/open/open.ext
where "open" subpath is coming from? Does it appear anywhere in the
code, because file - does in IWorkbenchActionConstants.M_FILE?
Bhupendra Bhardwaj wrote:
> Hi,
>
> This is what eclipse doc says-
> "If two or more actions are contributed to a menu or toolbar by a single extension the actions will appear in the reverse order of how they are listed in the plugin.xml file. This behavior is admittedly unintuitive. However, it was discovered after the Eclipse Platform API was frozen. Changing the behavior now would break every plug-in which relies upon the existing behavior. "
>
> You can read it in -
> http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/extension-points/org_eclipse_ui_a ctionSets.html
>
> So, what I understand from your problem, you will have to add actions in reverse order of what you want.
>
> Cheers!
>
|
|
|
Re: Order of Toolbars on the Coolbar [message #458330 is a reply to message #458324] |
Fri, 17 November 2006 08:56   |
Eclipse User |
|
|
|
Peter Osipov wrote:
> Hello Bhupendra !
> Thanks very much for the answer! It is very useful indeed, but it does
> not just answer my question in full. :-)
> Again, thanks for it.
> It strikes me, that I can use menubarPath element. Though I do not
> understand how to populate in a menumanger available menu paths. How do
> I do that? For example, this path file/open/open.ext
> where "open" subpath is coming from? Does it appear anywhere in the
> code, because file - does in IWorkbenchActionConstants.M_FILE?
In eclipse, the WorkbenchActionBuilder adds the basic framework to the
main menu bar. i.e. it adds file and close.ext. Then any declaration
(like an actionSet) must supply it's menu path. You can use any path
that was contributed by the WorkbenchActionBuilder, but not by another
declaration.
In RCP, your ApplicationActionBarAdvisor adds the basic menu framework.
It works the same way (WorkbenchActionBuilder is the eclipse SDK
application action bar advisor).
The paths themselves should be an optional path of menuIds followed by a
group. For example, file/close.ext (file is a menuId and close.ext is a
group). Or navigate/goTo/additions (navigate is the main menu id, goTo
is a submenu id, and additions is the group).
Later,
PW
|
|
|
|
|
|
|
Re: Order of Toolbars on the Coolbar (long -- pastebin) [message #459046 is a reply to message #458382] |
Mon, 27 November 2006 16:01   |
Eclipse User |
|
|
|
> Anything that you add programmatically you can
> control where it goes.
> Anything that comes in from actionSets ... well,
> those will definitely
> be in reverse order.
>
> But you can build the basic structure of the coolbar
> and then add
> actions to them afterwards. Check out how
> WorkbenchActionBuilder
> creates the main coolbar for eclipse (it's in the
> org.eclipse.ui.ide
> project).
Hello, I have tried everything with no luck. I spent a week with testing, studing Eclipse code, searching. I am providing full source my actionset, could anybody help me to order my XML elements to achieve this order (left to right):
- file (new, open)
- edit (select, translate, rotate...)
- filters (filter, filter points, filter lines...)
- options (point ant click button)
I am not able to find THE KEY. Eclipse always position in this strange order (left to right):
- filters (filter, filter points, filter lines...)
- options (point ant click button)
- file (new, open)
- edit (select, translate, rotate...)
I have all items in descending order, my fillCoolbar method is empty (I do not add anything programatically)
(longer XML file)
http://paste2.org/p/435
|
|
|
|
Re: Order of Toolbars on the Coolbar (long -- pastebin) [message #459134 is a reply to message #459046] |
Tue, 28 November 2006 10:11   |
Eclipse User |
|
|
|
Lukas Zapletal wrote:
> Hello, I have tried everything with no luck. I spent a week with testing, studing Eclipse code, searching. I am providing full source my actionset, could anybody help me to order my XML elements to achieve this order (left to right):
> - file (new, open)
> - edit (select, translate, rotate...)
> - filters (filter, filter points, filter lines...)
> - options (point ant click button)
>
> I am not able to find THE KEY. Eclipse always position in this strange order (left to right):
> - filters (filter, filter points, filter lines...)
> - options (point ant click button)
> - file (new, open)
> - edit (select, translate, rotate...)
I wasn't clear in my post ... within an actionSet, <action/> elements
are filled in the reverse order. Between actionSets, the order will
always be non-deterministic. *always*
Programmatically is the only way to really control order. AFAIK, you
would need to programmatically add groups and ToolBarManagers to the
coolbar, and then use the actionSets to fill in the actions.
Check out the way WorkbenchActionBuilder adds things like the Help
Toolbar group in fillCoolBar(*).
Later,
PW
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09168 seconds