Exemple #1
0
 /**
  * Add a listener for the decorator.If there is an exception then inform the user and disable the
  * receiver. This method should not be called unless a check for isEnabled() has been done first.
  */
 void addListener(ILabelProviderListener listener) {
   try {
     // Internal decorator might be null so be prepared
     IBaseLabelProvider currentDecorator = internalGetLabelProvider();
     if (currentDecorator != null) {
       currentDecorator.addListener(listener);
     }
   } catch (CoreException exception) {
     handleCoreException(exception);
   }
 }
Exemple #2
0
 /**
  * Return whether or not the decorator registered for element has a label property called property
  * name. If there is an exception disable the receiver and return false. This method should not be
  * called unless a check for isEnabled() has been done first.
  */
 boolean isLabelProperty(Object element, String property) {
   try { // Internal decorator might be null so be prepared
     IBaseLabelProvider currentDecorator = internalGetLabelProvider();
     if (currentDecorator != null) {
       return currentDecorator.isLabelProperty(element, property);
     }
   } catch (CoreException exception) {
     handleCoreException(exception);
     return false;
   }
   return false;
 }
Exemple #3
0
 /**
  * Dispose the decorator instance and remove listeners as appropirate.
  *
  * @param disposedDecorator
  */
 protected void disposeCachedDecorator(IBaseLabelProvider disposedDecorator) {
   disposedDecorator.removeListener(WorkbenchPlugin.getDefault().getDecoratorManager());
   disposedDecorator.dispose();
 }