本文整理汇总了Java中org.netbeans.jemmy.operators.JTabbedPaneOperator类的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPaneOperator类的具体用法?Java JTabbedPaneOperator怎么用?Java JTabbedPaneOperator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JTabbedPaneOperator类属于org.netbeans.jemmy.operators包,在下文中一共展示了JTabbedPaneOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setContext
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
public CodeTemplatesOperator setContext(Set<String> set) {
JTabbedPaneOperator tabbedPane = getTabbedPane();
tabbedPane.selectPage("Contexts");
ContainerOperator<JEditorPane> selectedComponent = new ContainerOperator<>((Container)tabbedPane.getSelectedComponent());
JListOperator list = new JListOperator(selectedComponent);
for (int i = 0; i < list.getModel().getSize(); i++) {
JCheckBox checkBox = (JCheckBox) list.getRenderedComponent(i);
String contextName = checkBox.getText();
list.scrollToItem(i);
if(!checkBox.isSelected() && set.contains(contextName)) {
list.selectItem(i);
} else if(checkBox.isSelected() && !set.contains(contextName)) {
list.selectItem(i);
}
}
return this;
}
示例2: CheckUpdated
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的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( );
}
示例3: WaitTab
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
private void WaitTab( JTabbedPaneOperator tabs, String name, int count )
{
int iCount = 0;
int iIndex = tabs.findPage( "Available" );
//System.out.println( "+++" + iIndex );
Pattern p = Pattern.compile( "Available Plugins [(]([0-9]+)[)]" );
while( true )
{
String s = tabs.getTitleAt( iIndex );
//System.out.println( "+++\"" + s + "\"" );
Matcher m = p.matcher( s );
if( m.find( ) )
{
int iAvailable = Integer.parseInt( m.group( 1 ) );
if( iAvailable >= count )
return; // SUCCESS
}
if( ++iCount > 60 )
fail( "Too long wait for available plugins." );
Sleep( 1000 );
}
}
示例4: testNoLogging
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
public void testNoLogging() {
String file = "Surround";
openSourceFile("org.netbeans.test.java.hints.HintsTest",file);
OptionsOperator oo = OptionsOperator.invoke();
oo.selectEditor();
JTabbedPaneOperator jtpo = new JTabbedPaneOperator(oo);
jtpo.selectPage("Hints");
JSplitPaneOperator jspo = new JSplitPaneOperator(oo);
JTreeOperator jto = new JTreeOperator(jtpo);
selectHintNode(jto,"errors","Surround with try-catch");
JCheckBoxOperator chbox1 = new JCheckBoxOperator(new ContainerOperator((Container)jspo.getRightComponent()),"Use org.openide.util.Exceptions.printStackTrace" );
chBoxSetSelected(chbox1, false);
JCheckBoxOperator chbox2 = new JCheckBoxOperator(new ContainerOperator((Container)jspo.getRightComponent()),"Use java.util.logging.Logger");
chBoxSetSelected(chbox2, false);
oo.ok();
new EventTool().waitNoEvent(1000);
editor = new EditorOperator(file);
editor.setCaretPosition(18,1);
String pattern = ".*"+
"try \\{.*"+
" FileReader fr = new FileReader\\(\"file\"\\);.*"+
"\\} catch \\(FileNotFoundException ex\\) \\{.*"+
" ex.printStackTrace\\(\\);.*"+
"\\}.*";
useHint("Surround Statement",new String[]{"Add throws","Surround Block","Surround Statement"},pattern);
}
示例5: testLoggerLogging
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
public void testLoggerLogging() {
String file = "Surround";
openSourceFile("org.netbeans.test.java.hints.HintsTest",file);
OptionsOperator oo = OptionsOperator.invoke();
oo.selectEditor();
JTabbedPaneOperator jtpo = new JTabbedPaneOperator(oo);
jtpo.selectPage("Hints");
JSplitPaneOperator jspo = new JSplitPaneOperator(oo);
JTreeOperator jto = new JTreeOperator(jtpo);
selectHintNode(jto,"errors","Surround with try-catch");
JCheckBoxOperator chbox1 = new JCheckBoxOperator(new ContainerOperator((Container)jspo.getRightComponent()),"Use org.openide.util.Exceptions.printStackTrace" );
chBoxSetSelected(chbox1, false);
JCheckBoxOperator chbox2 = new JCheckBoxOperator(new ContainerOperator((Container)jspo.getRightComponent()),"Use java.util.logging.Logger");
chBoxSetSelected(chbox2, true);
oo.ok();
new EventTool().waitNoEvent(1000);
editor = new EditorOperator(file);
editor.setCaretPosition(18,1);
String pattern = ".*"+
"try \\{.*"+
" FileReader fr = new FileReader\\(\"file\"\\);.*"+
"\\} catch \\(FileNotFoundException ex\\) \\{.*"+
" Logger.getLogger\\(Surround.class.getName\\(\\)\\).log\\(Level.SEVERE, null, ex\\);.*"+
"\\}.*";
useHint("Surround Statement",new String[]{"Add throws","Surround Block","Surround Statement"},pattern);
}
示例6: selectItem
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
@Override
public void selectItem(final ComponentOperator oper, final int index) {
if (index != -1) {
queueTool.invokeSmoothly(new QueueTool.QueueAction<Void>("Selecting tab " + index + " using mouse") {
@Override
public Void launch() {
Rectangle rect = ((JTabbedPaneOperator) oper).
getUI().
getTabBounds((JTabbedPane) oper.getSource(),
index);
DriverManager.getMouseDriver(oper).
clickMouse(oper,
(int) (rect.getX() + rect.getWidth() / 2),
(int) (rect.getY() + rect.getHeight() / 2),
1, Operator.getDefaultMouseButton(), 0,
oper.getTimeouts().create("ComponentOperator.MouseClickTimeout"));
return null;
}
});
}
}
示例7: initialize
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
@Override
public void initialize() {
repaintManager().addRegionFilter(COMPLETION_FILTER);
new OptionsViewAction().performMenu();
oo = new OptionsOperator();
oo.selectEditor();
new JTabbedPaneOperator(oo).selectPage("Code Completion");
new JCheckBoxOperator(oo,"Auto Popup Documentation Window").changeSelection(false);
oo.ok();
new OpenAction().performAPI(new Node(new SourcePackagesNode("PerformanceTestData"), "org.netbeans.test.performance|Main.java"));
editorOperator = EditorWindowOperator.getEditor("Main.java");
editorOperator.setCaretPositionToLine(lineNumber);
editorOperator.insert(ccText);
MY_END_EVENT = ActionTracker.TRACK_COMPONENT_SHOW;
}
示例8: testTabName
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
public void testTabName() {
FindUsagesMethodTest.browseChild = false;
findUsages("fumethod", "Test", 47, 19, FIND_USAGES | NOT_SEARCH_IN_COMMENTS);
findUsages("fumethod", "Test", 47, 19, FIND_USAGES | NOT_SEARCH_IN_COMMENTS);
FindUsagesMethodTest.browseChild = true;
RefactoringResultOperator furo = RefactoringResultOperator.getFindUsagesResult();
JTabbedPaneOperator tabbedPane = furo.getTabbedPane();
assertNotNull(tabbedPane);
String title = tabbedPane.getTitleAt(tabbedPane.getTabCount() - 1);
ref(title);
getRef().flush();
}
示例9: testTabNamesClass
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
public void testTabNamesClass(){
browseChild = false;
findUsages("fu", "FUClass", 48, 19, FIND_USAGES | NOT_SEARCH_IN_COMMENTS);
findUsages("fu", "FUClass", 48, 19, FIND_USAGES | NOT_SEARCH_IN_COMMENTS);
browseChild = true;
RefactoringResultOperator furo = RefactoringResultOperator.getFindUsagesResult();
JTabbedPaneOperator tabbedPane = furo.getTabbedPane();
assertNotNull(tabbedPane);
String title = tabbedPane.getTitleAt(tabbedPane.getTabCount() - 1);
ref(title);
}
示例10: getActiveOutputTab
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
/** Returns active OutputTabOperator instance regardless it is the only one in
* output or it is in tabbed pane.
* @return active OutputTabOperator instance
*/
private OutputTabOperator getActiveOutputTab() {
OutputTabOperator outputTabOper;
if(null != JTabbedPaneOperator.findJTabbedPane((Container)getSource(), ComponentSearcher.getTrueChooser(""))) {
outputTabOper = new OutputTabOperator(((JComponent)new JTabbedPaneOperator(this).getSelectedComponent()));
outputTabOper.copyEnvironment(this);
} else {
outputTabOper = new OutputTabOperator("");
}
return outputTabOper;
}
示例11: selectUpdates
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
/** Changes current selected tab to "Updates"
* @return JTabbedPaneOperator instance
*/
public JTabbedPaneOperator selectUpdates() {
String updatesTitle = Bundle.getStringTrimmed(
"org.netbeans.modules.autoupdate.ui.Bundle",
"PluginManagerUI_UnitTab_Update_Title");
return selectTab(updatesTitle);
}
示例12: selectDownloaded
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
/** Changes current selected tab to "Downloaded"
* @return JTabbedPaneOperator of parent tabbed pane
*/
public JTabbedPaneOperator selectDownloaded() {
String downloadedTitle = Bundle.getString(
"org.netbeans.modules.autoupdate.ui.Bundle",
"PluginManagerUI_UnitTab_Local_Title");
return selectTab(downloadedTitle);
}
示例13: selectSettings
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
/** Changes current selected tab to "Settings"
* @return JTabbedPaneOperator instance
*/
public JTabbedPaneOperator selectSettings() {
String settingsTitle = Bundle.getStringTrimmed(
"org.netbeans.modules.autoupdate.ui.Bundle",
"SettingsTab_displayName");
return selectTab(settingsTitle);
}
示例14: switchToTemplates
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
private void switchToTemplates() {
optionsOperator.selectEditor();
Component findComponent = optionsOperator.findSubComponent(new JTabbedPaneOperator.JTabbedPaneFinder());
JTabbedPaneOperator tabbedPane = new JTabbedPaneOperator((JTabbedPane) findComponent);
tabbedPane.selectPage("Code Templates");
panel = new ContainerOperator<>((Container) tabbedPane.getSelectedComponent());
}
示例15: getEditorOnTab
import org.netbeans.jemmy.operators.JTabbedPaneOperator; //导入依赖的package包/类
private JEditorPaneOperator getEditorOnTab(final String tabName) {
JTabbedPaneOperator tabbedPane = getTabbedPane();
tabbedPane.selectPage(tabName);
ContainerOperator<JEditorPane> selectedComponent = new ContainerOperator<>((Container)tabbedPane.getSelectedComponent());
JEditorPaneOperator jepo = new JEditorPaneOperator(selectedComponent);
return jepo;
}