Esempio n. 1
0
  /** @return An Image for an EObject instance */
  private Image getObjectImage(EObject eObject) {
    IElementUIProvider provider = ElementUIFactory.INSTANCE.getProvider(eObject.eClass());
    if (provider != null) {
      return provider.getImage(eObject);
    }

    return getEClassImage(eObject.eClass());
  }
Esempio n. 2
0
  /**
   * Get a default human-readable short name for an EClass
   *
   * @param eClass The Class
   * @return A name or null
   */
  public String getDefaultShortName(EClass eClass) {
    IElementUIProvider provider = ElementUIFactory.INSTANCE.getProvider(eClass);
    if (provider != null) {
      return provider.getDefaultShortName();
    }

    return ""; //$NON-NLS-1$
  }
Esempio n. 3
0
  /**
   * @param eClass
   * @return An ImageDescriptor for an EClass
   */
  public ImageDescriptor getImageDescriptorNonTemplate(EClass eClass) {
    IElementUIProvider provider = ElementUIFactory.INSTANCE.getProvider(eClass);
    if (provider != null) {
      return provider.getImageDescriptor();
    }

    String imageName = getImageName(eClass);
    if (imageName != null) {
      return IZentaImages.ImageFactory.getImageDescriptor(imageName);
    }

    return null;
  }
Esempio n. 4
0
  /** @return An Image for an EClass */
  private Image getEClassImage(EClass eClass) {
    IElementUIProvider provider = ElementUIFactory.INSTANCE.getProvider(eClass);
    if (provider != null) {
      return provider.getImage();
    }

    String imageName = getImageName(eClass);
    if (imageName != null) {
      return IZentaImages.ImageFactory.getImage(imageName);
    }

    return null;
  }