| 1 |
/** |
| 2 |
* Copyright (c) 2002-2006 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v2.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v20.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* IBM - Initial API and implementation |
| 10 |
*/ |
| 11 |
package org.eclipse.xsd.provider; |
| 12 |
|
| 13 |
|
| 14 |
import java.util.List; |
| 15 |
|
| 16 |
import org.eclipse.emf.common.notify.AdapterFactory; |
| 17 |
import org.eclipse.emf.common.notify.Notification; |
| 18 |
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; |
| 19 |
import org.eclipse.emf.edit.provider.IItemLabelProvider; |
| 20 |
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; |
| 21 |
import org.eclipse.emf.edit.provider.IItemPropertySource; |
| 22 |
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; |
| 23 |
import org.eclipse.emf.edit.provider.ITreeItemContentProvider; |
| 24 |
|
| 25 |
|
| 26 |
/** |
| 27 |
* This is the item provider adpater for a {@link org.eclipse.xsd.XSDComponent} object. |
| 28 |
*/ |
| 29 |
public class XSDComponentItemProvider |
| 30 |
extends XSDConcreteComponentItemProvider |
| 31 |
implements |
| 32 |
IEditingDomainItemProvider, |
| 33 |
IStructuredItemContentProvider, |
| 34 |
ITreeItemContentProvider, |
| 35 |
IItemLabelProvider, |
| 36 |
IItemPropertySource |
| 37 |
{ |
| 38 |
/** |
| 39 |
* This constructs an instance from a factory and a notifier. |
| 40 |
*/ |
| 41 |
public XSDComponentItemProvider(AdapterFactory adapterFactory) |
| 42 |
{ |
| 43 |
super(adapterFactory); |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* This returns the property descriptors for the adapted class. |
| 48 |
*/ |
| 49 |
@Override |
| 50 |
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) |
| 51 |
{ |
| 52 |
if (itemPropertyDescriptors == null) |
| 53 |
{ |
| 54 |
super.getPropertyDescriptors(object); |
| 55 |
} |
| 56 |
return itemPropertyDescriptors; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. |
| 61 |
*/ |
| 62 |
@Override |
| 63 |
public void notifyChanged(Notification msg) |
| 64 |
{ |
| 65 |
super.notifyChanged(msg); |
| 66 |
} |
| 67 |
} |