org.softevo.ample
Class PopupMenuAction

java.lang.Object
  extended by org.softevo.ample.PopupMenuAction
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IViewActionDelegate

public class PopupMenuAction
extends java.lang.Object
implements org.eclipse.ui.IViewActionDelegate

Behavior of Ample's item in the context menu of the Failure tab in the JUnit Results view.


Field Summary
private  org.eclipse.jdt.internal.junit.ui.TestRunInfo selectedTest
          Test currently selected in the active view tab.
private  org.eclipse.jdt.internal.junit.ui.TestRunnerViewPart viewPart
          Instance of the JUnit Results view part.
 
Constructor Summary
PopupMenuAction()
           
 
Method Summary
private  void blankRankingView()
           
 void init(org.eclipse.ui.IViewPart view)
           
private  void launchAmple(org.eclipse.jdt.internal.junit.ui.TestRunInfo failingRun, org.eclipse.jdt.internal.junit.ui.TestRunInfo[] passingRuns)
          Instruments project's byte code files and reruns the tests.
 void run(org.eclipse.jface.action.IAction action)
           
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
           
private static void showErrorFailingRequired(org.eclipse.swt.widgets.Shell shell)
          Displays an error message dialog stating Ample should be run when a failing test is selected.
private static void showErrorTestsAreRunning(org.eclipse.swt.widgets.Shell shell)
          Displays an error message dialog stating Ample should be run when all JUnits have ended.
private static void showErrorTooFewPassing(org.eclipse.swt.widgets.Shell shell)
          Displays an error message dialog stating there are too few passing passing tests for Ample to run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewPart

private org.eclipse.jdt.internal.junit.ui.TestRunnerViewPart viewPart
Instance of the JUnit Results view part.


selectedTest

private org.eclipse.jdt.internal.junit.ui.TestRunInfo selectedTest
Test currently selected in the active view tab.

Constructor Detail

PopupMenuAction

public PopupMenuAction()
Method Detail

init

public void init(org.eclipse.ui.IViewPart view)
Specified by:
init in interface org.eclipse.ui.IViewActionDelegate

run

public void run(org.eclipse.jface.action.IAction action)
Specified by:
run in interface org.eclipse.ui.IActionDelegate

selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate

blankRankingView

private void blankRankingView()

launchAmple

private void launchAmple(org.eclipse.jdt.internal.junit.ui.TestRunInfo failingRun,
                         org.eclipse.jdt.internal.junit.ui.TestRunInfo[] passingRuns)
Instruments project's byte code files and reruns the tests.

Parameters:
testRuns - Array of test runs to be launched.

showErrorTestsAreRunning

private static void showErrorTestsAreRunning(org.eclipse.swt.widgets.Shell shell)
Displays an error message dialog stating Ample should be run when all JUnits have ended.

Parameters:
shell - Owner of the message dialog that will appear.

showErrorFailingRequired

private static void showErrorFailingRequired(org.eclipse.swt.widgets.Shell shell)
Displays an error message dialog stating Ample should be run when a failing test is selected.

Parameters:
shell - Owner of the message dialog that will appear.

showErrorTooFewPassing

private static void showErrorTooFewPassing(org.eclipse.swt.widgets.Shell shell)
Displays an error message dialog stating there are too few passing passing tests for Ample to run.

Parameters:
shell - Owner of the message dialog that will appear.