1 /*******************************************************************************
\r
2 s * Copyright (c) 2010 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.databoard.binding.mutable;
14 import org.simantics.databoard.binding.BooleanBinding;
\r
15 import org.simantics.databoard.binding.error.BindingException;
\r
16 import org.simantics.databoard.primitives.MutableBoolean;
\r
17 import org.simantics.databoard.type.BooleanType;
\r
20 * Binds BooleanType to {@link MutableBoolean}
22 * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
24 public class MutableBooleanBinding extends BooleanBinding {
26 public MutableBooleanBinding(BooleanType type) {
30 public Object create(boolean value) {
31 MutableBoolean result = new MutableBoolean();
36 public Object create(Boolean value) {
37 MutableBoolean result = new MutableBoolean();
43 public void setValue(Object obj, boolean newValue) throws BindingException {
44 MutableBoolean result = (MutableBoolean) obj;
45 result.value = newValue;
49 public void setValue(Object obj, Boolean newValue) throws BindingException {
50 MutableBoolean result = (MutableBoolean) obj;
51 result.value = newValue;
54 public Boolean getValue(Object o) {
55 return ((MutableBoolean)o).value;
59 public boolean getValue_(Object o) {
60 return ((MutableBoolean)o).value;
64 public boolean isInstance(Object obj) {
65 return obj instanceof MutableBoolean;