public void expand(TreePath path) { jTreeOperator.expandPath(path); }
public JPopupMenu callPopupOnRow(int row) { jTreeOperator.selectRow(row); jTreeOperator.scrollToRow(row); Point pointToClick = jTreeOperator.getPointToClick(row); return popupCaller.callPopupOnComponent(jTreeOperator, pointToClick); }
public TreeOperator(ContainerOperator containerOperator, int index) { jTreeOperator = new JTreeOperator(containerOperator, index); }
new ClassReference("org.netbeans.jemmy.explorer.GUIBrowser") .startApplication(); JFrameOperator mainFrame = new JFrameOperator("GUI Browser"); new JButtonOperator(mainFrame, "Reload In").push(); new JLabelOperator(mainFrame, "Reloaded"); JTreeOperator tree = new JTreeOperator(mainFrame); //click in the middle of the tree tree.clickMouse(); //collapse node tree.collapsePath(tree.findPath("", "|")); //expand node tree.expandPath(tree.findPath("", "|")); //select node tree.selectPath(tree.findPath("GUI Browser", "|")); JTextFieldOperator testField = new JTextFieldOperator(mainFrame); //type new value in the text field testField.clearText(); testField.typeText("3");
tree.expandRow(0); int c = tree.getRowCount(); TreePath foundPath = null; TreePath path = tree.getPathForRow(i); System.out.println("Path: " + path); Object[] pathElements = path.getPath(); tree.expandPath(foundPath); tree.selectPath(foundPath);
/** * Directly sends mouse events causing popup menu displaying to the selected * node. * <p> * Using Jemmy/Jelly to call popup can cause reselecting of node and more * events than is desirable for this case. * * @return JPopupMenuOperator instance */ @Override public ComponentOperator open() { /* it stopped to work after a while, see issue 58790 java.awt.Point p = dataObjectNode.tree().getPointToClick(dataObjectNode.getTreePath()); JPopupMenu menu = callPopup(dataObjectNode.tree(), p.x, p.y, java.awt.event.InputEvent.BUTTON3_MASK); return new JPopupMenuOperator(menu); */ java.awt.Point point = dataObjectNode.tree().getPointToClick(dataObjectNode.getTreePath()); int button = JTreeOperator.getPopupMouseButton(); dataObjectNode.tree().clickMouse(point.x, point.y, 1, button); return new JPopupMenuOperator(); }
JTreeOperator runtimeTree = rto.tree(); long oldTimeout = runtimeTree.getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", 6000); TreePath path = runtimeTree.findPath("Servers"); runtimeTree.selectPath(path); runtimeTree.findPath("Servers|GlassFish V2"); } catch (TimeoutExpiredException tee) { new JPopupMenuOperator(runtimeTree.callPopupOnPath(path)).pushMenuNoBlock(addServerMenuItem); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", oldTimeout);
public TreePath getPathForRow(int i) { return jTreeOperator.getPathForRow(i); }
public JPopupMenu callPopupOnPath(TreePath treePath) { return jTreeOperator.callPopupOnPath(treePath); }
public void collapse(TreePath nodeIdentifier) { jTreeOperator.collapsePath(nodeIdentifier); }
/** * Directly sends mouse events causing popup menu displaying to the selected * node. * <p> * Using Jemmy/Jelly to call popup can cause reselecting of node and more * events than is desirable for this case. * * @return JPopupMenuOperator instance */ @Override public ComponentOperator open() { /* it stopped to work after a while, see issue 58790 java.awt.Point p = dataObjectNode.tree().getPointToClick(dataObjectNode.getTreePath()); JPopupMenu menu = callPopup(dataObjectNode.tree(), p.x, p.y, java.awt.event.InputEvent.BUTTON3_MASK); return new JPopupMenuOperator(menu); */ java.awt.Point point = dataObjectNode.tree().getPointToClick(dataObjectNode.getTreePath()); int button = JTreeOperator.getPopupMouseButton(); dataObjectNode.tree().clickMouse(point.x, point.y, 1, button); return new JPopupMenuOperator(); }
JTreeOperator runtimeTree = rto.tree(); long oldTimeout = runtimeTree.getTimeouts().getTimeout("JTreeOperator.WaitNextNodeTimeout"); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", 6000); TreePath path = runtimeTree.findPath("Servers"); runtimeTree.selectPath(path); runtimeTree.findPath("Servers|GlassFish v3"); } catch (TimeoutExpiredException tee) { new JPopupMenuOperator(runtimeTree.callPopupOnPath(path)).pushMenuNoBlock(addServerMenuItem); NbDialogOperator addServerInstanceDialog = new NbDialogOperator(addServerInstanceDialogTitle); new JListOperator(addServerInstanceDialog, 1).selectItem(glassFishV3ListItem); new JButtonOperator(addServerInstanceDialog, finishButtonCaption).push(); runtimeTree.getTimeouts().setTimeout("JTreeOperator.WaitNextNodeTimeout", oldTimeout); return GlassFishV3ServerNode.invoke();
public String getTreeNodeLabel(int index) { TreePath pathForRow = jTreeOperator.getPathForRow(index); return pathForRow.getLastPathComponent().toString(); }
public TreeOperator(ContainerOperator containerOperator, ComponentChooser componentChooser) { jTreeOperator = new JTreeOperator(containerOperator, componentChooser); }
/** * Resolve missing server. This method should be called after opening some project. * If the Missing server dialog appears, it's closed and first server from * project properties is used to resolve the missing server problem. * * @param projectName name of project */ protected void resolveServer(String projectName) { waitScanFinished(); String openProjectTitle = Bundle.getString("org.netbeans.modules.j2ee.common.ui.Bundle", "MSG_Broken_Server_Title"); if (JDialogOperator.findJDialog(openProjectTitle, true, true) != null) { new NbDialogOperator(openProjectTitle).close(); LOG.info("Resolving server"); // open project properties ProjectsTabOperator.invoke().getProjectRootNode(projectName).properties(); // "Project Properties" String projectPropertiesTitle = Bundle.getStringTrimmed("org.netbeans.modules.web.project.ui.customizer.Bundle", "LBL_Customizer_Title"); NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle); // select "Run" category new Node(new JTreeOperator(propertiesDialogOper), "Run").select(); // set default server new JComboBoxOperator(propertiesDialogOper).setSelectedIndex(0); propertiesDialogOper.ok(); // if setting default server, it scans server jars; otherwise it continues immediatelly waitScanFinished(); } }