|
PTP Release 7.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAbstractHandler
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 IStructuredSelection |
lastAnalysisSelection
|
protected 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 | |
|---|---|
Object |
execute(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 IStructuredSelection |
getLastAnalysisSelection()
For repeat analysis (clicking on the icon in the toolbar) returns the previous selection so that it can be reused |
IStructuredSelection |
getLastSelection()
The last structured selection seen (e.g. selection of a file, folder, or project within the Project Explorer) |
void |
selectionChanged(IWorkbenchPart part,
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,
IStructuredSelection selection)
Remember what was last executed, so that we can give a repeat performance |
| 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 IStructuredSelection lastAnalysisSelection
protected IStructuredSelection lastSelection
protected static AnalysisDropdownHandler instance
| Constructor Detail |
|---|
public AnalysisDropdownHandler()
| Method Detail |
|---|
public Object execute(ExecutionEvent event)
throws ExecutionException
ExecutionException
public static void setLastHandledAnalysis(RunAnalyseHandler handler,
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 IStructuredSelection getLastAnalysisSelection()
public void selectionChanged(IWorkbenchPart part,
ISelection selection)
public 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 | |||||||||