Project

General

Profile

Download (1.03 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2011 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.dataportal.elements;
11

    
12
import java.util.ArrayList;
13
import java.util.List;
14

    
15
import org.openqa.selenium.By;
16
import org.openqa.selenium.RenderedWebElement;
17
import org.openqa.selenium.WebElement;
18

    
19
public class DescriptionElementRepresentation extends BaseElement{
20

    
21
	List sources = new ArrayList(); // may be LinkElement or BaseElement
22

    
23
	public List getSources() {
24
		return sources;
25
	}
26

    
27
	/**
28
	 * @param element
29
	 */
30
	public DescriptionElementRepresentation(RenderedWebElement element) {
31
		super(element);
32

    
33
		for (WebElement source : element.findElements(By.className("sources"))) {
34
			if(source.getTagName().equals("a")){
35
				sources.add(new LinkElement((RenderedWebElement) source));
36
			} else {
37
				sources.add(new BaseElement((RenderedWebElement) source));
38
			}
39
		}
40
	}
41

    
42
}
(2-2/6)