Ejemplo n.º 1
0
  /**
   * Returns a shared image for this Java element.
   *
   * <p>see ITypedInput.getImage
   */
  public Image getImage() {

    ImageDescriptor id = null;

    switch (getTypeCode()) {
      case CU:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.COMPILATION_UNIT);
        break;
      case PACKAGE:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.PACKAGE_DECLARATION);
        break;
      case IMPORT:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.IMPORT_DECLARATION);
        break;
      case IMPORT_CONTAINER:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.IMPORT_CONTAINER);
        break;
      case CLASS:
        id = JavaCompareUtilities.getTypeImageDescriptor(true);
        break;
      case INTERFACE:
        id = JavaCompareUtilities.getTypeImageDescriptor(false);
        break;
      case INIT:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.INITIALIZER);
        break;
      case CONSTRUCTOR:
      case METHOD:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.METHOD);
        break;
      case FIELD:
        id = JavaCompareUtilities.getImageDescriptor(IJavaElement.FIELD);
        break;
      case ENUM:
        id = JavaCompareUtilities.getEnumImageDescriptor();
        break;
      case ANNOTATION:
        id = JavaCompareUtilities.getAnnotationImageDescriptor();
        break;
    }
    return JavaPlugin.getImageDescriptorRegistry().get(id);
  }
 public ScriptLabelProvider(ImageDescriptor descriptor) {
   ImageDescriptorRegistry registry = JavaPlugin.getImageDescriptorRegistry();
   fElementImage = registry.get(descriptor);
 }
Ejemplo n.º 3
0
 protected Image getJdtImage(ImageDescriptor descriptor) {
   return JavaPlugin.getImageDescriptorRegistry().get(descriptor);
 }