本文整理汇总了Java中org.eclipse.jface.viewers.LabelProviderChangedEvent类的典型用法代码示例。如果您正苦于以下问题:Java LabelProviderChangedEvent类的具体用法?Java LabelProviderChangedEvent怎么用?Java LabelProviderChangedEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LabelProviderChangedEvent类属于org.eclipse.jface.viewers包,在下文中一共展示了LabelProviderChangedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: N4JSProjectExplorerLabelProvider
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
/**
* 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);
}
示例2: fireLabelProviderChanged
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
/**
* 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);
}
});
}
}
}
示例3: refreshAllProjectDecorations
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
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);
}
}
});
}
示例4: SynchronizeLabelDecorator
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
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));
}
}
});
}
示例5: CoverageDecorator
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
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);
}
示例6: update
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
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));
}
}
示例7: createWorkingSetWrapperEvent
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
/**
* 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;
}
示例8: handleMapChange
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
@Override
public void handleMapChange ( final MapChangeEvent event )
{
final Set<?> affectedElements = event.diff.getChangedKeys ();
final LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent ( ObservableMapStyledCellLabelProvider.this, affectedElements.toArray () );
fireLabelProviderChanged ( newEvent );
}
示例9: fireChangeEvent
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
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 ) );
}
}
}
} );
}
}
示例10: handleMapChange
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
@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 );
}
}
示例11: handleMapChange
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
@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 );
}
}
示例12: handleMapChange
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
@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 );
}
}
示例13: startUpdateDecor
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
private void startUpdateDecor(IProject proj) {
final LabelProviderChangedEvent evnt = new LabelProviderChangedEvent(this, proj);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
fireLabelProviderChanged(evnt);
}
});
}
示例14: refresh
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
/**
* 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);
}
});
}
示例15: refresh
import org.eclipse.jface.viewers.LabelProviderChangedEvent; //导入依赖的package包/类
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());
}
}