Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'incoming/org.eclipse.papyrus.properties.notation/src/org/eclipse/papyrus/properties/notation/databinding/GradientDataObservableValue.java')
-rw-r--r--incoming/org.eclipse.papyrus.properties.notation/src/org/eclipse/papyrus/properties/notation/databinding/GradientDataObservableValue.java84
1 files changed, 0 insertions, 84 deletions
diff --git a/incoming/org.eclipse.papyrus.properties.notation/src/org/eclipse/papyrus/properties/notation/databinding/GradientDataObservableValue.java b/incoming/org.eclipse.papyrus.properties.notation/src/org/eclipse/papyrus/properties/notation/databinding/GradientDataObservableValue.java
deleted file mode 100644
index 43f28bfa7e3..00000000000
--- a/incoming/org.eclipse.papyrus.properties.notation/src/org/eclipse/papyrus/properties/notation/databinding/GradientDataObservableValue.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.properties.notation.databinding;
-
-import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
-import org.eclipse.gmf.runtime.notation.datatype.GradientData;
-
-
-public class GradientDataObservableValue extends AbstractObservableValue {
-
- private GradientData data;
-
- private GradientProperty property;
-
- public GradientDataObservableValue(GradientData data, String property) {
- this.data = data;
- this.property = GradientProperty.valueOf(property);
- }
-
- public Object getValueType() {
- return Integer.class;
- }
-
- @Override
- protected Object doGetValue() {
- if(data == null) {
- return null;
- }
-
- switch(property) {
- case gradientColor1:
- return data.getGradientColor1();
- case gradientColor2:
- return data.getGradientColor2();
- case gradientStyle:
- return data.getGradientStyle();
- case activate:
- if(data instanceof ObservableGradientData) {
- return ((ObservableGradientData)data).getActivate();
- } else {
- return true;
- }
- }
-
- return null;
- }
-
- @Override
- protected void doSetValue(Object value) {
- if(data == null) {
- return;
- }
-
- switch(property) {
- case gradientColor1:
- data.setGradientColor1((Integer)value);
- break;
- case gradientColor2:
- data.setGradientColor2((Integer)value);
- break;
- case gradientStyle:
- data.setGradientStyle((Integer)value);
- break;
- case activate:
- if(data instanceof ObservableGradientData) {
- ((ObservableGradientData)data).setActivate((Boolean)value);
- }
- }
- }
-
- private static enum GradientProperty {
- gradientColor2, gradientColor1, gradientStyle, activate
- }
-
-}

Back to the top