/** Tries to find null JComboBox in this dialog. * @return JComboBoxOperator */ public JComboBoxOperator cboAddToEnterpriseApplication() { if (_cboAddToEnterpriseApplication==null) { _cboAddToEnterpriseApplication = new JComboBoxOperator(this, 2); } return _cboAddToEnterpriseApplication; }
/** selects item for cboSourceLevel * @param item String item */ public void selectSourceLevel(String item) { cboSourceLevel().selectItem(item); }
private Component getRenderedComponent(final int itemIndex) { final JList popupList = comboboxOperator.waitList(); final Object element = comboboxModel().getElementAt(itemIndex); final boolean isSelected = comboboxOperator.getSelectedIndex() == itemIndex; final boolean hasFocus = comboboxOperator.hasFocus(); final ListCellRenderer cellRenderer = comboboxOperator.getRenderer(); return new SmoothInvoker<Component>() { public Object work() { return cellRenderer.getListCellRendererComponent(popupList, element, itemIndex, isSelected, hasFocus); } }.invoke(); }
@Override protected Object executeWhenComboBoxOpen() { int itemIndex = findItemIndex(comboItemIdentifier); boolean verificationEnabled = comboboxOperator .getVerification(); comboboxOperator.setVerification(false); comboboxOperator.selectItem(itemIndex); if (verificationEnabled) verifyItemSelection(comboItemIdentifier); return null; } }.execute();
if (isCombo) { paramTable.clickOnCell(row, column); JComboBoxOperator combo = new JComboBoxOperator(paramTable); combo.setEnabled(true); combo.selectItem(value); } else { paramTable.clickOnCell(row, column);
if (!combo.getSelectedItem().toString().equals(value)) { combo.selectItem(value.toString()); if (combo.getSelectedIndex() != val) { combo.selectItem(val);
public Object getSelectedItemFromDisabledComboBox() { return comboboxOperator.getSelectedItem(); }
final JComboBoxOperator comboBox = new JComboBoxOperator(frame); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); selection = comboBox.getSelectedIndex(); assertSame(expResult.ordinal(), selection); comboBox.setSelectedIndex(expResult.ordinal()); keyStrength = panel.getKeyStrength(); assertSame(expResult, keyStrength); selection = comboBox.getSelectedIndex();
/** * 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(); } }
/** types text for cboGenerateJavadoc * @param text String text */ public void typeGenerateJavadoc(String text) { cboGenerateJavadoc().typeText(text); }
@Override protected Object executeWhenComboBoxOpen() { return itemTextExtractor .getTextFromRenderedComponent(comboboxOperator .getSelectedIndex()); } }.execute();
@RobotKeyword public void disableCombobox(String identifier) { createOperator(identifier).setEnabled(false); }
/** returns selected item for cboGenerateJavadoc * @return String item */ public String getSelectedGenerateJavadoc() { return cboGenerateJavadoc().getSelectedItem().toString(); }
/** types text for cboDeployProject * @param text String text */ public void typeDeployProject(String text) { cboDeployProject().typeText(text); }
/**@return The selected item or selected index, depending on the itemIdentifier.*/ public Object actionProduced(Object obj) { if (itemIdentifier.isIndex()) return new Integer(comboboxOperator.getComboboxOperator() .getSelectedIndex()); return comboboxOperator.getSelectedItem(); }
@RobotKeyword public void enableCombobox(String identifier) { createOperator(identifier).setEnabled(true); }
/** Tries to find null JComboBox in this dialog. * @return JComboBoxOperator */ public JComboBoxOperator cboLocation() { if (_cboLocation==null) { Component comp = lblLocation().getLabelFor(); if (comp != null) { _cboLocation = new JComboBoxOperator((JComboBox) comp); } else { _cboLocation = new JComboBoxOperator(this); } } return _cboLocation; }
/** selects item for cboRunProject * @param item String item */ public void selectRunProject(String item) { cboRunProject().selectItem(item); }
/** returns selected item for cboJavaEEVersion * @return String item */ public String getSelectedJavaEEVersion() { return cboJavaEEVersion().getSelectedItem().toString(); }