Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a0fc112a268f17062a060c6149ac3924f8fe197d (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
 * Copyright (c) 2012 Mia-Software.
 *
 * 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:
 *  	Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
 *  	Grégoire Dupé (Mia-Software) - Bug 387470 - [EFacet][Custom] Editors
 */
package org.eclipse.papyrus.emf.facet.util.ui.utils;

/**
 * Generic class representing all the properties like:
 * <ol>
 * <li>facetName</li>
 * <li>upperBound</li>
 * <li>unique</li>
 * <li>...</li>
 * </ol>
 *
 * @since 0.3
 */
public class PropertyElement {

	// TODO This class must not be exposed.

	private final String name;
	private final Class<?> type;
	private boolean changeable;
	private Object value;

	/**
	 * Constructor
	 *
	 * @param name
	 *            the name of the property.
	 * @param type
	 *            the type of the property.
	 * @param changeable
	 *            if the property can be changed (edited) or not.
	 */
	public PropertyElement(final String name, final Class<?> type,
			final boolean changeable) {
		this(name, type, changeable, null);
	}

	/**
	 * Constructor
	 *
	 * @param name
	 *            the name of the property.
	 * @param type
	 *            the type of the property.
	 * @param changeable
	 *            if the property can be changed (edited) or not.
	 * @param value
	 *            the initial value of the property.
	 */
	public PropertyElement(final String name, final Class<?> type,
			final boolean changeable, final Object value) {
		super();
		this.name = name;
		this.type = type;
		this.changeable = changeable;
		this.value = value;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * @return the changeable
	 */
	public boolean isChangeable() {
		return this.changeable;
	}

	/**
	 * @return the type
	 */
	public Class<?> getType() {
		return this.type;
	}

	/**
	 * @return the value
	 */
	public Object getValue() {
		return this.value;
	}

	/**
	 * set the value.
	 */
	public void setValue(final Object value) {
		this.value = value;
	}

	/**
	 * @param changeable
	 *            the changeable to set
	 */
	public void setChangeable(final boolean changeable) {
		this.changeable = changeable;
	}
}

Back to the top