本文整理汇总了Java中org.eclipse.jface.viewers.ILabelProviderListener类的典型用法代码示例。如果您正苦于以下问题:Java ILabelProviderListener类的具体用法?Java ILabelProviderListener怎么用?Java ILabelProviderListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ILabelProviderListener类属于org.eclipse.jface.viewers包,在下文中一共展示了ILabelProviderListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: N4JSProjectExplorerLabelProvider
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的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: SynchronizeLabelDecorator
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的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));
}
}
});
}
示例3: addListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
/**
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
public void addListener(ILabelProviderListener listener) {
UiCorePlugin.getDefault().getAdapterFactoryLabelProvider().addListener(listener);
// RND:refresh()
// if( ViewerRegistry.getViewer() != null ) {
// ViewerRegistry.getViewer().addPostSelectionChangedListener(new
// ISelectionChangedListener() {
//
// /**
// * @see
// org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
// */
// public void selectionChanged(SelectionChangedEvent event) {
// IStructuredSelection selection = (IStructuredSelection)
// event.getSelection();
// Object obj = selection.getFirstElement();
// if( obj instanceof ITreeNode) {
// FocusRegistry.setFocused( ((ITreeNode) obj).getEObject() );
// }
// }
//
// });
// }
}
示例4: addListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void addListener(ILabelProviderListener listener) {
if (labelDecorator != null) {
labelDecorator.addListener(listener);
}
super.addListener(listener);
}
示例5: removeListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void removeListener(ILabelProviderListener listener) {
if (labelDecorator != null) {
labelDecorator.addListener(listener);
}
super.removeListener(listener);
}
示例6: fireChangeEvent
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的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 ) );
}
}
}
} );
}
}
示例7: setPreserveCase
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
/**
* 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);
}
}
示例8: removeListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
public void removeListener(ILabelProviderListener listener)
{
if (fListeners != null)
{
fListeners.remove(listener);
if (fListeners.isEmpty() && fProblemChangedListener != null)
{
EditorEplPlugin.getDefault().getProblemMarkerManager().removeListener(fProblemChangedListener);
fProblemChangedListener = null;
}
}
}
示例9: removeListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void removeListener(ILabelProviderListener listener) {
if (fListeners == null)
return;
fListeners.remove(listener);
if (fListeners.isEmpty() && fChangeListener != null) {
TypeScriptCorePlugin.getDefault().removeTypeScriptElementChangedListener(fChangeListener);
fChangeListener = null;
}
}
示例10: fireChange
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
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);
}
}
}
示例11: DelegatingLabelProviderWithTooltip
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
/**
*
* @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);
}
});
}
示例12: addListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void addListener(ILabelProviderListener listener) {
n4Labelprovider.addListener(listener);
}
示例13: removeListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void removeListener(ILabelProviderListener listener) {
n4Labelprovider.removeListener(listener);
}
示例14: addListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void addListener(final ILabelProviderListener listener) {
// no listeners are supported
}
示例15: removeListener
import org.eclipse.jface.viewers.ILabelProviderListener; //导入依赖的package包/类
@Override
public void removeListener(final ILabelProviderListener listener) {
// no listeners are supported
}