Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<copyright> Copyright (c) 2002-2006 IBM Corporation 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: IBM - Initial API and implementation </copyright> $Id: XSDAnnotationItemProvider.java,v 1.5 2006/12/29 18:32:33 marcelop Exp $
 
 package org.eclipse.xsd.provider;
 
 
 import java.util.List;
 
 
 
This is the item provider adpater for a org.eclipse.xsd.XSDAnnotation object.
 
   implements 
 {
  
This constructs an instance from a factory and a notifier.
 
   public XSDAnnotationItemProvider(AdapterFactory adapterFactory)
   {
     super(adapterFactory);
   }

  
This returns the property descriptors for the adapted class.
 
   @Override
   {
     if ( == null)
     {
       super.getPropertyDescriptors(object);
     }
     return ;
   }

  
This returns XSDAnnotation.gif.
 
   @Override
   public Object getImage(Object object)
   {
     return ..getImage("full/obj16/XSDAnnotation");
   }
 
   @Override
   public String getText(Object object)
   {
     XSDAnnotation xsdAnnotation = ((XSDAnnotation)object);
     String result = "";
     List<ElementuserInformation = xsdAnnotation.getUserInformation();
     if (!userInformation.isEmpty())
     {
       Element element = userInformation.get(0);
       if (element.hasAttribute(.))
       {
         result = element.getAttribute(.);
       }
       else
       {
         org.w3c.dom.Node text = element.getFirstChild(); 
         while (text instanceof Element)
         {
           text = ((Element)text).getFirstChild();
         }
         if (text != null && text.getNodeValue() != null)
        {
          result = text.getNodeValue();
          result = result.trim();
          if (result.length() > 50)
          {
            result = result.substring(0, 50) + ..getString("_UI_DotDotDot_label");
          }
        }
      }
    }
    return result;
  }

  
This handles notification by calling fireNotifyChanged.
  public void notifyChanged(Notification msg
  {
    super.notifyChanged(msg);
  }
New to GrepCode? Check out our FAQ X