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


Java ILabelDecorator类代码示例

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

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

示例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);
//		}
	}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:25,代码来源:EPlanElementLabelProvider.java

示例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;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:27,代码来源:EPlanElementLabelProvider.java

示例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);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:18,代码来源:AlternativeNode.java

示例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;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:ContactSelectorView.java

示例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));
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:16,代码来源:Startup.java

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

示例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;
}
 
开发者ID:aroog,项目名称:code,代码行数:10,代码来源:ArchitecturalDecoratingLabelProvider.java

示例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;
}
 
开发者ID:aroog,项目名称:code,代码行数:10,代码来源:ArchitecturalDecoratingLabelProvider.java

示例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;
}
 
开发者ID:aroog,项目名称:code,代码行数:10,代码来源:ArchitecturalDecoratingLabelProvider.java

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

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

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

示例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);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:31,代码来源:DataManagerEditor.java


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