示例#1
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
   */
  public Image getImage(Object element) {
    String key = null;
    IStatus status = Status.OK_STATUS;
    if (element instanceof LibraryStandin) {
      LibraryStandin library = (LibraryStandin) element;
      IPath sourcePath = library.getSystemLibrarySourcePath();
      if (sourcePath != null && !Path.EMPTY.equals(sourcePath)) {
        key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE_WITH_SOURCE;
      } else {
        key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE;
      }
      status = library.validate();

    } else if (element instanceof SubElement) {
      if (((SubElement) element).getType() == SubElement.SOURCE_PATH) {
        key = ISharedImages.IMG_OBJS_JAR_WITH_SOURCE;
      } else {
        key = ISharedImages.IMG_OBJS_JAVADOCTAG;
      }
    }
    if (key != null) {
      if (!status.isOK()) {
        ImageDescriptor base = JavaUI.getSharedImages().getImageDescriptor(key);
        JDIImageDescriptor descriptor =
            new JDIImageDescriptor(base, JDIImageDescriptor.IS_OUT_OF_SYNCH);
        return JDIDebugUIPlugin.getImageDescriptorRegistry().get(descriptor);
      }
      return JavaUI.getSharedImages().getImage(key);
    }
    return null;
  }
示例#2
0
 /* (non-Javadoc)
  * @see java.lang.Object#equals(java.lang.Object)
  */
 public boolean equals(Object obj) {
   if (obj instanceof LibraryStandin) {
     LibraryStandin lib = (LibraryStandin) obj;
     return getSystemLibraryPath().equals(lib.getSystemLibraryPath())
         && equals(getSystemLibrarySourcePath(), lib.getSystemLibrarySourcePath())
         && equals(getPackageRootPath(), lib.getPackageRootPath())
         && equalURLs(getJavadocLocation(), lib.getJavadocLocation());
   }
   return false;
 }