1 /*******************************************************************************
2 s * Copyright (c) 2010 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.binding.mutable;
14 import org.simantics.databoard.binding.BooleanBinding;
15 import org.simantics.databoard.binding.error.BindingException;
16 import org.simantics.databoard.primitives.MutableBoolean;
17 import org.simantics.databoard.type.BooleanType;
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;