/*
   * @see ContentViewer#handleLabelProviderChanged(LabelProviderChangedEvent)
   */
  protected void handleLabelProviderChanged(LabelProviderChangedEvent event) {
    if (event instanceof ProblemsLabelChangedEvent) {
      ProblemsLabelChangedEvent e = (ProblemsLabelChangedEvent) event;
      if (!e.isMarkerChange() && canIgnoreChangesFromAnnotionModel()) {
        return;
      }
    }

    Object[] changed = event.getElements();
    if (changed != null && !fResourceToItemsMapper.isEmpty()) {
      ArrayList others = new ArrayList(changed.length);
      for (int i = 0; i < changed.length; i++) {
        Object curr = changed[i];
        if (curr instanceof IResource) {
          fResourceToItemsMapper.resourceChanged((IResource) curr);
        } else {
          others.add(curr);
        }
      }
      if (others.isEmpty()) {
        return;
      }
      event =
          new LabelProviderChangedEvent((IBaseLabelProvider) event.getSource(), others.toArray());
    }
    super.handleLabelProviderChanged(event);
  }
Esempio n. 2
0
 public void labelProviderChanged(LabelProviderChangedEvent event) {
   Object[] elements = event.getElements();
   for (int i = 0; i < elements.length; i++) {
     Object object = elements[i];
     if (object == getInput()) updateHeader();
   }
 }