当前位置: 首页>>代码示例>>Java>>正文


Java LabelProviderChangedEvent类代码示例

本文整理汇总了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);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:N4JSProjectExplorerLabelProvider.java

示例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);
				}
			});
		}
	}
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:26,代码来源:DSLLabelDecorator.java

示例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);
			}
		}

	});

}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:27,代码来源:IDEUtil.java

示例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));
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:26,代码来源:SynchronizeLabelDecorator.java

示例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);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:17,代码来源:CoverageDecorator.java

示例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));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:ColoringLabelProvider.java

示例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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:22,代码来源:N4JSProjectExplorerLabelProvider.java

示例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 );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:8,代码来源:ObservableMapStyledCellLabelProvider.java

示例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 ) );
                    }
                }

            }
        } );

    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:31,代码来源:ViewerLabelProvider.java

示例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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:MonitorsLabelProvider.java

示例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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:EventsLabelProvider.java

示例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 );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:ConfigurationCellLabelProvider.java

示例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);
	}
});
  }
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:9,代码来源:DerbyIsRunningDecorator.java

示例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);
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:15,代码来源:TFSLabelDecorator.java

示例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());
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:15,代码来源:SVNLightweightDecorator.java


注:本文中的org.eclipse.jface.viewers.LabelProviderChangedEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。