/* (non-Javadoc)
  * @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object, org.eclipse.jface.viewers.IDecoration)
  */
 public void decorate(Object element, IDecoration decoration) {
   int adornmentFlags = computeAdornmentFlags(element);
   if (adornmentFlags == ERRORTICK_ERROR) {
     decoration.addOverlay(PluginImages.DESC_OVR_ERROR);
   } else if (adornmentFlags == ERRORTICK_WARNING) {
     decoration.addOverlay(PluginImages.DESC_OVR_WARNING);
   }
 }
Ejemplo n.º 2
0
 public void decorate(final Object element, final IDecoration decoration) {
   final int adornmentFlags = computeAdornmentFlags(element);
   if (adornmentFlags == ERRORTICK_ERROR) {
     decoration.addOverlay(ErlideImage.OVR_ERROR.getDescriptor());
   } else if (adornmentFlags == ERRORTICK_WARNING) {
     decoration.addOverlay(ErlideImage.OVR_WARNING.getDescriptor());
   }
 }
 /** Decorate the project root if it has the OpenJPA nature. */
 public void decorate(Object element, IDecoration decoration) {
   if (!(element instanceof IProject)) {
     return;
   }
   try {
     if (((IProject) element).hasNature(OpenJPANature.NATURE_ID)) {
       decoration.addOverlay(decor);
     } else {
       decoration.addOverlay(null);
     }
   } catch (CoreException e) {
   }
 }
Ejemplo n.º 4
0
 @Override
 public void decorate(Object element, IDecoration decoration) {
   ImageDescriptor imageDescriptor = computeAdornmentFlags(element);
   if (imageDescriptor != null) {
     decoration.addOverlay(imageDescriptor);
   }
 }
Ejemplo n.º 5
0
  public void decorate(Object element, IDecoration decoration) {
    if (!(element instanceof IResource)) return;
    IResource resource = (IResource) element;
    if (!resource.exists()) return;
    IProject project = resource.getProject();
    if (project == null) {
      Log.error(
          Messages.getString("ErrorDecorator.PROJECT_FOR")
              + resource.getName()
              + Messages.getString("ErrorDecorator.IS_NULL"),
          new Throwable()); //$NON-NLS-1$ //$NON-NLS-2$
      return;
    }
    try {
      if (!project.isOpen()) return;
      project.open(null);
      if (project.hasNature(LSLProjectNature.ID)) {
        LSLProjectNature nature = (LSLProjectNature) project.getNature(LSLProjectNature.ID);

        if (nature == null) return;

        IMarker[] m =
            resource.findMarkers("lslforge.problem", true, IResource.DEPTH_INFINITE); // $NON-NLS-1$

        if (m == null || m.length == 0) return;
      } else {
        return;
      }
    } catch (CoreException e) {
      Log.error("exception caught trying to determine project nature!", e); // $NON-NLS-1$
      return;
    }

    decoration.addOverlay(descriptor, IDecoration.BOTTOM_LEFT);
  }
  public void decorate(Object element, IDecoration decoration) {
    if (element instanceof IProject) {
      IProject project = (IProject) element;

      ImageDescriptor overlay = null;

      if (hasFacet(project, PORTLET_FACET)) {
        overlay = getPortlet();
      } else if (hasFacet(project, HOOK_FACET)) {
        overlay = getHook();
      } else if (hasFacet(project, EXT_FACET)) {
        overlay = getExt();
      } else if (hasFacet(project, LAYOUTTPL_FACET)) {
        overlay = getLayoutTpl();
      } else if (hasFacet(project, THEME_FACET)) {
        overlay = getTheme();
      }

      if (overlay != null) {
        // next two lines dangerous!
        // DecorationContext ctx = (DecorationContext) decoration.getDecorationContext();
        // ctx.putProperty( IDecoration.ENABLE_REPLACE, true );

        decoration.addOverlay(overlay);
      }
    }
  }
 @Override
 public void decorate(Object element, IDecoration decoration) {
   // rather than check the class for the isSynchronizedMethod through
   // reflection, only consider the known classes
   if (!isSynchronized(element)) {
     decoration.addOverlay(SYNC_OVERLAY, IDecoration.BOTTOM_LEFT);
   }
 }
Ejemplo n.º 8
0
 private void decorate(INewsgroup newsgroup, IDecoration decoration) {
   Debug.log(
       this.getClass(),
       "Decorating newsgroup: "
           + newsgroup.getNewsgroupName()
           + " - "
           + newsgroup.getArticleCount());
   decoration.addSuffix(" (" + newsgroup.getArticleCount() + ")");
 }
 public void decorate(Object element, IDecoration decoration) {
   try {
     final IResource resource = (IResource) element;
     if (resource.exists() && TaggedMarkerHelper.getMarker(resource) != null) {
       decoration.addOverlay(
           OVERLAY,
           TaggerActivator.getDefault()
               .getPreferenceStore()
               .getInt(PreferenceConstants.POSITION_LABEL_DECORATION.getKey()));
     }
   } catch (CoreException ce) {
     TaggerLog.error("Unable to decorate resource: " + ce.getMessage(), ce);
   }
 }
 public void decorate(Object element, IDecoration decoration) {
   IProject proj = null;
   if (element instanceof IJavaProject) {
     proj = ((IJavaProject) element).getProject();
   } else {
     proj = (IProject) element;
   }
   try {
     if (DerbyServerUtils.getDefault().getRunning(proj)) {
       decoration.addOverlay(derbyRunningImageDesc);
     }
   } catch (CoreException ce) {
     Logger.log(SelectionUtil.getStatusMessages(ce), IStatus.ERROR);
   }
 }
  /**
   * {@inheritDoc}
   *
   * @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object,
   *     org.eclipse.jface.viewers.IDecoration)
   */
  @Override
  public void decorate(final Object element, final IDecoration decoration) {
    ImageDescriptor overlay = null;
    final Display display = Display.getDefault();

    if (display.isDisposed()) {
      return;
    }

    if (element instanceof ModeShapeServer) {
      final ModeShapeServer server = (ModeShapeServer) element;

      // if server is offline then decorate with error overlay
      try {
        _offlineServersLock.readLock().lock();

        if (_offlineServerMap.containsKey(server)) {
          overlay = Activator.getDefault().getImageDescriptor(IUiConstants.ERROR_OVERLAY_IMAGE);
        }
      } finally {
        _offlineServersLock.readLock().unlock();
      }
    } else if (element instanceof IFile) {
      final IFile file = (IFile) element;

      if (file.exists()
          && !file.isHidden()
          && new PublishedResourceHelper(getServerManager()).isPublished((IFile) element)) {
        overlay = Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
      }
    }

    if (overlay != null) {
      decoration.addOverlay(overlay);
    }
  }
 /** Will decorate the element with the bookmark icon */
 public void decorate(Object element, IDecoration decoration) {
   if (hasBookmark(element)) {
     decoration.addOverlay(ImageDescription.getBookmarkDescriptor());
   }
 }