public class AnalysisDropdownHandler
extends AbstractHandler
Modifier and Type | Field and Description |
---|---|
protected static AnalysisDropdownHandler |
instance |
protected static RunAnalyseHandler |
lastAnalysisHandler |
protected static IStructuredSelection |
lastAnalysisSelection |
protected IStructuredSelection |
lastSelection |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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
|
protected static RunAnalyseHandler lastAnalysisHandler
protected static IStructuredSelection lastAnalysisSelection
protected IStructuredSelection lastSelection
protected static AnalysisDropdownHandler instance
public AnalysisDropdownHandler()
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()
Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.