Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Main menu drop down event and mouse hover on Main menus.(How to?)
Main menu drop down event and mouse hover on Main menus. [message #658456] Tue, 08 March 2011 15:25 Go to next message
amir  is currently offline amir Friend
Messages: 16
Registered: September 2010
Junior Member
Hey there
As the topic says, how to print ("File main menu pressed") when i press on File Main menu in the workbench of eclipse?
I know it has to be with Listeners, but i cannot figure out how exactly.
The same thing for mouse hover.
thanks for help

Amir

[Updated on: Tue, 08 March 2011 15:26]

Report message to a moderator

Re: Main menu drop down event and mouse hover on Main menus. [message #658503 is a reply to message #658456] Tue, 08 March 2011 18:15 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/08/2011 10:25 AM, amir wrote:
> Hey there
> As the topic says, how to print ("File main menu pressed") when i press
> on File Main menu in the workbench of eclipse? I know it has to be with
> Listeners, but i cannot figure out how exactly.
> thanks for help

That menu is not exposed through API, at least not in the eclipse IDE.

What are you trying to do exactly? What is it you want to accomplish?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Main menu drop down event and mouse hover on Main menus. [message #658513 is a reply to message #658503] Tue, 08 March 2011 19:24 Go to previous messageGo to next message
amir  is currently offline amir Friend
Messages: 16
Registered: September 2010
Junior Member
A part my project is to build plug-in to recommend for menuitems in the main menu of eclipse. So i need some sort of highlight at menuItem when i drop down menu(File).
I know for example to Listen for command From menuItem with this code:
private IExecutionListener listener = new IExecutionListener() {
		
		@Override
		public void postExecuteSuccess(String commandId, Object returnValue) {
			System.out.println(commandId);
}
		
	};
	
	public void setWorkbench(IWorkbench workbench) {	
		getCommandService(workbench).addExecutionListener(listener);
	}

	public void unsetWorkbench(IWorkbench workbench) {
		getCommandService(workbench).removeExecutionListener(listener);
	}
	
	private ICommandService getCommandService(IWorkbench workbench) {
		return (ICommandService)workbench.getAdapter(ICommandService.class);
	}


so now i need something similar to it(if it possible) to listen for drop down even, or mouse hover event, anything that helps me to Listen.

hope this explains my problem.
thanks
Re: Main menu drop down event and mouse hover on Main menus. [message #658686 is a reply to message #658513] Wed, 09 March 2011 13:18 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/08/2011 02:24 PM, amir wrote:
> A part my project is to build plug-in to recommend for menuitems in the
> main menu of eclipse. So i need some sort of highlight at menuItem when
> i drop down menu(File).

Can you even do that in SWT? ... I mean, highlight a specific menu
item? I know you can't highlight more than one, and at least on GTK you
can't do other things while the SWT Menu is showing.

2 things come to mind.

1) go to the Menu snippets on http://www.eclipse.org/swt/snippets/ like
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.sn ippets/src/org/eclipse/swt/snippets/Snippet29.java?view=co
and try and get the menu to do what you want. You have full access to
all the SWT widgets.

2) have a look at subclasses of
org.eclipse.ui.internal.quickaccess.QuickAccessProvider as used from
org.eclipse.ui.internal.quickaccess.QuickAccessDialog. It scans the
different parts of the system, allowing users to find what they're
looking for and maintains a "suggestions" section (recently used). You
can see quick access in action using CTRL+3

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Main menu drop down event and mouse hover on Main menus. [message #658687 is a reply to message #658513] Wed, 09 March 2011 13:20 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/08/2011 02:24 PM, amir wrote:
> A part my project is to build plug-in to recommend for menuitems in the
> main menu of eclipse. So i need some sort of highlight at menuItem when
> i drop down menu(File).

Can you even do that in SWT? ... I mean, highlight a specific menu
item? I know you can't highlight more than one, and at least on GTK you
can't do other things while the SWT Menu is showing.

2 things come to mind.

1) go to the Menu snippets on http://www.eclipse.org/swt/snippets/ like
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.sn ippets/src/org/eclipse/swt/snippets/Snippet29.java?view=co
and try and get the menu to do what you want. You have full access to
all the SWT widgets.

2) have a look at subclasses of
org.eclipse.ui.internal.quickaccess.QuickAccessProvider as used from
org.eclipse.ui.internal.quickaccess.QuickAccessDialog. It scans the
different parts of the system, allowing users to find what they're
looking for and maintains a "suggestions" section (recently used). You
can see quick access in action using CTRL+3

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Main menu drop down event and mouse hover on Main menus. [message #658688 is a reply to message #658513] Wed, 09 March 2011 13:20 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I've also moved this discussion to eclipse.platform, as it is not
relevant to java tools but plugin development.

I will no longer respond here.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:New server dialog does not accept localhost with dot
Next Topic:temporary overlay window on Java editor
Goto Forum:
  


Current Time: Tue Apr 23 05:32:54 GMT 2024

Powered by FUDForum. Page generated in 0.02952 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top