public class AnalysisDropdownHandler
extends org.eclipse.core.commands.AbstractHandler
implements org.eclipse.ui.ISelectionListener
| Modifier and Type | Field and Description |
|---|---|
protected static AnalysisDropdownHandler |
instance |
protected static RunAnalyseHandler |
lastAnalysisHandler |
protected static org.eclipse.jface.viewers.IStructuredSelection |
lastAnalysisSelection |
protected org.eclipse.jface.viewers.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 |
|---|---|
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
|
addHandlerListener, dispose, fireHandlerChanged, hasListeners, isEnabled, isHandled, removeHandlerListener, setBaseEnabled, setEnabledprotected static RunAnalyseHandler lastAnalysisHandler
protected static org.eclipse.jface.viewers.IStructuredSelection lastAnalysisSelection
protected org.eclipse.jface.viewers.IStructuredSelection lastSelection
protected static AnalysisDropdownHandler instance
public AnalysisDropdownHandler()
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.ExecutionExceptionpublic 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()
Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.