Examples of SWTBotTable


Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

   * @return a {@link SWTBotTable} with the specified <code>value</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTable tableWithId(String value, int index) {
    Matcher matcher = allOf(widgetOfType(Table.class), withId(value));
    return new SWTBotTable((Table) widget(matcher, index), matcher);
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

   * @return a {@link SWTBotTable} with the specified <code>inGroup</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTable tableInGroup(String inGroup, int index) {
    Matcher matcher = allOf(widgetOfType(Table.class), inGroup(inGroup));
    return new SWTBotTable((Table) widget(matcher, index), matcher);
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

   * @return a {@link SWTBotTable} with the specified <code>none</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTable table(int index) {
    Matcher matcher = allOf(widgetOfType(Table.class));
    return new SWTBotTable((Table) widget(matcher, index), matcher);
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

   * @return a {@link SWTBotTable} with the specified <code>label</code> with the specified <code>inGroup</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTable tableWithLabelInGroup(String label, String inGroup, int index) {
    Matcher matcher = allOf(widgetOfType(Table.class), withLabel(label), inGroup(inGroup));
    return new SWTBotTable((Table) widget(matcher, index), matcher);
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

    @Test
    public void testLogTableFirstColumnIsNotEditable() {

        TableViewer logTableViewer = ColumnPreferenceView.getTableViewer();

        SWTBotTable logTable = getLogTable();

        boolean isCellEditorActive = false;

        for (int i = 0; i < logTable.rowCount(); i++) {
            logTable.click(i, 0);
            // try to edit cell by F2 key
            logTable.pressShortcut(getKey(SWT.F2));
            waitForCellEditorState(logTableViewer, false);
            isCellEditorActive = logTableViewer.isCellEditorActive();
            assertFalse(isCellEditorActive);

            // try to edit first cell by mouse doubleclick
            logTable.doubleClick(i, 0);
            waitForCellEditorState(logTableViewer, false);
            isCellEditorActive = logTableViewer.isCellEditorActive();
            assertFalse(isCellEditorActive);
        }
    }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

    public void testLogTableColumnsSizeChanging() throws ParseException {

        TableViewer logTableViewer = ColumnPreferenceView.getTableViewer();
        final int columnWidthToSet = 60;

        SWTBotTable logTable = getLogTable();

        int widthColIndex = logTable.indexOfColumn("Column Width");

        writeToCell(logTableViewer, 0, widthColIndex, Integer.toString(columnWidthToSet),
                UITestConstants.MOUSE_CLICK_ACTIVATION);

        pressApplyButton();
        closePreferencesDialog();

        SWTBotView log4jView = BOT.viewByTitle("Log4j-Viewer");
        log4jView.show();
        log4jView.setFocus();

        Composite log4jViewComposite = (Composite) log4jView.getWidget();

        Matcher matcher = instanceOf(Table.class);
        SWTBotTable mainViewTable = new SWTBotTable((Table) BOT.widget(matcher, log4jViewComposite));

        // TODO: Invalid thread access here
        int mainViewTableColumnWidth = mainViewTable.widget.getColumn(0).getWidth();

        assertTrue(mainViewTableColumnWidth == columnWidthToSet);
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

     * @throws InterruptedException
     */
    @Test
    public void testTableElementsMovingOnUpDownButtonsClick() throws InterruptedException {

        SWTBotTable logTable = getLogTable();

        String firstColumnTitle = logTable.cell(0, 0); // "Level"
        String secondColumnTitle = logTable.cell(1, 0); // "Category"

        logTable.select(0);
        pressMoveDownButton();

        boolean moveDownBtnWorks = logTable.cell(0, 0).equals(secondColumnTitle)
                && logTable.cell(1, 0).equals(firstColumnTitle);
        assertTrue(moveDownBtnWorks);

        logTable.select(1);
        pressMoveUpButton();

        boolean moveUpBtnWorks = logTable.cell(0, 0).equals(firstColumnTitle)
                && logTable.cell(1, 0).equals(secondColumnTitle);
        assertTrue(moveUpBtnWorks);
    }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

     * @throws InterruptedException
     */
    @Test
    public void testLogTableColumnsMovingOnUpDownButtonsClick() throws InterruptedException {

        SWTBotTable logTable = getLogTable();

        String firstItem = logTable.cell(0, 0); // "Level" by default
        String secondItem = logTable.cell(1, 0); // "Category" by default

        logTable.select(0);
        pressMoveDownButton();
        pressApplyButton();

        closePreferencesDialog();

        SWTBotView log4jView = BOT.viewByTitle("Log4j-Viewer");
        log4jView.show();
        log4jView.setFocus();

        Composite log4jViewComposite = (Composite) log4jView.getWidget();

        Matcher matcher = instanceOf(Table.class);
        SWTBotTable mainViewTable = new SWTBotTable((Table) BOT.widget(matcher, log4jViewComposite));

        String firstColumnName = mainViewTable.columns().get(0);
        String secondColumnName = mainViewTable.columns().get(1);

        boolean moveDownBtnWorks = firstColumnName.equals(secondItem)
                && secondColumnName.equals(firstItem);

        assertTrue(moveDownBtnWorks);

        // open closed preferences page
        openAdditionalPreferencesPage();

        // reparse page controls
        findAndParsePageControls();

        getLogTable().select(1);
        pressMoveUpButton();
        pressApplyButton();

        closePreferencesDialog();

        firstColumnName = mainViewTable.columns().get(0);
        secondColumnName = mainViewTable.columns().get(1);

        boolean moveUpBtnWorks = firstColumnName.equals(firstItem)
                && secondColumnName.equals(secondItem);

        assertTrue(moveUpBtnWorks);
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

    @Ignore
    @Test
    public void testInsertAndDelKeyJob() throws ParseException {

        SWTBotTable filterTable = getFilterTable();

        // setPlaybackDelay(200);

        addFilter();

        filterTable.click(0, 0);

        // TODO: bot can`t push the SWT.Insert key while running this test. It is very disheartening.
        for (int i = 0; i < 3; i++) {
            filterTable.pressShortcut(getKey(SWT.INSERT));
        }

        boolean insertionByKeyWorks = (filterTable.rowCount() == 4);

        for (int i = 0; i < 4; i++) {
            // filterTable.getTableItem(0).select(); // select a first filter
            filterTable.pressShortcut(getKey(SWT.DEL));
        }

        boolean delitionByKeyWorks = (filterTable.rowCount() == 0);

        // setPlaybackDelay(0);

        assertTrue(insertionByKeyWorks);
        assertTrue(delitionByKeyWorks);
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTable

     *             if the current keyCode is not an alphanumeric key code.
     */
    protected void writeToCell(final TableViewer viewer, final int row, final int column, final String text,
            final int editorActivationType) throws ParseException {

        final SWTBotTable table = new SWTBotTable(viewer.getTable());

        table.select(row);

        SWTBotTableItem item = table.getTableItem(row);

        startEditing(viewer, row, column, editorActivationType);

        for (char keyChar : text.toLowerCase().toCharArray()) {
            if (isAlphanumericKey(keyChar)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.