Debian Codegraph @

plugins/org.eclipse.xsd.edit/src/org/eclipse/xsd/provider/XSDMaxFacetItemProvider.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 org.eclipse.emf.common.notify.AdapterFactory;
15 import org.eclipse.emf.common.notify.Notification;
16 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
17 import org.eclipse.emf.edit.provider.IItemLabelProvider;
18 import org.eclipse.emf.edit.provider.IItemPropertySource;
19 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
20 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
21
22 import org.eclipse.xsd.XSDMaxFacet;
23
24
25 /**
26 * This is the item provider adpater for a {@link org.eclipse.xsd.XSDMaxFacet} object.
27 */
28 public class XSDMaxFacetItemProvider
29 extends XSDFixedFacetItemProvider
30 implements
31 IEditingDomainItemProvider,
32 IStructuredItemContentProvider,
33 ITreeItemContentProvider,
34 IItemLabelProvider,
35 IItemPropertySource
36 {
37 /**
38 * This constructs an instance from a factory and a notifier.
39 */
40 public XSDMaxFacetItemProvider(AdapterFactory adapterFactory)
41 {
42 super(adapterFactory);
43 }
44
45 @Override
46 public String getText(Object object)
47 {
48 XSDMaxFacet xsdMaxFacet = (XSDMaxFacet)object;
49 String result = xsdMaxFacet.getLexicalValue();
50 return result == null ? "" : result;
51 }
52
53 /**
54 * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}.
55 */
56 @Override
57 public void notifyChanged(Notification msg)
58 {
59 if (msg.getFeature() == xsdPackage.getXSDMaxFacet_Value())
60 {
61 fireNotifyChanged(msg);
62 }
63 else
64 {
65 super.notifyChanged(msg);
66 }
67 }
68 }