blob: f80ff29253f65105e1d56dc9d2d21042703a7924 (
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
|
/*****************************************************************************
* Copyright (c) 2011, 2014 CEA LIST and others.
*
* 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
* Christian W. Damus (CEA) - bug 417409
*
*****************************************************************************/
package org.eclipse.papyrus.uml.properties.databinding;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.infra.services.edit.ui.databinding.AggregatedPapyrusObservableValue;
import org.eclipse.papyrus.infra.tools.databinding.AggregatedObservable;
import org.eclipse.papyrus.infra.tools.databinding.CommandBasedObservableValue;
import org.eclipse.papyrus.infra.tools.databinding.ReferenceCountedObservable;
/**
* An Abstract Class for Papyrus Command-based observable values
*
* @author Camille Letavernier
* @since 3.3
*
*/
public abstract class AbstractUMLAggregatedObservableValue extends ReferenceCountedObservable.Value implements AggregatedObservable, CommandBasedObservableValue {
protected EditingDomain domain;
protected AbstractUMLAggregatedObservableValue(EditingDomain domain) {
this.domain = domain;
}
/**
* {@inheritDoc}
*/
@Override
public AggregatedObservable aggregate(IObservable observable) {
try {
return new AggregatedPapyrusObservableValue(domain, this, observable);
} catch (IllegalArgumentException ex) {
return null; // The observable cannot be aggregated
}
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasDifferentValues() {
return false;
}
}
|