ActionSet visibility [message #88978] |
Wed, 21 May 2008 05:12 |
|
Hi,
We have the following code :
In plugin.xml:
...
<extension id="com.farbeyond.input.ui.actionSet"
point="org.eclipse.ui.actionSets">
<actionSet id="2.Edit" label="Edit" visible="false">
<action id="menu.edit.new.id" icon="images/new.gif" label="New"
retarget="true"
disabledIcon="images/new_disabled.gif"
toolbarPath="additions/slot.edit/Group1"
tooltip="New"/>
</actionSet>
</extension>
...
In my ActionBarAdvisor:
...
protected void fillCoolBar(ICoolBarManager coolbarManager)
{
coolbarManager.add(new
GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
coolbarManager.appendToGroup(IWorkbenchActionConstants.MB_AD DITIONS,new
GroupMarker("slot.edit"));
}
...
In my IEditorPart:
...
public void init(IEditorSite site, IEditorInput input) throws
PartInitException
{
setSite(site);
setInput(input);
IAction action = new Action()
{
@Override
public void run()
{
System.out.println("new");
}
};
site.getActionBars().setGlobalActionHandler("menu.edit.new.id ", action);
}
...
The above code is to display certain ActionSet when we open an
IEditorPart, it used to work in our old RCP application, but not anymore
(even in RCP).
Right now we have to set the 'visible' attribute in plugin.xml to 'true'
to see the ActionSet, but this makes the ActionSet visible even if there's
no IEditorPart open.
The only workaround I can think of is attaching a IPartListener in the
IEditorPart and calling IWorkbenchPage.showActionSet/hideActionSet on
partActivated/partDeactivated callbacks, but this doesn't seem right to me
since ActionSet visibility should be taken care by the workbench.
Any help would be greatly appreciated.
Best Regards,
Setya
|
|
|
Re: ActionSet visibility [message #89617 is a reply to message #88978] |
Fri, 23 May 2008 12:48 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
you can use EditorActionBarContributor to show/hide menu- and tool-items
if a editor is activated/deactivated.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Setya [mailto:jsetya@gmail.com]
Bereitgestellt: Mittwoch, 21. Mai 2008 07:12
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: ActionSet visibility
Betreff: ActionSet visibility
Hi,
We have the following code :
In plugin.xml:
...
<extension id="com.farbeyond.input.ui.actionSet"
point="org.eclipse.ui.actionSets">
<actionSet id="2.Edit" label="Edit" visible="false"> <action
id="menu.edit.new.id" icon="images/new.gif" label="New"
retarget="true"
disabledIcon="images/new_disabled.gif"
toolbarPath="additions/slot.edit/Group1"
tooltip="New"/>
</actionSet>
</extension>
...
In my ActionBarAdvisor:
...
protected void fillCoolBar(ICoolBarManager coolbarManager) {
coolbarManager.add(new
GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
coolbarManager.appendToGroup(IWorkbenchActionConstants.MB_AD DITIONS,new
GroupMarker("slot.edit"));
}
...
In my IEditorPart:
...
public void init(IEditorSite site, IEditorInput input) throws
PartInitException {
setSite(site);
setInput(input);
IAction action = new Action()
{
@Override
public void run()
{
System.out.println("new");
}
};
site.getActionBars().setGlobalActionHandler("menu.edit.new.id ",
action); } ..
The above code is to display certain ActionSet when we open an
IEditorPart, it used to work in our old RCP application, but not anymore
(even in RCP).
Right now we have to set the 'visible' attribute in plugin.xml to 'true'
to see the ActionSet, but this makes the ActionSet visible even if
there's no IEditorPart open.
The only workaround I can think of is attaching a IPartListener in the
IEditorPart and calling IWorkbenchPage.showActionSet/hideActionSet on
partActivated/partDeactivated callbacks, but this doesn't seem right to
me since ActionSet visibility should be taken care by the workbench.
Any help would be greatly appreciated.
Best Regards,
Setya
|
|
|
Re: ActionSet visibility [message #89654 is a reply to message #89617] |
Fri, 23 May 2008 13:42 |
|
Frank,
> you can use EditorActionBarContributor to show/hide menu- and tool-items
> if a editor is activated/deactivated.
Thanks for your suggestion above.
I've tried with EditorActionBarContributor but it didn't work either. The
strange thing is the code I posted earlier used to work in RCP. I only
have to call site.getActionBars().setGlobalActionHandler to make them
visible.
Regards,
Setya
|
|
|
Powered by
FUDForum. Page generated in 0.03611 seconds