Debian Codegraph @

plugins/org.eclipse.xsd.edit/src/org/eclipse/xsd/provider/XSDMaxExclusiveFacetItemProvider.java

raw
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.edit.provider.ComposeableAdapterFactory;
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 import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
25
26
27 /**
28 * This is the item provider adpater for a {@link org.eclipse.xsd.XSDMaxExclusiveFacet} object.
29 */
30 public class XSDMaxExclusiveFacetItemProvider
31 extends XSDMaxFacetItemProvider
32 implements
33 IEditingDomainItemProvider,
34 IStructuredItemContentProvider,
35 ITreeItemContentProvider,
36 IItemLabelProvider,
37 IItemPropertySource
38 {
39 /**
40 * This constructs an instance from a factory and a notifier.
41 */
42 public XSDMaxExclusiveFacetItemProvider(AdapterFactory adapterFactory)
43 {
44 super(adapterFactory);
45 }
46
47 /**
48 * This returns the property descriptors for the adapted class.
49 */
50 @Override
51 public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
52 {
53 if (itemPropertyDescriptors == null)
54 {
55 super.getPropertyDescriptors(object);
56
57 // This is for the value feature.
58 //
59 itemPropertyDescriptors.add
60 (new ItemPropertyDescriptor
61 (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
62 XSDEditPlugin.INSTANCE.getString("_UI_Value_label"),
63 XSDEditPlugin.INSTANCE.getString("_UI_ValueMaxExclusiveFacet_description"),
64 xsdPackage.getXSDMaxFacet_Value(),
65 true,
66 ItemPropertyDescriptor.TEXT_VALUE_IMAGE));
67
68 }
69 return itemPropertyDescriptors;
70 }
71
72 /**
73 * This returns XSDMaxExclusiveFacet.gif.
74 */
75 @Override
76 public Object getImage(Object object)
77 {
78 return XSDEditPlugin.INSTANCE.getImage("full/obj16/XSDMaxExclusiveFacet");
79 }
80 }