org.netbeans.modules.jellytools.platform/3 3.13

org.netbeans.jellytools
Class MainWindowOperator

java.lang.Object
  extended by org.netbeans.jemmy.operators.Operator
      extended by org.netbeans.jemmy.operators.ComponentOperator
          extended by org.netbeans.jemmy.operators.ContainerOperator
              extended by org.netbeans.jemmy.operators.WindowOperator
                  extended by org.netbeans.jemmy.operators.FrameOperator
                      extended by org.netbeans.jemmy.operators.JFrameOperator
                          extended by org.netbeans.jellytools.MainWindowOperator
All Implemented Interfaces:
org.netbeans.jemmy.Outputable, org.netbeans.jemmy.Timeoutable

public class MainWindowOperator
extends org.netbeans.jemmy.operators.JFrameOperator

Handle NetBeans main window. It manipulates with toolbars and you can get text from status bar. To invoke menu items use actions.
It is singleton, so to get instance use static method getDefault().

Usage:

      MainWindowOperator mainWindow = MainWindowOperator.getDefault();
      mainWindow.waitStatusText("Finished");
      System.out.println("STATUS="+mainWindow.getStatusText());
      // push "Open" toolbar button in "System" toolbar
      mainWindow.getToolbarButton(mainWindow.getToolbar("System"), "Open").push();
      Thread.sleep(2000);
      new NbDialogOperator("Open").close();
      // invoke "Compile" menu item under "Build" menu
      new CompileAction().performMenu();
      // invoke About menu item under "Help" menu
      new ActionNoBlock("Help|About", null).perform();
      Thread.sleep(2000);
      new NbDialogOperator("About").close();
 


Nested Class Summary
 class MainWindowOperator.StatusTextTracer
          Class to trace messages printed to status bar of the Main Window.
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.JFrameOperator
org.netbeans.jemmy.operators.JFrameOperator.JFrameFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.FrameOperator
org.netbeans.jemmy.operators.FrameOperator.FrameByTitleFinder, org.netbeans.jemmy.operators.FrameOperator.FrameFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.ContainerOperator
org.netbeans.jemmy.operators.ContainerOperator.ContainerFinder
 
Nested classes/interfaces inherited from class org.netbeans.jemmy.operators.Operator
org.netbeans.jemmy.operators.Operator.ComponentVisualizer, org.netbeans.jemmy.operators.Operator.DefaultPathParser, org.netbeans.jemmy.operators.Operator.DefaultStringComparator, org.netbeans.jemmy.operators.Operator.Finder, org.netbeans.jemmy.operators.Operator.MapAction, org.netbeans.jemmy.operators.Operator.MapBooleanAction, org.netbeans.jemmy.operators.Operator.MapByteAction, org.netbeans.jemmy.operators.Operator.MapCharacterAction, org.netbeans.jemmy.operators.Operator.MapDoubleAction, org.netbeans.jemmy.operators.Operator.MapFloatAction, org.netbeans.jemmy.operators.Operator.MapIntegerAction, org.netbeans.jemmy.operators.Operator.MapLongAction, org.netbeans.jemmy.operators.Operator.MapVoidAction, org.netbeans.jemmy.operators.Operator.NoBlockingAction, org.netbeans.jemmy.operators.Operator.PathParser, org.netbeans.jemmy.operators.Operator.StringComparator
 
Field Summary
 
Fields inherited from class org.netbeans.jemmy.operators.FrameOperator
IS_RESIZABLE_DPROP, STATE_DPROP, STATE_ICONIFIED_DPROP_VALUE, STATE_NORMAL_DPROP_VALUE, TITLE_DPROP
 
Fields inherited from class org.netbeans.jemmy.operators.ComponentOperator
HEIGHT_DPROP, IS_SHOWING_DPROP, IS_VISIBLE_DPROP, NAME_DPROP, WIDTH_DPROP, X_DPROP, Y_DPROP
 
Fields inherited from class org.netbeans.jemmy.operators.Operator
CLASS_DPROP, TO_STRING_DPROP
 
Constructor Summary
MainWindowOperator()
          Creates new instance of MainWindowOperator.
 
Method Summary
 void dragNDropToolbar(org.netbeans.jemmy.operators.ContainerOperator toolbarOper, int x, int y)
          Drags a toolbar to a new position determined by [x, y] relatively.
static MainWindowOperator getDefault()
          Returns instance of MainWindowOperator.
 String getStatusText()
          Returns text from status bar.
 MainWindowOperator.StatusTextTracer getStatusTextTracer()
          Returns singleton instance of StatusTextTracer.
 org.netbeans.jemmy.operators.ContainerOperator getToolbar(int index)
          Returns ContainerOperator representing index-th floating toolbar in IDE main window.
 org.netbeans.jemmy.operators.ContainerOperator getToolbar(String toolbarName)
          Returns ContainerOperator representing floating toolbar with given name.
 org.netbeans.jemmy.operators.JButtonOperator getToolbarButton(org.netbeans.jemmy.operators.ContainerOperator toolbarOper, int index)
          Return JButtonOperator representing index-th toolbar button within given toolbar operator.
 org.netbeans.jemmy.operators.JButtonOperator getToolbarButton(org.netbeans.jemmy.operators.ContainerOperator toolbarOper, String buttonTooltip)
          Return JButtonOperator representing a toolbar button found by given tooltip within given toolbar operator.
 int getToolbarCount()
          Returns number of toolbars currently shown in IDE.
 String getToolbarName(int index)
          Returns display name of toolbar with given index.
 org.netbeans.jemmy.operators.JMenuBarOperator menuBar()
          Returns operator of main menu bar.
 void pushToolbarPopupMenu(String popupPath)
          Pushes popup menu on toolbars.
 void pushToolbarPopupMenuNoBlock(String popupPath)
          Pushes popup menu on toolbars - no block further execution.
 void setStatusText(String newStatusText)
          Sets given text to main window's status bar.
 void verify()
          Performs verification by accessing all sub-components
 void waitStatusText(String text)
          Waits until given text appears in the main window status bar.
 
Methods inherited from class org.netbeans.jemmy.operators.JFrameOperator
findJFrame, findJFrame, findJFrame, findJFrame, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, waitJFrame, waitJFrame, waitJFrame, waitJFrame
 
Methods inherited from class org.netbeans.jemmy.operators.FrameOperator
copyEnvironment, deiconify, demaximize, getDump, getIconImage, getMenuBar, getOutput, getState, getTitle, iconify, isResizable, maximize, setIconImage, setMenuBar, setOutput, setResizable, setState, setTitle, waitFrame, waitState, waitTitle
 
Methods inherited from class org.netbeans.jemmy.operators.WindowOperator
activate, addWindowListener, applyResourceBundle, applyResourceBundle, close, dispose, findSubWindow, findSubWindow, findWindow, findWindow, findWindow, findWindow, getFocusOwner, getOwnedWindows, getOwner, getWarningString, isActive, isFocused, move, pack, removeWindowListener, resize, toBack, toFront, waitClosed, waitSubWindow, waitSubWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow, waitWindow
 
Methods inherited from class org.netbeans.jemmy.operators.ContainerOperator
add, add, add, add, add, addContainerListener, createSubOperator, createSubOperator, findComponentAt, findComponentAt, findContainer, findContainer, findContainer, findContainer, findContainerUnder, findContainerUnder, findSubComponent, findSubComponent, getComponent, getComponentCount, getComponents, getInsets, getLayout, getTimeouts, isAncestorOf, paintComponents, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, setTimeouts, waitContainer, waitContainer, waitContainer, waitContainer, waitSubComponent, waitSubComponent
 
Methods inherited from class org.netbeans.jemmy.operators.ComponentOperator
activateWindow, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, checkImage, checkImage, clickForPopup, clickForPopup, clickForPopup, clickForPopup, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, clickMouse, contains, contains, createImage, createImage, dispatchEvent, doLayout, dragMouse, dragMouse, dragMouse, dragNDrop, dragNDrop, dragNDrop, enableInputMethods, enterMouse, exitMouse, findComponent, findComponent, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getCenterX, getCenterXForClick, getCenterY, getCenterYForClick, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getContainer, getContainers, getCursor, getDropTarget, getEventDispatcher, getFocus, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getSize, getSource, getToolkit, getTreeLock, getWidth, getWindow, getX, getY, hasFocus, imageUpdate, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, list, list, list, list, list, makeComponentVisible, moveMouse, paint, paintAll, prepareImage, prepareImage, pressKey, pressKey, pressMouse, pressMouse, print, printAll, pushKey, pushKey, releaseKey, releaseKey, releaseMouse, releaseMouse, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, transferFocus, typeKey, typeKey, typeKey, update, validate, waitComponent, waitComponent, waitComponent, waitComponent, waitComponentEnabled, waitComponentShowing, waitComponentVisible, waitHasFocus, wtComponentEnabled
 
Methods inherited from class org.netbeans.jemmy.operators.Operator
addOperatorPackage, addToDump, addToDump, createOperator, getCharBindingMap, getCharKey, getCharModifiers, getCharsKeys, getCharsKeys, getCharsModifiers, getCharsModifiers, getComparator, getDefaultComponentVisualizer, getDefaultMouseButton, getDefaultPathParser, getDefaultStringComparator, getDefaultVerification, getEnvironmentOperator, getParentPath, getParentPath, getPathParser, getPopupMouseButton, getProperties, getQueueTool, getVerification, getVisualizer, isCaptionEqual, isCaptionEqual, isCaptionEqual, lockQueue, parseString, parseString, printDump, produceNoBlocking, produceNoBlocking, produceTimeRestricted, produceTimeRestricted, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, runMapping, setCharBindingMap, setComparator, setDefaultComponentVisualizer, setDefaultPathParser, setDefaultStringComparator, setDefaultVerification, setPathParser, setProperties, setVerification, setVisualizer, toStringSource, unlockAndThrow, unlockQueue, waitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainWindowOperator

public MainWindowOperator()
Creates new instance of MainWindowOperator. It gets instance of main window Frame. Note: costructor made public, so this class is not neccessarily used as singleton.

Method Detail

getDefault

public static MainWindowOperator getDefault()
Returns instance of MainWindowOperator. It is singleton, so this method is only way how to obtain instance. If instance not exists, it creates one.

Returns:
instance of MainWindowOperator

menuBar

public org.netbeans.jemmy.operators.JMenuBarOperator menuBar()
Returns operator of main menu bar.

Returns:
JMenuBarOperator instance of main menu

getStatusText

public String getStatusText()
Returns text from status bar.

Returns:
currently displayed text

setStatusText

public void setStatusText(String newStatusText)
Sets given text to main window's status bar.

Parameters:
newStatusText - string to be displayed in status bar

getStatusTextTracer

public MainWindowOperator.StatusTextTracer getStatusTextTracer()
Returns singleton instance of StatusTextTracer.

Returns:
singleton instance of StatusTextTracer

waitStatusText

public void waitStatusText(String text)
Waits until given text appears in the main window status bar. If you want to trace status messages during an operation is proceed, use MainWindowOperator.StatusTextTracer.

Parameters:
text - a text to wait for

getToolbar

public org.netbeans.jemmy.operators.ContainerOperator getToolbar(int index)
Returns ContainerOperator representing index-th floating toolbar in IDE main window. Toolbars are NOT indexed from left to right.

Parameters:
index - index of toolbar to find
Returns:
ContainerOperator instance representing a toolbar

getToolbar

public org.netbeans.jemmy.operators.ContainerOperator getToolbar(String toolbarName)
Returns ContainerOperator representing floating toolbar with given name.

Parameters:
toolbarName - toolbar's display name. It is shown in its tooltip.
Returns:
ContainerOperator instance representing a toolbar

getToolbarCount

public int getToolbarCount()
Returns number of toolbars currently shown in IDE.

Returns:
number of toolbars

getToolbarName

public String getToolbarName(int index)
Returns display name of toolbar with given index. Toolbars are NOT indexed from left to right.

Parameters:
index - index of toolbar
Returns:
display name of toolbar

getToolbarButton

public org.netbeans.jemmy.operators.JButtonOperator getToolbarButton(org.netbeans.jemmy.operators.ContainerOperator toolbarOper,
                                                                     String buttonTooltip)
Return JButtonOperator representing a toolbar button found by given tooltip within given toolbar operator.

Parameters:
toolbarOper - ContainerOperator of a toolbar. Use getToolbar(String) or getToolbar(int) to obtain an operator.
buttonTooltip - tooltip of toolbar button
Returns:
JButtonOperator instance of found toolbar button

getToolbarButton

public org.netbeans.jemmy.operators.JButtonOperator getToolbarButton(org.netbeans.jemmy.operators.ContainerOperator toolbarOper,
                                                                     int index)
Return JButtonOperator representing index-th toolbar button within given toolbar operator.

Parameters:
toolbarOper - ContainerOperator of a toolbar. Use getToolbar(String) or getToolbar(int) to obtain an operator.
index - index of toolbar button to find
Returns:
JButtonOperator instance of found toolbar button

pushToolbarPopupMenu

public void pushToolbarPopupMenu(String popupPath)
Pushes popup menu on toolbars. It doesn't matter on which toolbar it is invoked, everytime it is the same. That's why popup menu is invoked on the right side of toolbar with index 0.

Parameters:
popupPath - path to menu item (e.g. "Edit")

pushToolbarPopupMenuNoBlock

public void pushToolbarPopupMenuNoBlock(String popupPath)
Pushes popup menu on toolbars - no block further execution. It doesn't matter on which toolbar it is invoked, everytime it is the same. That's why popup menu is invoked on the right side of toolbar with index 0.

Parameters:
popupPath - path to menu item (e.g. "Save Configuration...")

dragNDropToolbar

public void dragNDropToolbar(org.netbeans.jemmy.operators.ContainerOperator toolbarOper,
                             int x,
                             int y)
Drags a toolbar to a new position determined by [x, y] relatively.

Parameters:
toolbarOper - ContainerOperator of a toolbar. Use getToolbar(String) or getToolbar(int) to obtain an operator.
x - relative move along x direction
y - relative move along y direction

verify

public void verify()
Performs verification by accessing all sub-components


org.netbeans.modules.jellytools.platform/3 3.13

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.