|
PTP Release 7.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
org.eclipse.ptp.pldt.common.actions.AnalysisDropdownHandler
public class AnalysisDropdownHandler
Default handler for the "Parallel Analysis" toolbar icon command - the work would be done by the menus that get registered (by other plugins) to appear beneath it, but this itself can do something useful by repeating the last-initiated submenu action. ("Do the last thing again") This class also acts as a single point to cache the current structured selection so that when a menu item is selected, the current selection can be accessed. It registers as a selection listener to actively listen for selection changes, instead of relying on HandlerUtil which won't get the first one (e.g. before the plugin is loaded).
| Field Summary | |
|---|---|
protected static AnalysisDropdownHandler |
instance
|
protected static RunAnalyseHandler |
lastAnalysisHandler
|
protected static org.eclipse.jface.viewers.IStructuredSelection |
lastAnalysisSelection
|
protected org.eclipse.jface.viewers.IStructuredSelection |
lastSelection
|
| Constructor Summary | |
|---|---|
AnalysisDropdownHandler()
Constructor: set singleton instance, and set up selection listener to listen for selections so we can report them more efficiently than relying on HandlerUtil.getCurrentSelection(); if the current selection isn't a structured selection (e.g. editor selection or something we don't care about) then we want the last structured selection. |
|
| Method Summary | |
|---|---|
java.lang.Object |
execute(org.eclipse.core.commands.ExecutionEvent event)
|
static AnalysisDropdownHandler |
getInstance()
Get the singleton instance of this class, probably for accessing its knowledge about the current/last selection of interest. |
static org.eclipse.jface.viewers.IStructuredSelection |
getLastAnalysisSelection()
For repeat analysis (clicking on the icon in the toolbar) returns the previous selection so that it can be reused |
org.eclipse.jface.viewers.IStructuredSelection |
getLastSelection()
The last structured selection seen (e.g. selection of a file, folder, or project within the Project Explorer) |
void |
selectionChanged(org.eclipse.ui.IWorkbenchPart part,
org.eclipse.jface.viewers.ISelection selection)
Implemented for SelectionListener interface: Listen for selection changes and cache the ones that might be interesting to us. |
static void |
setLastHandledAnalysis(RunAnalyseHandler handler,
org.eclipse.jface.viewers.IStructuredSelection selection)
Remember what was last executed, so that we can give a repeat performance |
| Methods inherited from class org.eclipse.core.commands.AbstractHandler |
|---|
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabled |
| Methods inherited from class org.eclipse.core.commands.common.EventManager |
|---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static RunAnalyseHandler lastAnalysisHandler
protected static org.eclipse.jface.viewers.IStructuredSelection lastAnalysisSelection
protected org.eclipse.jface.viewers.IStructuredSelection lastSelection
protected static AnalysisDropdownHandler instance
| Constructor Detail |
|---|
public AnalysisDropdownHandler()
| Method Detail |
|---|
public java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event)
throws org.eclipse.core.commands.ExecutionException
execute in interface org.eclipse.core.commands.IHandlerorg.eclipse.core.commands.ExecutionException
public static void setLastHandledAnalysis(RunAnalyseHandler handler,
org.eclipse.jface.viewers.IStructuredSelection selection)
handler - selection - - cache the selection too; this will be used as a last
resort if another analysis doesn't see a recent selection it likes.public static org.eclipse.jface.viewers.IStructuredSelection getLastAnalysisSelection()
public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
org.eclipse.jface.viewers.ISelection selection)
selectionChanged in interface org.eclipse.ui.ISelectionListenerpublic org.eclipse.jface.viewers.IStructuredSelection getLastSelection()
public static AnalysisDropdownHandler getInstance()
|
PTP Release 7.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||