Context menu and Print [message #185149] |
Thu, 23 June 2005 03:44  |
Eclipse User |
|
|
|
Originally posted by: ngocdannytn.sbcglobal.net
Hi,
I tried to add Print action into my context menu as below
GEFActionConstants.addStandardActionGroups(menu);
IAction action;
action = getActionRegistry().getAction(ActionFactory.PRINT.getId());
menu.appendToGroup(GEFActionConstants.GROUP_PRINT, action);
However, the popup menu shows the item with no text/label eventhough
clicking on the menu item still executes the PRINT action. Please help.
Thank you.
Danny
|
|
|
|
|
Re: Context menu and Print [message #192163 is a reply to message #185149] |
Mon, 15 August 2005 12:40   |
Eclipse User |
|
|
|
On Thu, 23 Jun 2005 00:44:12 -0700, Danny Nguyen wrote:
> However, the popup menu shows the item with no text/label eventhough
> clicking on the menu item still executes the PRINT action. Please help.
Danny, did you ever find a solution to your problem?
I am having the same problem with Cut, Copy, and Paste actions that I am
trying to contribute to the context menu. When I add the same actions
to the toolbar or a menu, the cut, copy, paste images appear as normal.
|
|
|
Re: Context menu and Print [message #192170 is a reply to message #192163] |
Mon, 15 August 2005 13:13   |
Eclipse User |
|
|
|
On Mon, 15 Aug 2005 12:40:15 -0400, Nick Allen wrote:
> I am having the same problem with Cut, Copy, and Paste actions that I am
> trying to contribute to the context menu. When I add the same actions
> to the toolbar or a menu, the cut, copy, paste images appear as normal.
The problems seem to only appear with actions which are not
always enabled. For instance, my cut and copy actions are only enabled
when a copy-able/cut-able element is selected.
I would like the behavior of the provided Delete action. If the
action is not enabled, the action appears shaded in the context menu, but
still visible.
|
|
|
Re: Context menu and Print [message #192178 is a reply to message #192170] |
Mon, 15 August 2005 13:32  |
Eclipse User |
|
|
|
On Mon, 15 Aug 2005 13:13:42 -0400, Nick Allen wrote:
> I would like the behavior of the provided Delete action. If the
> action is not enabled, the action appears shaded in the context menu, but
> still visible.
After looking at the provided DeleteAction I found the problem. I needed
to provide the proper images, tooltip text, etc for the CopyAction,
CutAction, and PasteActions that I created.
I simply followed the lead of DeleteAction.init()...
/**
* Initializes this action's text and images.
*/
protected void init() {
super.init();
setText(GEFMessages.DeleteAction_Label);
setToolTipText(GEFMessages.DeleteAction_Tooltip);
setId(ActionFactory.DELETE.getId());
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
setImageDescriptor(sharedImages.getImageDescriptor(ISharedIm ages.IMG_TOOL_DELETE));
setDisabledImageDescriptor(sharedImages.getImageDescriptor(
ISharedImages.IMG_TOOL_DELETE_DISABLED));
setEnabled(false);
}
|
|
|
Powered by
FUDForum. Page generated in 0.12555 seconds