本文整理匯總了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
}