Package org.eclipse.ui.actions
Class QuickMenuCreator
java.lang.Object
org.eclipse.ui.actions.QuickMenuCreator
Abstract class that is capable of creating a context menu. It will try and
open the menu close to the current selection, or under the mouse pointer if
that's not possible.
- Since:
- 3.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Point
Hook to compute the menu location if the focus widget is a styled text widget.protected Point
computeMenuLocation
(Control focus) Determine the optimal point for this menu to appear.protected Point
computeMenuLocation
(Table table) Hook to compute the menu location if the focus widget is a table widget.protected Point
computeMenuLocation
(Tree tree) Hook to compute the menu location if the focus widget is a tree widget.void
Create and open the context menu.void
dispose()
Deprecated.protected abstract void
fillMenu
(IMenuManager menu) Create the contents of the context menu.
-
Constructor Details
-
QuickMenuCreator
public QuickMenuCreator()
-
-
Method Details
-
createMenu
public void createMenu()Create and open the context menu. -
fillMenu
Create the contents of the context menu.- Parameters:
menu
- the menu to fill
-
computeMenuLocation
Determine the optimal point for this menu to appear.- Parameters:
focus
- the focus control- Returns:
- the optimal placement
- Since:
- 3.5
-
computeMenuLocation
Hook to compute the menu location if the focus widget is a styled text widget.- Parameters:
text
- the styled text widget that has the focus- Returns:
- a widget relative position of the menu to pop up or
null
if now position inside the widget can be computed - Since:
- 3.5
-
computeMenuLocation
Hook to compute the menu location if the focus widget is a tree widget.- Parameters:
tree
- the tree widget that has the focus- Returns:
- a widget relative position of the menu to pop up or
null
if now position inside the widget can be computed - Since:
- 3.5
-
computeMenuLocation
Hook to compute the menu location if the focus widget is a table widget.- Parameters:
table
- the table widget that has the focus- Returns:
- a widget relative position of the menu to pop up or
null
if now position inside the widget can be computed - Since:
- 3.5
-
dispose
Deprecated.As of 3.5 this is not necessary as the SWT Menu created increateMenu()
will be disposed shortly after the SWT.Hide event.Dispose of this quick menu creator. Subclasses should ensure that they call this method.
-
createMenu()
will be disposed shortly after the SWT.Hide event.