1 /*****************************************************************************
2 * Copyright (c) 2007, 2012 Intel Corporation, Ericsson
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Intel Corporation - Initial API and implementation
10 * Ruslan A. Scherbakov, Intel - Initial API and implementation
11 * Alvaro Sanchez-Leon - Updated for TMF
12 * Patrick Tasse - Refactoring
13 *****************************************************************************/
15 package org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.widgets
;
17 import java
.util
.ArrayList
;
18 import java
.util
.Iterator
;
19 import java
.util
.List
;
21 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
24 * Selection object for the time graph scale
27 * @author Alvaro Sanchez-Leon
28 * @author Patrick Tasse
30 public class TimeGraphSelection
implements IStructuredSelection
{
32 List
<Object
> list
= new ArrayList
<Object
>();
37 public TimeGraphSelection() {
41 * "Wrapper" constructor. Instantiate a new selection object with only one
45 * The initial selection to add to this one
47 public TimeGraphSelection(Object sel
) {
52 * Add a selection to this one.
55 * The selection to add
57 public void add(Object sel
) {
58 if (null != sel
&& !list
.contains(sel
)) {
64 public Object
getFirstElement() {
65 if (!list
.isEmpty()) {
72 public Iterator
<Object
> iterator() {
73 return list
.iterator();
82 public Object
[] toArray() {
83 return list
.toArray();
87 public List
<Object
> toList() {
92 public boolean isEmpty() {
93 return list
.isEmpty();
This page took 0.031613 seconds and 5 git commands to generate.