• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JTableFixture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.fest.swing.fixture.JTableFixture的典型用法代码示例。如果您正苦于以下问题:Java JTableFixture类的具体用法?Java JTableFixture怎么用?Java JTableFixture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JTableFixture类属于org.fest.swing.fixture包,在下文中一共展示了JTableFixture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: JMVAdeletingManyStationsAndClasses

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Creates 3 additional classes (on top the existing 1) and deletes three
 * of them by highlighting them and pressing the 'delete' button.
 * Verifies the classes were deleted.
 * Then does a similar thing with stations
 */
@Test
public void JMVAdeletingManyStationsAndClasses() {
	jmva.label(new TextLabelMatcher("Classes")).click();
	jmva.button(new TextButtonMatcher("New Class")).click();
	jmva.button(new TextButtonMatcher("New Class")).click();
	jmva.button(new TextButtonMatcher("New Class")).click();
	JTableFixture classesTable = jmva.table("ClassTable");
	classesTable.selectRows(1, 2, 3);
	classesTable.pressAndReleaseKey(KeyPressInfo.keyCode(127));
	assertEquals(1, classesTable.component().getRowCount());
	jmva.label(new TextLabelMatcher("Stations")).click();
	jmva.button(new TextButtonMatcher("New Station")).click();
	jmva.button(new TextButtonMatcher("New Station")).click();
	jmva.button(new TextButtonMatcher("New Station")).click();
	JTableFixture stationsTable = jmva.table("StationTable");
	stationsTable.selectRows(0, 1, 2);
	stationsTable.pressAndReleaseKey(KeyPressInfo.keyCode(127));
	assertEquals(1, stationsTable.component().getRowCount());
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:26,代码来源:JmvaGuiTest.java


示例2: getFieldValue

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Get table field value
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the element doesn't exist
 */
@Override
@PublicAtsApi
public String getFieldValue(
                             int row,
                             int column ) {

    new SwingElementState(this).waitToBecomeExisting();

    try {
        return ((JTableFixture) SwingElementLocator.findFixture(this)).valueAt(new TableCell(row,
                                                                                             column) {});
    } catch (IndexOutOfBoundsException ioobe) {

        throw new UiElementException(ioobe.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:24,代码来源:SwingTable.java


示例3: clickCell

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Click table cell
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void clickCell(
                       int row,
                       int column ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);

    try {
        tableFixture.cell(new TableCell(row, column) {}).click();
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:23,代码来源:SwingTable.java


示例4: doubleClickCell

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Double click table cell
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the element doesn't exist
 */
@PublicAtsApi
public void doubleClickCell(
                             int row,
                             int column ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);

    try {
        tableFixture.cell(new TableCell(row, column) {}).doubleClick();
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:23,代码来源:SwingTable.java


示例5: rightClickCell

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Right click on table cell
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void rightClickCell(
                            int row,
                            int column ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);

    try {
        tableFixture.cell(new TableCell(row, column) {}).rightClick();
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:23,代码来源:SwingTable.java


示例6: selectCell

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Select table cell
 *
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void selectCell(
                        int row,
                        int column ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);

    try {
        tableFixture.selectCell(new TableCell(row, column) {});
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:23,代码来源:SwingTable.java


示例7: selectCells

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Select table cells
 *
 * @param cells the cells coordinates (eg. new int[][]{ { 1, 1 }, { 1, 2 }, { 2, 2 } )
 * @throws VerificationException if the element doesn't exist
 */
@PublicAtsApi
public void selectCells(
                         int[][] cells ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {

        TableCell[] cellsToSelect = new TableCell[cells.length];
        for (int i = 0; i < cells.length; i++) {
            int row = cells[i][0];
            int column = cells[i][1];
            cellsToSelect[i] = new TableCell(row, column) {};
        }
        tableFixture.selectCells(cellsToSelect);
    } catch (Exception e) {

        throw new UiElementException(e.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:28,代码来源:SwingTable.java


示例8: clickHeader

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Click table header by column index
 *
 * @param columnIndex the column index
 * @throws VerificationException if the table element doesn't exist
 */
@PublicAtsApi
public void clickHeader(
                         int columnIndex ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    JTableHeaderFixture tableHeaderFixture = tableFixture.tableHeader();

    try {
        tableHeaderFixture.clickColumn(columnIndex);
    } catch (Exception e) {
        throw new UiElementException(e.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:22,代码来源:SwingTable.java


示例9: getCellBackgroundColors

import org.fest.swing.fixture.JTableFixture; //导入依赖的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;
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:32,代码来源:SwingTable.java


示例10: testParentLabelCell

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test @IdeGuiTest
public void testParentLabelCell() throws IOException {
  IdeFrameFixture projectFrame = importSimpleApplication();
  ThemeEditorFixture themeEditor = openThemeEditor(projectFrame);

  JTableFixture themeEditorTable = themeEditor.getThemeEditorTable();
  assertNotNull(themeEditorTable);

  // Cell (0,0) should be Theme parent
  JTableCellFixture parentLabelCell = themeEditorTable.cell(row(0).column(0));
  final String parentName = themeEditorTable.valueAt(row(0).column(1));
  assertNotNull(parentName);
  parentLabelCell.requireNotEditable();
  parentLabelCell.requireValue("Theme Parent");

  testParentPopup(parentLabelCell, parentName, themeEditor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ThemeEditorTableTest.java


示例11: removeDeviceByName

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@NotNull
public ChooseDeviceDefinitionStepFixture removeDeviceByName(@NotNull final String deviceName) {
  JTableFixture deviceListFixture = getTableFixture();

  deviceListFixture.cell(deviceName).click(RIGHT_BUTTON);

  JPopupMenu popupMenu = robot().findActivePopupMenu();
  assertNotNull(popupMenu);
  JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), popupMenu);
  contextMenuFixture.menuItem(new GenericTypeMatcher<JMenuItem>(JMenuItem.class) {
    @Override
    protected boolean isMatching(@NotNull JMenuItem component) {
      return "Delete".equals(component.getText());
    }
  }).click();

  MessagesFixture.findByTitle(robot(), target(), "Confirm Deletion").clickYes();
  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ChooseDeviceDefinitionStepFixture.java


示例12: editAvdWithName

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
public AvdEditWizardFixture editAvdWithName(@NotNull String name) {
  final TableView tableView = robot().finder().findByType(target(), TableView.class, true);
  JTableFixture tableFixture = new JTableFixture(robot(), tableView);
  JTableCellFixture cell = tableFixture.cell(name);
  final TableCell actionCell = TableCell.row(cell.row()).column(7);

  JTableCellFixture actionCellFixture = tableFixture.cell(actionCell);

  execute(new GuiTask() {
    @Override
    protected void executeInEDT() throws Throwable {
      tableView.editCellAt(actionCell.row, actionCell.column);
    }
  });

  JPanel actionPanel = (JPanel)actionCellFixture.editor();
  HyperlinkLabel editButtonLabel = robot().finder().find(actionPanel, new GenericTypeMatcher<HyperlinkLabel>(HyperlinkLabel.class) {
    @Override
    protected boolean isMatching(@NotNull HyperlinkLabel component) {
      return "Edit this AVD".equals(component.getToolTipText());
    }
  });
  robot().click(editButtonLabel);
  return AvdEditWizardFixture.find(robot());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AvdManagerDialogFixture.java


示例13: deleteAvdByName

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
public void deleteAvdByName(String name) {
  TableView tableView = robot().finder().findByType(target(), TableView.class, true);
  JTableFixture tableFixture = new JTableFixture(robot(), tableView);

  JTableCellFixture cell = tableFixture.cell(name);
  cell.click(RIGHT_BUTTON);

  JPopupMenu contextMenu = robot().findActivePopupMenu();
  assertNotNull(contextMenu);
  JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), contextMenu);
  contextMenuFixture.menuItem(new GenericTypeMatcher<JMenuItem>(JMenuItem.class) {
    @Override
    protected boolean isMatching(@NotNull JMenuItem component) {
      return "Delete".equals(component.getText());
    }
  }).click();

  MessagesFixture.findByTitle(robot(), target(), "Confirm Deletion").clickYes();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AvdManagerDialogFixture.java


示例14: linkClocksDeleteAllTest

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test // issue #414
public void linkClocksDeleteAllTest() throws Exception {
	warning("Load gopher data 26.nex, 47.nex, 59.nex");
	importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));

	JTabbedPaneFixture f = beautiFrame.tabbedPane();
	printBeautiState(f);

	selectRows(0, 1, 2);

	warning("Link clocks");
	f.selectTab("Partitions");
	beautiFrame.button("Link Clock Models").click();
	
	beautiFrame.button("-").click();

	JTableFixture t = beautiFrame.table();
	Assertions.assertThat(t.target.getRowCount()).isEqualTo(0);
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:20,代码来源:LinkUnlinkTest.java


示例15: editKeyWithStringValue

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test
    public void editKeyWithStringValue() throws Exception {
        JTableFixture editionTreeTable = frameFixture.table("editionTreeTable").cellReader(new JsonTableCellReader());

//        edit 'label' key
        editionTreeTable.enterValue(TableCell.row(1).column(1), "Hello");

        frameFixture.button("saveButton").click();

        ArgumentCaptor<DBObject> argument = ArgumentCaptor.forClass(DBObject.class);
        verify(mockMongoOperations).updateMongoDocument(argument.capture());

        Assert.assertEquals("{ \"_id\" : { \"$oid\" : \"50b8d63414f85401b9268b99\"} , \"label\" : \"Hello\" , \"visible\" : false , \"image\" :  null }",
                argument.getValue().toString());

        verify(mockActionCallback, times(1)).onOperationSuccess(any(String.class));
    }
 
开发者ID:dboissier,项目名称:nosql4idea,代码行数:18,代码来源:MongoEditionPanelTest.java


示例16: addKeyWithSomeValue

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test
public void addKeyWithSomeValue() throws Exception {
    JTableFixture editionTreeTable = frameFixture.table("editionTreeTable").cellReader(new JsonTableCellReader());


    editionTreeTable.selectCell(TableCell.row(1).column(1));
    mongoEditionPanel.addKey("stringKey", "pouet");

    editionTreeTable.selectCell(TableCell.row(1).column(1));
    mongoEditionPanel.addKey("numberKey", "1.1");

    editionTreeTable.requireContents(new String[][]{
            {"_id", "50b8d63414f85401b9268b99"},
            {"label", "toto"},
            {"visible", "false"},
            {"image", "null"},
            {"stringKey", "pouet"},
            {"numberKey", "1.1"},
    });
}
 
开发者ID:dboissier,项目名称:nosql4idea,代码行数:21,代码来源:MongoEditionPanelTest.java


示例17: linkTreesAndDeleteTest2a

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test
public void linkTreesAndDeleteTest2a() throws Exception {
	warning("Load gopher data 26.nex, 47.nex");
	importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"));

	JTabbedPaneFixture f = beautiFrame.tabbedPane();
	printBeautiState(f);

	JTableFixture t = beautiFrame.table();
	t.selectCells(TableCell.row(0).column(0), TableCell.row(1).column(0));

	warning("Link trees");
	f.selectTab("Partitions");
	beautiFrame.button("Link Trees").click();
	printBeautiState(f);

	warning("Delete second partition");
	f.selectTab("Partitions");
	beautiFrame.table().selectCell(TableCell.row(1).column(0));
	beautiFrame.button("-").click();
	printBeautiState(f);
	assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
	
	makeSureXMLParses();
}
 
开发者ID:rbouckaert,项目名称:YABBY,代码行数:26,代码来源:LinkUnlinkTest.java


示例18: linkTreesAndDeleteTest2b

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test
public void linkTreesAndDeleteTest2b() throws Exception {
	warning("Load gopher data 26.nex, 47.nex");
	importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"));

	JTabbedPaneFixture f = beautiFrame.tabbedPane();
	printBeautiState(f);

	JTableFixture t = beautiFrame.table();
	t.selectCells(TableCell.row(0).column(0), TableCell.row(1).column(0));

	warning("Link trees");
	f.selectTab("Partitions");
	beautiFrame.button("Link Trees").click();
	printBeautiState(f);

	warning("Delete first partition");
	f.selectTab("Partitions");
	beautiFrame.table().selectCell(TableCell.row(0).column(0));
	beautiFrame.button("-").click();
	printBeautiState(f);
	assertPriorsEqual("YuleModel.t:26", "YuleBirthRatePrior.t:26");
	
	makeSureXMLParses();
}
 
开发者ID:rbouckaert,项目名称:YABBY,代码行数:26,代码来源:LinkUnlinkTest.java


示例19: setFieldValue

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Set table field value
 *
 * @param value the value to set
 * @param row the row number
 * @param column the column number
 * @throws VerificationException if the element doesn't exist
 */
@Override
@PublicAtsApi
public void setFieldValue(
                           String value,
                           int row,
                           int column ) {

    new SwingElementState(this).waitToBecomeExisting();

    JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
    try {

        TableCell tableCell = new TableCell(row, column) {};
        tableFixture.selectCell(tableCell); // if the cell coordinates are wrong, the exception will be thrown
        if (tableFixture.component().isCellEditable(row, column)) {

            tableFixture.enterValue(tableCell, value);
        } else {

            throw new NotSupportedOperationException("The table cell [" + row + "," + column
                                                     + "] is not editable. " + toString());
        }
    } catch (IndexOutOfBoundsException ioobe) {

        throw new UiElementException(ioobe.getMessage(), this);
    }
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:36,代码来源:SwingTable.java


示例20: getRowCount

import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
 * Get table row count
 *
 * @throws VerificationException if the table element doesn't exist
 */
@Override
@PublicAtsApi
public int getRowCount() {

    new SwingElementState(this).waitToBecomeExisting();

    return ((JTableFixture) SwingElementLocator.findFixture(this)).rowCount();
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:14,代码来源:SwingTable.java



注:本文中的org.fest.swing.fixture.JTableFixture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Union类代码示例发布时间:1970-01-01
下一篇:
Java IsArrayWithSize类代码示例发布时间:1970-01-01
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap