Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ebb85ab741fc574a8d531f1110e9e5e5c47d3ecd (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*****************************************************************************
 * 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 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *  Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.uml.properties.datatype;

import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;


public class StringDataTypeObservableValue extends PapyrusObservableValue implements DataTypeObservableValue {

	protected EDataType type;

	public StringDataTypeObservableValue() {
		super(null, null, null);
	}

	@Override
	public Object getValueType() {
		return type.getInstanceClass();
	}

	public void setOwner(EObject owner, EStructuralFeature feature, EditingDomain domain, EDataType type) {
		this.eObject = owner;
		this.eStructuralFeature = feature;
		this.domain = domain;
		this.type = type;
	}

	@Override
	public String toString() {
		return getValue() == null ? "" : getValue().toString(); //$NON-NLS-1$
	}
}

Back to the top