本文整理汇总了Java中org.netbeans.jemmy.operators.JDialogOperator类的典型用法代码示例。如果您正苦于以下问题:Java JDialogOperator类的具体用法?Java JDialogOperator怎么用?Java JDialogOperator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JDialogOperator类属于org.netbeans.jemmy.operators包,在下文中一共展示了JDialogOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
@Override
public void close() {
if (testedComponentOperator != null) {
new Thread("Question dialog discarder") {
@Override
public void run() {
try {
new JButtonOperator(new JDialogOperator("Question"), "Discard").push();
} catch (Exception e) {
// There is no need to care about this exception as this dialog is optional
e.printStackTrace();
}
}
}.start();
((MIDletEditorOperator) testedComponentOperator).close();
}
}
示例2: close
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
@Override
public void close() {
new Thread("Question dialog discarder") {
@Override
public void run() {
try {
new JButtonOperator(new JDialogOperator("Question"), "Discard").push();
} catch (Exception e) {
e.printStackTrace();
}
}
}.start();
if (midletName != null) {
MIDletEditorOperator.findMIDletEditorOperator(midletName + ".java").close();
}
}
示例3: openDialog
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
public boolean openDialog(EditorOperator operator) {
operator.pressKey(KeyEvent.VK_INSERT, KeyEvent.ALT_DOWN_MASK);
JDialogOperator jdo = new JDialogOperator();
JListOperator list = new JListOperator(jdo);
ListModel lm = list.getModel();
for (int i = 0; i < lm.getSize(); i++) {
CodeGenerator cg = (CodeGenerator) lm.getElementAt(i);
if(cg.getDisplayName().equals("Add Property...")) {
list.setSelectedIndex(i);
jdo.pushKey(KeyEvent.VK_ENTER);
new EventTool().waitNoEvent(250);
return true;
}
}
fail("Dialog not found");
return false;
}
示例4: openDialog
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
/**
* Opens requested code generation dialog
* @param type Displayname of menu item
* @param editor Operator of editor window where should be menu opened
* @return true is item is found, false elsewhere
*/
public static boolean openDialog(String type, EditorOperator editor) {
new EventTool().waitNoEvent(1000);
editor.pushKey(KeyEvent.VK_INSERT, KeyEvent.ALT_DOWN_MASK);
JDialogOperator jdo = new JDialogOperator();
new EventTool().waitNoEvent(1000);
JListOperator list = new JListOperator(jdo);
ListModel lm = list.getModel();
for (int i = 0; i < lm.getSize(); i++) {
CodeGenerator cg = (CodeGenerator) lm.getElementAt(i);
if(cg.getDisplayName().equals(type)) {
list.setSelectedIndex(i);
jdo.pushKey(KeyEvent.VK_ENTER);
new EventTool().waitNoEvent(1000);
return true;
}
}
return false;
}
示例5: containsItems
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
/**
* Compares list of items provided in the Insert Code dialog with the list of expected items
* @param editor Operator of editor window where should Insert Code should be caled
* @param items Expected items
* @return true if both list are the same, false otherwise
*/
public static boolean containsItems(EditorOperator editor, String ... items) {
Set<String> actItems = new HashSet<String>();
List<String> expItems = Arrays.asList(items);
editor.pushKey(KeyEvent.VK_INSERT, KeyEvent.ALT_DOWN_MASK);
JDialogOperator jdo = new JDialogOperator();
JListOperator list = new JListOperator(jdo);
ListModel lm = list.getModel();
for (int i = 0; i < lm.getSize(); i++) {
CodeGenerator cg = (CodeGenerator) lm.getElementAt(i);
actItems.add(cg.getDisplayName());
if(!expItems.contains(cg.getDisplayName())) return false;
}
for (String string : expItems) {
if(!actItems.contains(string)) return false;
}
return true;
}
示例6: testFontProperty
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
/** Test org.netbeans.jellytools.properties.FontProperty. */
public void testFontProperty() {
PropertySheetOperator pso = new PropertySheetOperator(TestNode.NODE_NAME);
FontProperty p = new FontProperty(pso, "Font"); // NOI18N
try {
p.setFontValue("Serif", FontProperty.STYLE_BOLDITALIC, "14"); // NOI18N
} catch (TimeoutExpiredException e) {
// sometimes it fails on Solaris
log("jemmy.log", "ERROR: " + e.getMessage());
JDialog fontDialog = JDialogOperator.findJDialog(p.getName(), false, false);
if (fontDialog != null) {
log("jemmy.log", " Closing Font dialog.");
new NbDialogOperator(fontDialog).close();
}
log("jemmy.log", " Trying to set font once more");
p.setFontValue("Serif", FontProperty.STYLE_BOLDITALIC, "14"); // NOI18N
}
// need to change selection because it gets editable otherwise
pso.tblSheet().selectCell(0, 0);
String s[] = p.getFontValue();
// need to change selection because it gets editable otherwise
pso.tblSheet().selectCell(0, 0);
assertTrue(s[0].indexOf("Serif") >= 0); // NOI18N
assertEquals(FontProperty.STYLE_BOLDITALIC, s[1]);
assertEquals("14", s[2]); // NOI18N
}
示例7: setLevel
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
/**
* Sets definition level for the option.
* @param optionPath Path to the option in left (tree-like) column.
* @param level One of the USER_LEVEL or DEFAULT_LEVEL
*/
public void setLevel(String optionPath, final int level) {
showLevels();
int curLevel = getLevel(optionPath);
getOutput().printLine("Setting " + level + " level for \"" +
optionPath + "\" option. \nCurrent level: " + curLevel);
final int row = selectOption(optionPath);
if(level > curLevel) {
produceNoBlocking(new NoBlockingAction("Setting property definition level") {
public Object doAction(Object param) {
setLevel(row, level);
return(null);
}
});
JDialogOperator question = new JDialogOperator(Bundle.getString("org.openide.Bundle",
"NTF_QuestionTitle"));
new JButtonOperator(question, Bundle.getString("org.openide.Bundle",
"CTL_YES")).push();
} else if(level < curLevel) {
setLevel(row, level);
}
}
示例8: testGenerateDocumentation
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
public void testGenerateDocumentation() throws Exception{
final String docName = "dokumentace";
final String fileName = docName+".html";
final String generated = "Generated.*\n";
//dissable showing browser
setSwingBrowser();
Node node = WebPagesNode.getInstance(projectName).getChild(dtdfileName, Node.class);
new ActionNoBlock(null, Bundle.getString(TOOLS_DOCLET_BUNDLE, "NAME_Generate_Documentation")).perform(node);
JDialogOperator op = new JDialogOperator(Bundle.getString(TOOLS_GENERATOR_BUNDLE, "PROP_fileNameTitle"));
new JTextFieldOperator(op, 0).setText(docName);
new JButtonOperator(op, "OK").push();
Node docNode = WebPagesNode.getInstance(projectName).getChild(fileName, Node.class);
new ActionNoBlock(null, "Open").performPopup(docNode);
Thread.sleep(5000);//wait opening the window
String text = new EditorOperator(fileName).getText();
text = text.replaceFirst(generated, generated);
ref(text);
ending();
}
示例9: createNewFile
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
protected EditorOperator createNewFile(String fileName, String project, String category, String fileType) {
NewFileWizardOperator opNewFileWizard = NewFileWizardOperator.invoke();
opNewFileWizard.selectCategory(category);
opNewFileWizard.selectFileType(fileType);
opNewFileWizard.next();
JDialogOperator jdNew = new JDialogOperator("New " + fileType);
JTextComponentOperator jt = new JTextComponentOperator(jdNew, 0);
if (null != fileName) {
jt.setText(fileName);
} else {
fileName = jt.getText();
}
opNewFileWizard.finish();
return new EditorOperator(fileName);
}
示例10: CheckUpdated
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
public void CheckUpdated( )
{
startTest( );
// Open
new JMenuBarOperator(MainWindowOperator.getDefault()).pushMenuNoBlock("Tools|Plugins");
JDialogOperator jdPlugins = new JDialogOperator( "Plugins" );
JTabbedPaneOperator jtTabs = new JTabbedPaneOperator( jdPlugins, 0 );
jtTabs.setSelectedIndex( jtTabs.findPage( "Updated" ) );
// Close by button
JButtonOperator jbClose = new JButtonOperator( jdPlugins, "Close" );
jbClose.push( );
jdPlugins.waitClosed( );
endTest( );
}
示例11: WaitButton
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
private JButtonOperator WaitButton( JDialogOperator dialog, String name )
{
int iCount = 0;
while( true )
{
try
{
JButtonOperator jbButton = new JButtonOperator( dialog, name );
if( jbButton.isEnabled( ) )
return jbButton;
}
catch( JemmyException ex )
{
// Do nothing, wait for button again
}
if( ++iCount >= 100 )
fail( "Unable to wait Finish button." );
Sleep( 1000 );
}
}
示例12: checkShowDialogButton
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
private void checkShowDialogButton(JDialogOperator jdo, JButtonOperator jbo)
throws InterruptedException {
//Check that the button does not change the number of JDialog
jbo.push();
Thread.sleep(500);
assertEquals("Only one JDialog is present", 1,
countWindows(jDialogClassChooser));
assertTrue("Check JDialog is visible", jdo.isVisible());
jdo.requestClose();
jdo.waitClosed();
//Check that the button makes the JDialog visible
//and that 1 jDialog is present.
jbo.push();
jdo.waitComponentVisible(true);
Thread.sleep(500);
assertEquals("Only one JDialog is present", 1,
countWindows(jDialogClassChooser));
}
示例13: testRefactoring
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
/** Runs refactoring */
public void testRefactoring() {
Node node = openFile(CLASS_OLD_NAME);
runNoBlockPopupOverNode("Refactor|Rename...", node); // NOI18N
JDialogOperator dialog = new JDialogOperator("Rename"); // NOI18N
waitNoEvent(3000);
new JTextFieldOperator(dialog).setText(CLASS_NEW_NAME);
new JButtonOperator(dialog,"Refactor").clickMouse(); // NOI18N
dialog.waitClosed();
}
示例14: testRefactoring
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
/** Runs refactoring */
public void testRefactoring() {
openFile(JAVA_FILE_NAME);
FormDesignerOperator designer = new FormDesignerOperator(JAVA_FILE_NAME);
ComponentInspectorOperator inspector = new ComponentInspectorOperator();
Node node = new Node(inspector.treeComponents(), NODE_PATH);
runNoBlockPopupOverNode("Change Variable Name ...", node); // NOI18N
JDialogOperator dialog = new JDialogOperator("Rename"); // NOI18N
new JTextFieldOperator(dialog).setText(VARIABLE_NEW_NAME);
new JButtonOperator(dialog,"OK").clickMouse(); // NOI18N
dialog.waitClosed();
}
示例15: DeleteJAXBBinding
import org.netbeans.jemmy.operators.JDialogOperator; //导入依赖的package包/类
public void DeleteJAXBBinding( )
{
startTest( );
ProjectsTabOperator pto = ProjectsTabOperator.invoke( );
ProjectRootNode prn = pto.getProjectRootNode( TEST_JAVA_APP_NAME );
prn.select( );
Node bindingNode = new Node( prn, "JAXB Binding|" + JAXB_BINDING_NAME );
bindingNode.select( );
bindingNode.performPopupAction( POPUP_DELETE );
JDialogOperator dlg = new JDialogOperator( "Confirm Object Deletion" );
JButtonOperator btn = new JButtonOperator( dlg, BUTTON_NAME_YES );
btn.pushNoBlock( );
// Wait till JAXB really deleted
MainWindowOperator.StatusTextTracer stt = MainWindowOperator.getDefault( ).getStatusTextTracer( );
stt.start( );
stt.waitText( "Finished building " + TEST_JAVA_APP_NAME + " (jaxb-clean-code-generation)." );
stt.stop( );
CreateJAXBBindingInternal(
JAXB_BINDING_NAME,
JAXB_PACKAGE_NAME,
TEST_JAVA_APP_NAME,
"CreditReportSimple.wsdl",
true
);
endTest( );
}