Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6eb5c5f05ed183bf90c48e8dd215d70c7257fd29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.eclipse.jpt.jpadiagrameditor.swtbot.tests.ui.editor;

import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;

public class ElementIsShown extends DefaultCondition{
	
	private String entityName;
	private SWTBotGefEditor gefEditor;
	
	public ElementIsShown(SWTBotGefEditor gefEditor, String entityName){
		super();
		this.gefEditor = gefEditor;
		this.entityName = entityName;
	}

	public boolean test() throws Exception {
		return gefEditor.getEditPart(entityName) != null;
	}

	public String getFailureMessage() {
		return "Entity with name ''" + entityName +  "'' did not show.";
	}

}

Back to the top