本文整理汇总了Java中org.fest.swing.edt.GuiActionRunner类的典型用法代码示例。如果您正苦于以下问题:Java GuiActionRunner类的具体用法?Java GuiActionRunner怎么用?Java GuiActionRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GuiActionRunner类属于org.fest.swing.edt包,在下文中一共展示了GuiActionRunner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCellBackgroundColors
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
/**
* Gets table cell backgrounds (as {@link Color}) of all table cells.
*
* @return array of java.awt.Color objects one for each cell. First index is
* table row and second is the column in this row.
*/
@PublicAtsApi
public Color[][] getCellBackgroundColors() {
new SwingElementState(this).waitToBecomeExisting();
final JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
int rowCount = tableFixture.rowCount();
// SwingUtilities.
int columnCount = GuiActionRunner.execute(new GuiQuery<Integer>() {
@Override
protected Integer executeInEDT() throws Throwable {
return tableFixture.component().getColumnCount();
}
});
Color[][] resultArr = new Color[rowCount][columnCount];
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < columnCount; j++) {
resultArr[i][j] = tableFixture.backgroundAt(new TableCell(i, j) {}).target();
}
}
return resultArr;
}
示例2: selectProjectPane
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@NotNull
public PaneFixture selectProjectPane() {
activate();
final ProjectView projectView = ProjectView.getInstance(myProject);
pause(new Condition("Project view is initialized") {
@Override
public boolean test() {
//noinspection ConstantConditions
return field("isInitialized").ofType(boolean.class).in(projectView).get();
}
}, SHORT_TIMEOUT);
final String id = "ProjectPane";
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() throws Throwable {
projectView.changeView(id);
}
});
return new PaneFixture(projectView.getProjectViewPaneById(id));
}
示例3: indexOfText
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@RunsInEDT
private static int indexOfText(final VNumber vNumber, final String text)
{
return GuiActionRunner.execute(new GuiQuery<Integer>()
{
@Override
protected Integer executeInEDT()
{
ComponentStateValidator.validateIsEnabledAndShowing(vNumber);
final String actualText = vNumber.getValue().toString();
if (Strings.isEmpty(actualText))
{
return -1;
}
return actualText.indexOf(text);
}
});
}
示例4: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
mongoEditionPanel = GuiActionRunner.execute(new GuiQuery<MongoEditionPanel>() {
protected MongoEditionPanel executeInEDT() {
MongoEditionPanel panel = new MongoEditionPanel() {
@Override
void buildPopupMenu() {
}
};
return panel.init(mockMongoOperations, mockActionCallback);
}
});
mongoEditionPanel.updateEditionTree(buildDocument("simpleDocument.json"));
frameFixture = Containers.showInFrame(mongoEditionPanel);
}
示例5: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(MongoResultPanelTest.class);
mongoResultPanel = GuiActionRunner.execute(new GuiQuery<MongoResultPanel>() {
protected MongoResultPanel executeInEDT() {
return new MongoResultPanel(DummyProject.getInstance(), mongoDocumentOperations) {
@Override
void buildPopupMenu() {
}
};
}
});
frameFixture = Containers.showInFrame(mongoResultPanel);
}
示例6: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
when(couchbaseClientMock.loadRecords(any(ServerConfiguration.class), any(CouchbaseDatabase.class), any(CouchbaseQuery.class))).thenReturn(new CouchbaseResult("dummy"));
couchbasePanelWrapper = GuiActionRunner.execute(new GuiQuery<CouchbasePanel>() {
protected CouchbasePanel executeInEDT() {
return new CouchbasePanel(DummyProject.getInstance(),
couchbaseClientMock,
new ServerConfiguration(),
new CouchbaseDatabase("default")) {
@Override
protected void addCommonsActions() {
}
};
}
});
frameFixture = Containers.showInFrame(couchbasePanelWrapper);
}
示例7: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
final PanelTestingFrame frame = GuiActionRunner.execute(new GuiQuery<PanelTestingFrame>() {
protected PanelTestingFrame executeInEDT() {
return getPanelTestingFrame();
}
});
GuiActionRunner.execute(new GuiTask() {
protected void executeInEDT() {
disableTooltipAndBlinkRadeForChildrenToSatisfyIdeasUsefulTestCase(frame);
}
});
window = new FrameFixture(frame);
window.show();
}
示例8: shouldAddNewDataSourceAfterExecutionInvoked
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Test
public void shouldAddNewDataSourceAfterExecutionInvoked() {
panel.populateWithConfigurations(asList(notDefaultDataSource));
clickAdd();
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() throws Throwable {
addDataSourceActionExecutor.execute(XQueryDataSourceType.SAXON);
}
});
JListFixture list = window.list().cellReader(new DataSourceListCellReader());
list.requireSelection(1);
assertThat(list.contents()[1], is(XQueryDataSourceType.SAXON.getPresentableName()));
}
示例9: shouldDisableSetAsDefaultButton
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Test
public void shouldDisableSetAsDefaultButton() {
window.cleanUp();
PanelTestingFrame frame = GuiActionRunner.execute(new GuiQuery<PanelTestingFrame>() {
protected PanelTestingFrame executeInEDT() {
cfg.DEFAULT = true;
panel = new NameAndDefaultButtonPanel();
return new PanelTestingFrame(panel.getPanel());
}
});
FrameFixture anotherWindow = new FrameFixture(frame);
anotherWindow.show();
panel.init(cfg, aggregatingPanel, listener);
anotherWindow.button(SET_AS_DEFAULT_BUTTON_NAME).requireDisabled();
anotherWindow.cleanUp();
}
示例10: selectFileUsingFileChooserDialog
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
void selectFileUsingFileChooserDialog(final File file) {
new Thread(new Runnable() {
@Override
public void run() {
delay(DIALOG_OPEN_DELAY);
GuiActionRunner.execute(new GuiTask() {
@Override
protected void executeInEDT() {
_menu._exportFileDialog.setSelectedFile(file);
_menu._exportFileDialog.approveSelection();
}
});
}
}).start();
clickButtonOrItem(_menu._exportFileButton);
}
示例11: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() throws AWTException {
DataGeneratorService.INSTANCE.reset();
_frame = GuiActionRunner.execute(new GuiQuery<SwingMenu>() {
@Override
protected SwingMenu executeInEDT() {
return new SwingMenu();
}
});
_frameTestUtil = new SwingMenuTestUtil(_frame);
SwingLauncher.GUI = _frame;
_frameTestUtil.setExportFileFilter(SwingMenu.ALL_FILE_FILTER);
if (_testFile.exists()) {
_testFile.delete();
}
}
示例12: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() {
window = new FrameFixture(
GuiActionRunner.execute(new GuiQuery<GraphStartScreen>() {
protected GraphStartScreen executeInEDT() {
return new GraphStartScreen();
}
}));
window.show();
}
示例13: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() {
window = new FrameFixture(
GuiActionRunner.execute(new GuiQuery<GraphStartScreen>() {
protected GraphStartScreen executeInEDT() {
return new GraphStartScreen();
}
}));
window.show();
window.button(new ShortDescriptionButtonMatcher(GraphStartScreen.JMVA_SHORT_DESCRIPTION)).click();
jmva = WindowFinder.findFrame(ExactWizard.class).using(window.robot);
}
示例14: setUp
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
@Before
public void setUp() {
window = new FrameFixture(
GuiActionRunner.execute(new GuiQuery<GraphStartScreen>() {
protected GraphStartScreen executeInEDT() {
return new GraphStartScreen();
}
}));
}
示例15: createJFrame
import org.fest.swing.edt.GuiActionRunner; //导入依赖的package包/类
public JFrame createJFrame()
{
JFrame testFrame = GuiActionRunner.execute(new GuiQuery<JFrame>()
{
protected JFrame executeInEDT()
{
return new JFrame();
}
});
return testFrame;
}