Java 类org.eclipse.jface.viewers.LabelProviderChangedEvent 实例源码

项目:n4js    文件:N4JSProjectExplorerLabelProvider.java   
/**
 * Sole constructor.
 */
public N4JSProjectExplorerLabelProvider() {
    decorator = new N4JSProjectExplorerProblemsDecorator();
    workbenchLabelProvider = new WorkbenchLabelProvider();
    delegate = new DecoratingLabelProvider(workbenchLabelProvider, decorator);
    workingSetLabelProviderListener = new ILabelProviderListener() {

        @Override
        public void labelProviderChanged(final LabelProviderChangedEvent event) {
            final LabelProviderChangedEvent wrapperEvent = createWorkingSetWrapperEvent(event);
            if (null != wrapperEvent) {
                UIUtils.getDisplay().asyncExec(() -> fireLabelProviderChanged(wrapperEvent));
            }
        }

    };
    delegate.addListener(workingSetLabelProviderListener);
}
项目:gemoc-studio-modeldebugging    文件:DSLLabelDecorator.java   
/**
 * Fires {@link LabelProviderChangedEvent} for the given {@link DSLBreakpoint}.
 * 
 * @param breakpoint
 *            the {@link DSLBreakpoint}
 */
protected void fireLabelProviderChanged(IBreakpoint breakpoint) {
    if (resourceSet != null) {
        final Object instruction = getElement(resourceSet, (DSLBreakpoint)breakpoint);
        if (instruction != null) {
            final LabelProviderChangedEvent event = new LabelProviderChangedEvent(this, instruction);
            Display.getDefault().asyncExec(new Runnable() {

                /**
                 * {@inheritDoc}
                 * 
                 * @see java.lang.Runnable#run()
                 */
                public void run() {
                    fireLabelProviderChanged(event);
                }
            });
        }
    }
}
项目:egradle    文件:IDEUtil.java   
public static void refreshAllProjectDecorations() {
    getSafeDisplay().asyncExec(new Runnable() {

        @Override
        public void run() {
            IWorkbench workbench = PlatformUI.getWorkbench();
            if (workbench == null) {
                return;
            }
            IDecoratorManager manager = workbench.getDecoratorManager();

            IProject[] projects = getAllProjects();

            EGradleProjectDecorator decorator = (EGradleProjectDecorator) manager
                    .getBaseLabelProvider("de.jcup.egradle.eclipse.ide.decorators.EGradleProjectDecorator");
            /* decorate */
            if (decorator != null) { // decorator is enabled

                LabelProviderChangedEvent event = new LabelProviderChangedEvent(decorator, projects);
                decorator.fireLabelProviderChanged(event);
            }
        }

    });

}
项目:team-explorer-everywhere    文件:SynchronizeLabelDecorator.java   
public SynchronizeLabelDecorator(final Subscriber subscriber) {
    this.subscriber = subscriber;

    preferenceStore = new ScopedPreferenceStore(new InstanceScope(), TEAM_UI_PLUGIN_ID);

    decorate = Boolean.TRUE.equals(preferenceStore.getBoolean(DECORATION_PREFERENCE_CONSTANT));

    preferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
        @Override
        public void propertyChange(final PropertyChangeEvent event) {
            if (event.getProperty().equals(DECORATION_PREFERENCE_CONSTANT)) {
                /*
                 * Note that we compare against the string value of the
                 * preference here. Preferences are not strongly typed
                 * (they're strings under the hood), so in the property
                 * change event, we're given the string value.
                 */
                decorate = "true".equals(event.getNewValue()); //$NON-NLS-1$

                ((ILabelProviderListener) listeners.getListener()).labelProviderChanged(
                    new LabelProviderChangedEvent(SynchronizeLabelDecorator.this));
            }
        }
    });
}
项目:eclemma    文件:CoverageDecorator.java   
public CoverageDecorator() {
  super();
  coverageListener = new IJavaCoverageListener() {
    public void coverageChanged() {
      final Display display = EclEmmaUIPlugin.getInstance().getWorkbench()
          .getDisplay();
      display.asyncExec(new Runnable() {
        public void run() {
          fireLabelProviderChanged(new LabelProviderChangedEvent(
              CoverageDecorator.this));
        }
      });
    }
  };
  CoverageTools.addJavaCoverageListener(coverageListener);
}
项目:ModelDebugging    文件:DSLLabelDecorator.java   
/**
 * Fires {@link LabelProviderChangedEvent} for the given {@link DSLBreakpoint}.
 * 
 * @param breakpoint
 *            the {@link DSLBreakpoint}
 */
protected void fireLabelProviderChanged(IBreakpoint breakpoint) {
    if (resourceSet != null) {
        final Object instruction = getElement(resourceSet, (DSLBreakpoint)breakpoint);
        if (instruction != null) {
            final LabelProviderChangedEvent event = new LabelProviderChangedEvent(this, instruction);
            Display.getDefault().asyncExec(new Runnable() {

                /**
                 * {@inheritDoc}
                 * 
                 * @see java.lang.Runnable#run()
                 */
                public void run() {
                    fireLabelProviderChanged(event);
                }
            });
        }
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:ColoringLabelProvider.java   
public void update() {
    ColumnViewer viewer= getViewer();

    if (viewer == null) {
        return;
    }

    boolean needsUpdate= false;

    boolean showColoredLabels= ColoredViewersManager.showColoredLabels();
    if (showColoredLabels != isOwnerDrawEnabled()) {
        setOwnerDrawEnabled(showColoredLabels);
        needsUpdate= true;
    } else if (showColoredLabels) {
        needsUpdate= true;
    }
    if (needsUpdate) {
        fireLabelProviderChanged(new LabelProviderChangedEvent(this));
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:ColoringLabelProvider.java   
public void update() {
    ColumnViewer viewer= getViewer();

    if (viewer == null) {
        return;
    }

    boolean needsUpdate= false;

    boolean showColoredLabels= ColoredViewersManager.showColoredLabels();
    if (showColoredLabels != isOwnerDrawEnabled()) {
        setOwnerDrawEnabled(showColoredLabels);
        needsUpdate= true;
    } else if (showColoredLabels) {
        needsUpdate= true;
    }
    if (needsUpdate) {
        fireLabelProviderChanged(new LabelProviderChangedEvent(this));
    }
}
项目:n4js    文件:N4JSProjectExplorerLabelProvider.java   
/**
 * Creates a wrapper label provider change event with all visible {@link IWorkingSet working sets} if the working
 * set mode is enabled in the {@code Project Explorer}. Otherwise returns with {@code null}.
 *
 * @param event
 *            the original event.
 * @return a wrapper event with all visible working sets (if any) to trigger viewer refresh, or {@code null} if no
 *         viewer refresh is needed.
 */
private LabelProviderChangedEvent createWorkingSetWrapperEvent(final LabelProviderChangedEvent event) {
    if (event instanceof ProblemsLabelChangedEvent && workingSetManagerBroker.isWorkingSetTopLevel()) {
        final WorkingSetManager manager = workingSetManagerBroker.getActiveManager();
        if (null != manager) {
            final WorkingSet[] workingSets = manager.getWorkingSets();
            if (!Arrays2.isEmpty(workingSets)) {
                return new LabelProviderChangedEvent(delegate, workingSets);
            }
        }
    }
    return null;
}
项目:neoscada    文件:ObservableMapStyledCellLabelProvider.java   
@Override
public void handleMapChange ( final MapChangeEvent event )
{
    final Set<?> affectedElements = event.diff.getChangedKeys ();
    final LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent ( ObservableMapStyledCellLabelProvider.this, affectedElements.toArray () );
    fireLabelProviderChanged ( newEvent );
}
项目:neoscada    文件:ViewerLabelProvider.java   
protected final void fireChangeEvent ( final Collection<?> changes )
{

    final LabelProviderChangedEvent event = new LabelProviderChangedEvent ( ViewerLabelProvider.this, changes.toArray () );
    final ILabelProviderListener[] listenerArray = ViewerLabelProvider.this.listeners.toArray ( new ILabelProviderListener[ViewerLabelProvider.this.listeners.size ()] );

    final Display display = getDisplay ();
    if ( !display.isDisposed () )
    {
        display.asyncExec ( new Runnable () {

            public void run ()
            {
                for ( final ILabelProviderListener listener : listenerArray )
                {
                    try
                    {
                        listener.labelProviderChanged ( event );
                    }
                    catch ( final Exception e )
                    {
                        Policy.getLog ().log ( new Status ( IStatus.ERROR, Policy.JFACE_DATABINDING, e.getLocalizedMessage (), e ) );
                    }
                }

            }
        } );

    }
}
项目:neoscada    文件:MonitorsLabelProvider.java   
@Override
public void handleMapChange ( final MapChangeEvent event )
{
    final Set<?> affectedElements = event.diff.getChangedKeys ();
    if ( !affectedElements.isEmpty () )
    {
        final LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent ( MonitorsLabelProvider.this, affectedElements.toArray () );
        fireLabelProviderChanged ( newEvent );
    }
}
项目:neoscada    文件:EventsLabelProvider.java   
@Override
public void handleMapChange ( final MapChangeEvent event )
{
    final Set<?> affectedElements = event.diff.getChangedKeys ();
    if ( !affectedElements.isEmpty () )
    {
        final LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent ( EventsLabelProvider.this, affectedElements.toArray () );
        fireLabelProviderChanged ( newEvent );
    }
}
项目:neoscada    文件:ConfigurationCellLabelProvider.java   
@Override
public void handleMapChange ( final MapChangeEvent event )
{
    final Set<?> affectedElements = event.diff.getChangedKeys ();
    if ( !affectedElements.isEmpty () )
    {
        final LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent ( ConfigurationCellLabelProvider.this, affectedElements.toArray () );
        fireLabelProviderChanged ( newEvent );
    }
}
项目:gemfirexd-oss    文件:DerbyIsRunningDecorator.java   
private void startUpdateDecor(IProject proj) {
    final LabelProviderChangedEvent evnt = new LabelProviderChangedEvent(this, proj); 
Display.getDefault().asyncExec(new Runnable() {
    public void run() {
        fireLabelProviderChanged(evnt);
    }
});
  }
项目:team-explorer-everywhere    文件:TFSLabelDecorator.java   
/**
 * Refresh on the UI thread.
 *
 * @param event
 *        The event to fire on the UI thread
 */
private void refresh(final LabelProviderChangedEvent event) {
    UIHelpers.runOnUIThread(true, new Runnable() {
        @Override
        public void run() {
            fireLabelProviderChanged(event);
        }
    });
}
项目:subclipse    文件:SVNLightweightDecorator.java   
public void refresh(IProject project) {
    final List resources = new ArrayList();
    try {
        project.accept(new IResourceVisitor() {
            public boolean visit(IResource resource) {
                resources.add(resource);
                return true;
            }
        });
        postLabelEvent(new LabelProviderChangedEvent(this, resources.toArray()));
    } catch (CoreException e) {
        SVNProviderPlugin.log(e.getStatus());
    }
}
项目:subclipse    文件:SVNLightweightDecorator.java   
/**
 * Post the label event to the UI thread
 *
 * @param events  the events to post
 */
private void postLabelEvent(final LabelProviderChangedEvent event) {
    Display.getDefault().asyncExec(new Runnable() {
        public void run() {
            fireLabelProviderChanged(event);
        }
    });
}
项目:TranskribusSwtGui    文件:CheckFileTree.java   
/**
 * Sets the preserve case attribute
 * 
 * @param preserveCase
 *            the preserve case attribute
 */
public void setPreserveCase(boolean preserveCase) {
  this.preserveCase = preserveCase;

  // Since this attribute affects how the labels are computed,
  // notify all the listeners of the change.
  LabelProviderChangedEvent event = new LabelProviderChangedEvent(this);
  for (int i = 0, n = listeners.size(); i < n; i++) {
    ILabelProviderListener ilpl = (ILabelProviderListener) listeners
        .get(i);
    ilpl.labelProviderChanged(event);
  }
}
项目:typescript.java    文件:BuildpathIndicatorLabelDecorator.java   
private void fireChange(IResource[] elements) {
    if (fListeners != null && !fListeners.isEmpty()) {
        LabelProviderChangedEvent event = new LabelProviderChangedEvent(this, elements);
        Object[] listeners = fListeners.getListeners();
        for (int i = 0; i < listeners.length; i++) {
            ((ILabelProviderListener) listeners[i]).labelProviderChanged(event);
        }
    }
}
项目:cft    文件:CloudFoundryDecorator.java   
public CloudFoundryDecorator() {
    this.listener = new CloudServerListener() {
        public void serverChanged(final CloudServerEvent event) {
            Display.getDefault().asyncExec(new Runnable() {
                public void run() {
                    LabelProviderChangedEvent labelEvent = new LabelProviderChangedEvent(CloudFoundryDecorator.this);
                    fireLabelProviderChanged(labelEvent);
                }
            });
        }
    };
    ServerEventHandler.getDefault().addServerListener(listener);
}
项目:bts    文件:BTSConfigurationTreeLabelProvider.java   
@Override
public void handleMapChange(MapChangeEvent event)
{
    Set<?> affectedElements = event.diff.getChangedKeys();
    if (!affectedElements.isEmpty())
    {
        LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent(
                BTSConfigurationTreeLabelProvider.this, affectedElements.toArray());
        fireLabelProviderChanged(newEvent);
    }

}
项目:bts    文件:DelegatingLabelProviderWithTooltip.java   
/**
 * 
 * @param wrappedLabelProvider
 * @param decorator
 */
DelegatingLabelProviderWithTooltip(ILabelProvider wrappedLabelProvider, ILabelDecorator decorator) {
    this.wrappedLabelProvider = wrappedLabelProvider;
    this.decorator = decorator;
    wrappedLabelProvider.addListener(new ILabelProviderListener() {

        @Override
        public void labelProviderChanged(LabelProviderChangedEvent event) {
            fireLabelProviderChanged(event);
        }
    });
}
项目:gemfirexd-oss    文件:DerbyIsRunningDecorator.java   
private void startUpdateDecor(IProject proj) {
    final LabelProviderChangedEvent evnt = new LabelProviderChangedEvent(this, proj); 
Display.getDefault().asyncExec(new Runnable() {
    public void run() {
        fireLabelProviderChanged(evnt);
    }
});
  }
项目:dockerfoundry    文件:DockerFoundryDecorator.java   
public DockerFoundryDecorator() {
    this.listener = new CloudServerListener() {
        public void serverChanged(final CloudServerEvent event) {
            Display.getDefault().asyncExec(new Runnable() {
                public void run() {
                    LabelProviderChangedEvent labelEvent = new LabelProviderChangedEvent(DockerFoundryDecorator.this);
                    fireLabelProviderChanged(labelEvent);
                }
            });
        }
    };
    ServerEventHandler.getDefault().addServerListener(listener);
}
项目:eclox    文件:DoxyfileDecorator.java   
/**
 * Notifies listerners that the given resource'l decoration need to be updated
 *
 * @param   resource    a resource to refresh
 */
private void fireProviderChangedEvent(Object resource) {
    Iterator<ILabelProviderListener> i = listeners.iterator();
    LabelProviderChangedEvent event = new LabelProviderChangedEvent(this, resource);

    while (i.hasNext()) {
        ILabelProviderListener listener = (ILabelProviderListener) i.next();

        listener.labelProviderChanged(event);
    }
}
项目:APICloud-Studio    文件:SVNLightweightDecorator.java   
public void refresh(IProject project) {
    final List resources = new ArrayList();
    try {
        project.accept(new IResourceVisitor() {
            public boolean visit(IResource resource) {
                resources.add(resource);
                return true;
            }
        });
        postLabelEvent(new LabelProviderChangedEvent(this, resources.toArray()));
    } catch (CoreException e) {
        SVNProviderPlugin.log(e.getStatus());
    }
}
项目:APICloud-Studio    文件:SVNLightweightDecorator.java   
/**
 * Post the label event to the UI thread
 *
 * @param events  the events to post
 */
private void postLabelEvent(final LabelProviderChangedEvent event) {
    Display.getDefault().asyncExec(new Runnable() {
        public void run() {
            fireLabelProviderChanged(event);
        }
    });
}
项目:APICloud-Studio    文件:ProblemsLabelDecorator.java   
private void fireProblemsChanged(IResource[] changedResources, boolean isMarkerChange)
{
    if (fListeners != null && !fListeners.isEmpty())
    {
        LabelProviderChangedEvent event = new ProblemsLabelChangedEvent(this, changedResources, isMarkerChange);
        Object[] listeners = fListeners.getListeners();
        for (int i = 0; i < listeners.length; i++)
        {
            ((ILabelProviderListener) listeners[i]).labelProviderChanged(event);
        }
    }
}
项目:OpenSPIFe    文件:InfobarUpdater.java   
@Override
public void labelProviderChanged(LabelProviderChangedEvent event) {
    WidgetUtils.runInDisplayThread(infobar, new Runnable() {
        @Override
        public void run() {
            displayContents(data.getNodes(), data.getLeftNode(), data.getLeftTimepoint(), 
                    data.getRightNode(), data.getRightTimepoint(), data.getSelectionStartTime());
        }
    });
   }
项目:OpenSPIFe    文件:TreeTimelineHeaderRowEditPart.java   
@Override
public void labelProviderChanged(LabelProviderChangedEvent event) {
    if (event.getElement() == getModel()) {
        GEFUtils.runInDisplayThread(TreeTimelineHeaderRowEditPart.this, new Runnable() {
            @Override
            public void run() {
                updateTitleVisual();
            }
        });
    }
}
项目:OpenSPIFe    文件:EMFTitleFormPart.java   
@Override
public void labelProviderChanged(LabelProviderChangedEvent event) {
    WidgetUtils.runInDisplayThread(titleComposite, new Runnable() {
        @Override
        public void run() {
            refresh();
        }
    });
}
项目:OpenSPIFe    文件:EMFDetailFormPart.java   
private ILabelProvider getLabelProvider(final Object input) {
    if (labelProvider == null) {
        labelProvider = CommonUtils.getAdapter(input, ILabelProvider.class);
        if (labelProvider == null) {
            AdapterFactory adapterFactory = EMFUtils.getAdapterFactory(input);
            if (adapterFactory != null) {
                AdapterFactoryLabelProvider adlp = new AdapterFactoryLabelProvider(adapterFactory);
                adlp.setFireLabelUpdateNotifications(true); // why do we need to do this?
                labelProvider = adlp;
            }
        }
        if (labelProvider != null) {
            this.labelProviderListener = new ILabelProviderListener() {
                @Override
                public void labelProviderChanged(LabelProviderChangedEvent event) {
                    WidgetUtils.runInDisplayThread(getComposite(), new Runnable() {
                        @Override
                        public void run() {
                            updateTitle();
                        }
                    });
                }
            };
            this.labelProvider.addListener(labelProviderListener);
        }
    }
    return labelProvider;
}
项目:OpenSPIFe    文件:HeaderComposite.java   
@Override
public void labelProviderChanged(LabelProviderChangedEvent event) {
    Object[] elements = event.getElements();
    if ((elements == null) || (Arrays.asList(elements).contains(planElement))) {
        TransactionUtils.runInDisplayThread(imageLabel, planElement, new Runnable() {
            @Override
            public void run() {
                textLabel.setText(labelize(PlanPrinter.getPrintName(planElement)));
                imageLabel.setImage(PlanUtils.getIcon(planElement));
                layout();
            }
        });
    }
}
项目:OpenSPIFe    文件:CompositeListLabelProvider.java   
/**
 * Fires a label provider changed event to all registered listeners
 * Only listeners registered at the time this method is called are notified.
 *
 * @param event a label provider changed event
 *
 * @see ILabelProviderListener#labelProviderChanged
 */
protected void fireLabelProviderChanged(final LabelProviderChangedEvent event) {
    Object[] listeners = this.listeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        final ILabelProviderListener l = (ILabelProviderListener) listeners[i];
        SafeRunnable.run(new SafeRunnable() {
            @Override
public void run() {
                l.labelProviderChanged(event);
            }
        });
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:ChangeTypeWizard.java   
public void grayOut(Collection<ITypeBinding> invalidTypes){
    fInvalidTypes= invalidTypes;
    /*
     * Invalidate all labels. Invalidating only invalid types doesn't
     * work since there can be multiple nodes in the tree that
     * correspond to the same invalid IType. The TreeViewer only updates
     * the label of one of these ITypes and leaves the others in their
     * old state.
     */
    fireLabelProviderChanged(new LabelProviderChangedEvent(this));
}
项目:Eclipse-Postfix-Code-Completion    文件:ProblemsLabelDecorator.java   
private void fireProblemsChanged(IResource[] changedResources, boolean isMarkerChange) {
    if (fListeners != null && !fListeners.isEmpty()) {
        LabelProviderChangedEvent event= new ProblemsLabelChangedEvent(this, changedResources, isMarkerChange);
        Object[] listeners= fListeners.getListeners();
        for (int i= 0; i < listeners.length; i++) {
            ((ILabelProviderListener) listeners[i]).labelProviderChanged(event);
        }
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:AbstractJavaElementLabelDecorator.java   
private void fireChange(IJavaElement[] elements) {
    if (fListeners != null && !fListeners.isEmpty()) {
        LabelProviderChangedEvent event= new LabelProviderChangedEvent(this, elements);
        Object[] listeners= fListeners.getListeners();
        for (int i= 0; i < listeners.length; i++) {
            ((ILabelProviderListener) listeners[i]).labelProviderChanged(event);
        }
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:SearchLabelProvider.java   
final void doSearchPropertyChange(PropertyChangeEvent event) {
    if (fPotentialMatchFgColor == null)
        return;
    if (POTENTIAL_MATCH_FG_COLOR.equals(event.getProperty()) || EMPHASIZE_POTENTIAL_MATCHES.equals(event.getProperty())) {
        fPotentialMatchFgColor.dispose();
        fPotentialMatchFgColor= null;
        LabelProviderChangedEvent lpEvent= new LabelProviderChangedEvent(SearchLabelProvider.this, null); // refresh all
        fireLabelProviderChanged(lpEvent);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:MethodsLabelProvider.java   
public MethodsLabelProvider(TypeHierarchyLifeCycle lifeCycle, MethodsViewer methodsViewer) {
    super(DEFAULT_TEXTFLAGS | JavaElementLabels.P_COMPRESSED, DEFAULT_IMAGEFLAGS);
    fHierarchy= lifeCycle;
    fShowDefiningType= false;
    fMethodsViewer= methodsViewer;
    fColorRegistryListener= new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(ColoredViewersManager.INHERITED_COLOR_NAME)) {
                fireLabelProviderChanged(new LabelProviderChangedEvent(MethodsLabelProvider.this, null));
            }
        }
    };
    JFaceResources.getColorRegistry().addListener(fColorRegistryListener);
}