1 19 package org.netbeans.test.junit.utils; 20 21 import java.awt.Component ; 22 import org.netbeans.jellytools.TopComponentOperator; 23 import org.netbeans.jellytools.actions.Action; 24 import org.netbeans.jellytools.modules.junit.actions.ResultWindowViewAction; 25 import org.netbeans.jemmy.ComponentChooser; 26 import org.netbeans.jemmy.operators.JToggleButtonOperator; 27 28 32 public class ResultWindowOperator extends TopComponentOperator { 33 34 private static final Action invokeAction = new ResultWindowViewAction(); 35 36 39 public ResultWindowOperator() { 40 45 super(waitTopComponent(null, null, 0, resultsSubchooser)); 46 } 47 48 55 public static ResultWindowOperator invoke() { 56 invokeAction.perform(); 57 return new ResultWindowOperator(); 58 } 59 60 65 public StatisticsPanelOperator getLeftPanelOperator() { 66 return new StatisticsPanelOperator(); 67 } 68 69 73 public boolean isFilterButtonEnabled() { 74 return (new JToggleButtonOperator(new StatisticsPanelOperator(), 0).isEnabled()); 75 } 76 77 80 public void pushFilterButton() { 81 new JToggleButtonOperator(new StatisticsPanelOperator(), 0).push(); 82 } 83 84 88 private static final ComponentChooser resultsSubchooser = new ComponentChooser() { 89 public boolean checkComponent(Component comp) { 90 return comp.getClass().getName().endsWith("ResultWindow"); } 92 93 public String getDescription() { 94 return "component instanceof org.netbeans.modules.junit.output.ResultWindow"; } 96 }; 97 } 98 | Popular Tags |