| /******************************************************************************* |
| * Copyright (c) 2009 Matthew Hall and others. |
| * 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: |
| * Matthew Hall - initial API and implementation (bug 263868) |
| * Matthew Hall - bug 268203 |
| ******************************************************************************/ |
| |
| package org.eclipse.core.internal.databinding.property.set; |
| |
| import java.util.Set; |
| |
| import org.eclipse.core.databinding.observable.set.SetDiff; |
| import org.eclipse.core.databinding.property.INativePropertyListener; |
| import org.eclipse.core.databinding.property.ISimplePropertyListener; |
| import org.eclipse.core.databinding.property.set.SimpleSetProperty; |
| |
| /** |
| * @since 3.3 |
| * |
| */ |
| public final class SelfSetProperty extends SimpleSetProperty { |
| private final Object elementType; |
| |
| /** |
| * @param elementType |
| */ |
| public SelfSetProperty(Object elementType) { |
| this.elementType = elementType; |
| } |
| |
| public Object getElementType() { |
| return elementType; |
| } |
| |
| protected Set doGetSet(Object source) { |
| return (Set) source; |
| } |
| |
| protected void doSetSet(Object source, Set set, SetDiff diff) { |
| diff.applyTo((Set) source); |
| } |
| |
| public INativePropertyListener adaptListener( |
| ISimplePropertyListener listener) { |
| return null; // no listener API |
| } |
| |
| protected void doAddListener(Object source, INativePropertyListener listener) { |
| } |
| |
| protected void doRemoveListener(Object source, |
| INativePropertyListener listener) { |
| } |
| } |