|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ /* * Utilities.java * * Created on August 8, 2002, 12:07 PM */ package org.netbeans.test.java.gui.javawizard; import org.netbeans.jellytools.Bundle; import org.netbeans.jellytools.ChooseTemplateStepOperator; import org.netbeans.jellytools.NewWizardOperator; import org.netbeans.jellytools.actions.Action; import org.netbeans.jellytools.actions.NewTemplateAction; import org.netbeans.jellytools.nodes.FolderNode; import org.netbeans.jemmy.EventTool; import org.netbeans.jemmy.JemmyProperties; import org.netbeans.jemmy.operators.Operator.DefaultStringComparator; /** * * @author Jan Becicka */ public class Utilities { private static String mountPoint; static { char sep = System.getProperty("file.separator").charAt(0); mountPoint = System.getProperty("work.dir", "D:\\sources.org.localhost\\nb_all\\java\\test\\qa-functional\\testsrc").replace('\\', '/').replace('/', sep); mountPoint += sep + "tests" +sep + "qa-functional" + sep + "testsrc"; } public static void newClass(String packageName){ FolderNode target = new FolderNode(mountPoint + "|" + packageName.replace('.','|')); target.select(); DefaultStringComparator comparator = new DefaultStringComparator(true, true); // set default mode to API JemmyProperties.setCurrentProperty("Action.DefaultMode", new Integer(Action.API_MODE)); new NewTemplateAction().perform(); NewWizardOperator newWizardOper = new NewWizardOperator(); // revert default mode back to POPUP JemmyProperties.setCurrentProperty("Action.DefaultMode", new Integer(Action.POPUP_MODE)); ChooseTemplateStepOperator ctso = new ChooseTemplateStepOperator(); ctso.setComparator(comparator); String template = Bundle.getString("org.netbeans.modules.java.Bundle", "Templates/Classes") + "|" + Bundle.getString("org.netbeans.modules.java.Bundle", "Templates/Classes/Class.java"); new EventTool().waitNoEvent(1000); ctso.selectTemplate(template); ctso.next(); } } |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.