本文整理汇总了Java中org.eclipse.jface.viewers.ILabelDecorator类的典型用法代码示例。如果您正苦于以下问题:Java ILabelDecorator类的具体用法?Java ILabelDecorator怎么用?Java ILabelDecorator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ILabelDecorator类属于org.eclipse.jface.viewers包,在下文中一共展示了ILabelDecorator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DecoratingColumLabelProvider
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
/**
* Constructor.
*
* @param labelProvider
* the {@link ILabelProvider} to decorate
* @param labelDecorator
* the {@link ILabelDecorator} adding decoration
*/
public DecoratingColumLabelProvider(ILabelProvider labelProvider, ILabelDecorator labelDecorator) {
this.labelProvider = labelProvider;
if (labelProvider instanceof IFontProvider) {
this.fontProvider = (IFontProvider)labelProvider;
} else {
this.fontProvider = null;
}
if (labelProvider instanceof IColorProvider) {
this.colorProvider = (IColorProvider)labelProvider;
} else {
this.colorProvider = null;
}
this.labelDecorator = labelDecorator;
if (labelDecorator instanceof CellLabelProvider) {
this.cellLabelProvider = (CellLabelProvider)labelDecorator;
} else {
this.cellLabelProvider = null;
}
}
示例2: initializeConfiguration
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
ILabelDecorator labelDecorator = new SVNParticipantLabelDecorator();
configuration.addLabelDecorator(labelDecorator);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, TOOLBAR_CONTRIBUTION_GROUP);
// Add support for showing mode buttons
configuration.setSupportedModes(ISynchronizePageConfiguration.ALL_MODES);
configuration.setMode(ISynchronizePageConfiguration.BOTH_MODE);
// Create the action group that contributes the get and put actions
configuration.addActionContribution(new SVNParticipantActionGroup());
// Add the get and put group to the context menu
configuration.addMenuGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_1);
}
示例3: EPlanElementLabelProvider
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
public EPlanElementLabelProvider(AdapterFactory factory, boolean markerUpdates) {
super(factory);
if(labelDecorators == null) {
labelDecorators = ClassRegistry.createInstances(ILabelDecorator.class);
}
if (markerUpdates) {
WORKSPACE_LISTENER.register(this);
}
// int i=0;
// StringBuffer buffer = new StringBuffer();
// buffer.append(Thread.currentThread().getName()+"\n");
// for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
// buffer.append("\tat "+element.getClassName()+"."+element.getMethodName()+"("+element.getFileName()+":"+element.getLineNumber()+")\n");
// if (++i > 20) {
// break;
// }
// }
// String trace = buffer.toString();
// if (!traces.contains(trace)) {
// System.out.println(trace);
// traces.add(trace);
// }
}
示例4: getImageWithBadges
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
/**
* Add badges to an existing image given an object. Label decorators that are
* loaded through the ClassRegistry extension point are programmed to decorate
* and existing image given an element.
*
* @param image the image to decorate
* @param element the element which shall determine the decoration
* @return a new decorated image if a decoration was performed, the original
* image otherwise.
*/
private Image getImageWithBadges(Image image, Object element) {
Image decoratedImage = image;
Image previousImage = null;
for(ILabelDecorator labelDecorator : labelDecorators) {
if(!decoratedImage.equals(image)) {
previousImage = decoratedImage;
}
decoratedImage = labelDecorator.decorateImage(image, element);
if(previousImage != null && !previousImage.isDisposed()) {
previousImage.dispose();
}
}
return decoratedImage;
}
示例5: AlternativeNode
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
public AlternativeNode(IEclipseContext context, String editorID, IEditorInputResource alternative, ExplorerNodeChildren children) {
super(context, alternative.getID(), editorID, children);
this.alternative = alternative;
this.alternative.addStatusChangeListener(alternativeStatusListener);
this.alternative.addPropertyChangeListener(alternativeNameListener);
setName(alternative.getName());
setResource(alternative.getResource());
initIcon(alternative);
getContext().set(ILabelDecorator.class, DEFAULT_DECORATOR);
getContext().set(IExplorerConstants.NODE_DATA, alternative);
getContext().set(IValidationStatusProvider.class, alternative);
getContext().set(IEditorInputResource.class, alternative);
}
示例6: initDataBindings
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
protected DataBindingContext initDataBindings(){
DataBindingContext bindingContext = new DataBindingContext();
tableViewerContacts.setContentProvider(contentProvider);
IObservableMap[] observeMaps =
BeansObservables.observeMaps(contentProvider.getKnownElements(), IContact.class,
new String[] {
"description1", "description2", "mandator", "patient", "user"
});
ILabelDecorator decorator =
PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
tableViewerContacts.setLabelProvider(new TableDecoratingLabelProvider(
new ContactSelectorObservableMapLabelProvider(observeMaps), decorator));
tableViewerContacts.setInput(contactList);
return bindingContext;
}
示例7: initDecoratingLabelProvider
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
/**
* Initializes decorator for given EcoreEditor.
*/
private void initDecoratingLabelProvider(EcoreEditor eEditor) {
TreeViewer treeViewer = (TreeViewer) eEditor.getViewer();
ILabelProvider labelProvider = (ILabelProvider) treeViewer.getLabelProvider();
if (labelProvider instanceof DecoratingLabelProvider) {
return;
} else {
ILabelDecorator decorator =
window.getWorkbench().getDecoratorManager().getLabelDecorator();
treeViewer.setLabelProvider(new DecoratingLabelProvider(labelProvider, decorator));
}
}
示例8: dispose
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
public void dispose() {
super.dispose();
ILabelDecorator labelDecorator = getLabelDecorator();
if (labelDecorator != null) {
labelDecorator.dispose();
}
ILabelProvider labelProvider = getLabelProvider();
if (labelProvider != null) {
labelProvider.dispose();
}
}
示例9: getForeground
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
public Color getForeground(Object element) {
ILabelDecorator colorProvider = getLabelDecorator();
if (colorProvider instanceof IColorProvider) {
return ((IColorProvider) colorProvider).getForeground(element);
}
// Default
return null;
}
示例10: getBackground
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
public Color getBackground(Object element) {
ILabelDecorator colorProvider = getLabelDecorator();
if (colorProvider instanceof IColorProvider) {
return ((IColorProvider) colorProvider).getBackground(element);
}
// Default
return null;
}
示例11: getFont
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
public Font getFont(Object element) {
ILabelDecorator fontProvider = getLabelDecorator();
if (fontProvider instanceof IFontProvider) {
return ((IFontProvider) fontProvider).getFont(element);
}
// Default
return null;
}
示例12: ItemsListLabelProvider
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
/**
* Creates a new instance of the class.
*
* @param provider
* the label provider for all items, not <code>null</code>
* @param selectionDecorator
* the decorator for selected items, can be <code>null</code>
*/
public ItemsListLabelProvider(ILabelProvider provider,
ILabelDecorator selectionDecorator) {
Assert.isNotNull(provider);
this.provider = provider;
this.selectionDecorator = selectionDecorator;
setOwnerDrawEnabled(showColoredLabels() && provider instanceof IStyledLabelProvider);
provider.addListener(this);
if (selectionDecorator != null) {
selectionDecorator.addListener(this);
}
}
示例13: setSelectionDecorator
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
/**
* Sets new selection decorator.
*
* @param newSelectionDecorator
* new label decorator for selected items in the list
*/
public void setSelectionDecorator(ILabelDecorator newSelectionDecorator) {
if (selectionDecorator != null) {
selectionDecorator.removeListener(this);
selectionDecorator.dispose();
}
selectionDecorator = newSelectionDecorator;
if (selectionDecorator != null) {
selectionDecorator.addListener(this);
}
}
示例14: DelegatingLabelProviderWithTooltip
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的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);
}
});
}
示例15: createPartControl
import org.eclipse.jface.viewers.ILabelDecorator; //导入依赖的package包/类
@Override
public void createPartControl(final Composite parent)
{
viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
_model = new DataModel();
viewer.setContentProvider(_model);
final LabelProvider labelProvider = new LimpetLabelProvider();
final ILabelDecorator decorator =
PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
viewer.setLabelProvider(new DecoratingLabelProvider(labelProvider,
decorator));
viewer.setInput(_store);
getSite().setSelectionProvider(viewer);
makeActions();
hookContextMenu();
final IActionBars bars = getEditorSite().getActionBars();
fillLocalToolBar(bars.getToolBarManager());
configureDropSupport();
configureDragSupport();
ResourcesPlugin.getWorkspace().addResourceChangeListener(
resourceChangeListener,
IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE
| IResourceChangeEvent.POST_CHANGE);
// and the key listener
configureKeys(viewer);
}