コード例 #1
0
  /*
   * @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);
  }