tmf: Move plugins to the Trace Compass namespace
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui.swtbot.tests / src / org / eclipse / linuxtools / tmf / ui / swtbot / tests / conditions / TableCellFilled.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.swtbot.tests.conditions;
14
15 import org.eclipse.swtbot.swt.finder.SWTBot;
16 import org.eclipse.swtbot.swt.finder.waits.ICondition;
17 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
18
19 /**
20 * Is a table cell filled? tests if the table cell has a given content.
21 *
22 * @author Bernd Hufmann
23 */
24 class TableCellFilled implements ICondition {
25
26 private final SWTBotTable fTable;
27 private final String fContent;
28 private final int fRow;
29 private final int fColumn;
30
31 public TableCellFilled(SWTBotTable table, String content, int row, int column) {
32 fTable = table;
33 fContent = content;
34 fRow = row;
35 fColumn = column;
36 }
37
38 @Override
39 public boolean test() throws Exception {
40 try {
41 return fContent.equals(fTable.cell(fRow, fColumn));
42 } catch (Exception e) {
43 }
44 return false;
45 }
46
47 @Override
48 public void init(SWTBot bot) {
49 }
50
51 @Override
52 public String getFailureMessage() {
53 return null;
54 }
55
56 }
This page took 0.030841 seconds and 5 git commands to generate.