Java Code Examples for org.fest.swing.edt.GuiActionRunner#execute()
The following examples show how to use
org.fest.swing.edt.GuiActionRunner#execute() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SwingTable.java From ats-framework with Apache License 2.0 | 6 votes |
/** * 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; }
Example 2
Source File: MongoEditionPanelTest.java From nosql4idea with Apache License 2.0 | 6 votes |
@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); }
Example 3
Source File: MongoResultPanelTest.java From nosql4idea with Apache License 2.0 | 6 votes |
@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); }
Example 4
Source File: CouchbasePanelTest.java From nosql4idea with Apache License 2.0 | 6 votes |
@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); }
Example 5
Source File: BaseGuiTest.java From intellij-xquery with Apache License 2.0 | 6 votes |
@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(); }
Example 6
Source File: DataSourceListPanelGuiTest.java From intellij-xquery with Apache License 2.0 | 6 votes |
@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())); }
Example 7
Source File: NameAndDefaultButtonPanelGuiTest.java From intellij-xquery with Apache License 2.0 | 6 votes |
@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(); }
Example 8
Source File: ServerConfigurationPanelTest.java From nosql4idea with Apache License 2.0 | 5 votes |
@Before public void setUp() throws Exception { databaseClientMock = Mockito.mock(DatabaseClient.class); configurationPanel = GuiActionRunner.execute(new GuiQuery<ServerConfigurationPanel>() { protected ServerConfigurationPanel executeInEDT() { return new ServerConfigurationPanel(DummyProject.getInstance(), DatabaseVendor.MONGO, databaseClientMock, new MongoAuthenticationPanel() ); } }); frameFixture = Containers.showInFrame(configurationPanel); }
Example 9
Source File: ServerConfigurationPanelTest.java From nosql4idea with Apache License 2.0 | 5 votes |
@Before public void setUp() throws Exception { databaseClientMock = Mockito.mock(DatabaseClient.class); configurationPanel = GuiActionRunner.execute(new GuiQuery<ServerConfigurationPanel>() { protected ServerConfigurationPanel executeInEDT() { return new ServerConfigurationPanel(DummyProject.getInstance(), DatabaseVendor.REDIS, databaseClientMock, new RedisAuthenticationPanel() ); } }); frameFixture = Containers.showInFrame(configurationPanel); }
Example 10
Source File: RedisPanelTest.java From nosql4idea with Apache License 2.0 | 5 votes |
@Before public void setUp() throws Exception { when(redisClientMock.loadRecords(any(ServerConfiguration.class), any(RedisDatabase.class), any(RedisQuery.class))).thenReturn(new RedisResult()); redisPanelWrapper = GuiActionRunner.execute(new GuiQuery<RedisPanel>() { protected RedisPanel executeInEDT() { return new RedisPanel(dummyProject, redisClientMock, new ServerConfiguration(), new RedisDatabase("0")) { @Override protected void addCommonsActions() { } }; } }); frameFixture = Containers.showInFrame(redisPanelWrapper); }
Example 11
Source File: ServerConfigurationPanelTest.java From nosql4idea with Apache License 2.0 | 5 votes |
@Before public void setUp() throws Exception { databaseClientMock = Mockito.mock(DatabaseClient.class); configurationPanel = GuiActionRunner.execute(new GuiQuery<ServerConfigurationPanel>() { protected ServerConfigurationPanel executeInEDT() { return new ServerConfigurationPanel(DummyProject.getInstance(), DatabaseVendor.COUCHBASE, databaseClientMock, new CouchbaseAuthenticationPanel() ); } }); frameFixture = Containers.showInFrame(configurationPanel); }
Example 12
Source File: DataSourceDetailsPanelGuiTest.java From intellij-xquery with Apache License 2.0 | 5 votes |
@Test public void shouldAddNewPanelAfterDisplayDetailsInvoked() { final XQueryDataSourceConfiguration cfg = new XQueryDataSourceConfiguration("name", XQueryDataSourceType.SAXON); final ConfigurationChangeListener listener = mock(ConfigurationChangeListener.class); GuiActionRunner.execute(new GuiTask() { protected void executeInEDT() { panel.displayDetails(cfg, listener); } }); assertThat(panel.getComponents().length, is(1)); verify(panel).add(isA(JPanel.class), eq(BorderLayout.NORTH)); }
Example 13
Source File: DataSourceListPanelGuiTest.java From intellij-xquery with Apache License 2.0 | 5 votes |
@Test public void shouldReturnSelectedDataSource() { panel.populateWithConfigurations(asList(notDefaultDataSource, defaultDataSource)); GuiActionRunner.execute(new GuiTask() { @Override protected void executeInEDT() throws Throwable { assertThat(panel.getSelectedDataSource(), is(notDefaultDataSource)); } }); }
Example 14
Source File: UserDefinedLibraryPanelGuiTest.java From intellij-xquery with Apache License 2.0 | 5 votes |
private XQueryFile createFile() { return GuiActionRunner.execute(new GuiQuery<XQueryFile>() { protected XQueryFile executeInEDT() { return XQueryElementFactory.createPhysicalFile(getProject(), "()"); } }); }
Example 15
Source File: ContextItemPanelGuiTest.java From intellij-xquery with Apache License 2.0 | 5 votes |
private void initPanel(final boolean isEnabled, final String content, final String filePath, final boolean contextItemFromEditorEnabled, final String type) { GuiActionRunner.execute(new GuiTask() { @Override protected void executeInEDT() throws Throwable { XQueryRunConfiguration configuration = mock(XQueryRunConfiguration.class); given(configuration.isContextItemEnabled()).willReturn(isEnabled); given(configuration.getContextItemText()).willReturn(content); given(configuration.getContextItemFile()).willReturn(filePath); given(configuration.isContextItemFromEditorEnabled()).willReturn(contextItemFromEditorEnabled); given(configuration.getContextItemType()).willReturn(type); panel.init(configuration); } }); }