-/*****************************************************************************\r
- * Copyright (c) 2007 Intel Corporation, 2009, 2012 Ericsson.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * Intel Corporation - Initial API and implementation\r
- * Ruslan A. Scherbakov, Intel - Initial API and implementation\r
- * Alvaro Sanchez-Leon - Updated for TMF\r
- * Patrick Tasse - Refactoring\r
- *\r
- *****************************************************************************/\r
-\r
-package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Iterator;\r
-import java.util.List;\r
-\r
-import org.eclipse.jface.viewers.IStructuredSelection;\r
-\r
-/**\r
- * Selection object for the time graph scale\r
- *\r
- * @version 1.0\r
- * @author Alvaro Sanchez-Leon\r
- * @author Patrick Tasse\r
- */\r
-public class TimeGraphSelection implements IStructuredSelection {\r
-\r
- List<Object> list = new ArrayList<Object>();\r
-\r
- /**\r
- * Default constructor\r
- */\r
- public TimeGraphSelection() {\r
- }\r
-\r
- /**\r
- * "Wrapper" constructor. Instantiate a new selection object with only one\r
- * existing selection.\r
- *\r
- * @param sel\r
- * The initial selection to add to this one\r
- */\r
- public TimeGraphSelection(Object sel) {\r
- add(sel);\r
- }\r
-\r
- /**\r
- * Add a selection to this one.\r
- *\r
- * @param sel\r
- * The selection to add\r
- */\r
- public void add(Object sel) {\r
- if (null != sel && !list.contains(sel)) {\r
- list.add(sel);\r
- }\r
- }\r
-\r
- @Override\r
- public Object getFirstElement() {\r
- if (!list.isEmpty()) {\r
- return list.get(0);\r
- }\r
- return null;\r
- }\r
-\r
- @Override\r
- public Iterator<Object> iterator() {\r
- return list.iterator();\r
- }\r
-\r
- @Override\r
- public int size() {\r
- return list.size();\r
- }\r
-\r
- @Override\r
- public Object[] toArray() {\r
- return list.toArray();\r
- }\r
-\r
- @Override\r
- public List<Object> toList() {\r
- return list;\r
- }\r
-\r
- @Override\r
- public boolean isEmpty() {\r
- return list.isEmpty();\r
- }\r
-}\r
+/*****************************************************************************
+ * Copyright (c) 2007 Intel Corporation, 2009, 2012 Ericsson.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Intel Corporation - Initial API and implementation
+ * Ruslan A. Scherbakov, Intel - Initial API and implementation
+ * Alvaro Sanchez-Leon - Updated for TMF
+ * Patrick Tasse - Refactoring
+ *
+ *****************************************************************************/
+
+package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+/**
+ * Selection object for the time graph scale
+ *
+ * @version 1.0
+ * @author Alvaro Sanchez-Leon
+ * @author Patrick Tasse
+ */
+public class TimeGraphSelection implements IStructuredSelection {
+
+ List<Object> list = new ArrayList<Object>();
+
+ /**
+ * Default constructor
+ */
+ public TimeGraphSelection() {
+ }
+
+ /**
+ * "Wrapper" constructor. Instantiate a new selection object with only one
+ * existing selection.
+ *
+ * @param sel
+ * The initial selection to add to this one
+ */
+ public TimeGraphSelection(Object sel) {
+ add(sel);
+ }
+
+ /**
+ * Add a selection to this one.
+ *
+ * @param sel
+ * The selection to add
+ */
+ public void add(Object sel) {
+ if (null != sel && !list.contains(sel)) {
+ list.add(sel);
+ }
+ }
+
+ @Override
+ public Object getFirstElement() {
+ if (!list.isEmpty()) {
+ return list.get(0);
+ }
+ return null;
+ }
+
+ @Override
+ public Iterator<Object> iterator() {
+ return list.iterator();
+ }
+
+ @Override
+ public int size() {
+ return list.size();
+ }
+
+ @Override
+ public Object[] toArray() {
+ return list.toArray();
+ }
+
+ @Override
+ public List<Object> toList() {
+ return list;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return list.isEmpty();
+ }
+}