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


Java IStyledLabelProvider类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider的典型用法代码示例。如果您正苦于以下问题:Java IStyledLabelProvider类的具体用法?Java IStyledLabelProvider怎么用?Java IStyledLabelProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IStyledLabelProvider类属于org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider包,在下文中一共展示了IStyledLabelProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
public void update(ViewerCell cell) {
	Object element = cell.getElement();

	if (!(element instanceof ItemsListSeparator)
			&& provider instanceof IStyledLabelProvider) {
		IStyledLabelProvider styledLabelProvider = (IStyledLabelProvider) provider;
		StyledString styledString = getStyledText(element,
				styledLabelProvider);

		cell.setText(styledString.getString());
		cell.setStyleRanges(styledString.getStyleRanges());
		cell.setImage(styledLabelProvider.getImage(element));
	} else {
		cell.setText(getText(element));
		cell.setImage(getImage(element));
	}
	cell.setFont(getFont(element));
	cell.setForeground(getForeground(element));
	cell.setBackground(getBackground(element));

	super.update(cell);
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:23,代码来源:FilteredItemsSelectionDialog.java

示例2: getStyledText

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
/**
 * Subclasses should rather override {@link #doGetText}.
 */
public StyledString getStyledText(Object element) {
	StyledString styledText = convertToStyledString(doGetText(element));
	if (styledText != null) {
		return styledText;
	} else if (delegate != null) {
		if (delegate instanceof IStyledLabelProvider) {
			styledText = ((IStyledLabelProvider) delegate).getStyledText(element);
			if (styledText != null) {
				return styledText;
			}
		} else {
			styledText = convertToStyledString(delegate.getText(element));
			if (styledText != null) {
				return styledText;
			}
		}
	}
	return getDefaultStyledText();
}
 
开发者ID:cplutte,项目名称:bts,代码行数:23,代码来源:AbstractLabelProvider.java

示例3: AlternativeResourceNode

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
public AlternativeResourceNode(IEclipseContext context, IFile file) {
	super(context, file.getName(), null, null);
	
	setResource(file);
	
	ModelType type = ModelType.getModelType(file.getFileExtension());
	if(type != null){
		setName(type.getDisplayName());
	}
	else{
		setName(file.getName());
	}
	
	getContext().set(IExplorerConstants.NODE_DATA, file);
	getContext().set(IFile.class, file);
	getContext().set(IStyledLabelProvider.class, DEFAULT_LABEL_STYLE);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:18,代码来源:AlternativeResourceNode.java

示例4: _text

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
/**
 * Default for textDispatcher with two arguments.
 *
 * @param modelElement
 *          the {@link EObject} model element
 * @return the label text
 */
// CHECKSTYLE:CHECK-OFF Name (dispatcher enforces names starting with underscore)
protected Object _text(final Object modelElement) {
  // CHECKSTYLE:CHECK-ON
  if (getLabelProvider() instanceof IStyledLabelProvider) {
    return ((IStyledLabelProvider) getLabelProvider()).getStyledText(modelElement);
  } else {
    return getLabelProvider().getText(modelElement);
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:17,代码来源:AbstractOutlineTreeProvider.java

示例5: ItemsListLabelProvider

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的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

示例6: setProvider

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
/**
 * Sets new label provider.
 *
 * @param newProvider
 *            new label provider for items in the list, not
 *            <code>null</code>
 */
public void setProvider(ILabelProvider newProvider) {
	Assert.isNotNull(newProvider);
	provider.removeListener(this);
	provider.dispose();

	provider = newProvider;

	if (provider != null) {
		provider.addListener(this);
	}

	setOwnerDrawEnabled(showColoredLabels() && provider instanceof IStyledLabelProvider);
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:21,代码来源:FilteredItemsSelectionDialog.java

示例7: getStyledText

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
private StyledString getStyledText(Object element,
		IStyledLabelProvider provider) {
	StyledString string = provider.getStyledText(element);

	if (selectionDecorator != null && isSelected(element)) {
		String decorated = selectionDecorator.decorateText(string
				.getString(), element);
		return StyledCellLabelProvider.styleDecoratedString(decorated, null, string);
		// no need to add colors when element is selected
	}
	return string;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:13,代码来源:FilteredItemsSelectionDialog.java

示例8: getStyledText

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
public StyledString getStyledText(Object element) {
	if (element == null) {
		return new StyledString(Messages.GlobalDescriptionLabelProvider_0);
	} else {
		ILabelProvider descriptionLabelProvider = lookupDescriptionLabelProvider(element);
		if (descriptionLabelProvider instanceof IStyledLabelProvider)
			return ((IStyledLabelProvider) descriptionLabelProvider).getStyledText(element);
		else if(descriptionLabelProvider != null) {
			return new StyledString(descriptionLabelProvider.getText(element));
		} else {
			return new StyledString(element.toString());
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:15,代码来源:GlobalDescriptionLabelProvider.java

示例9: _text

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
/**
 * Default for textDispatcher
 */
protected Object _text(Object modelElement) {
	if (labelProvider instanceof IStyledLabelProvider)
		return ((IStyledLabelProvider) labelProvider).getStyledText(modelElement);
	else
		return labelProvider.getText(modelElement);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:10,代码来源:DefaultOutlineTreeProvider.java

示例10: wrapLabelProvider

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected ILabelProvider wrapLabelProvider(ILabelProvider labelProvider) {
    if(labelProvider instanceof IStyledLabelProvider) {
        return new DecoratingLabelProvider(
                (IStyledLabelProvider)labelProvider);
    }
    return labelProvider;
}
 
开发者ID:insweat,项目名称:hssd,代码行数:8,代码来源:MultiPageEditorWithTextPage.java

示例11: getStyledParticipantText

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected StyledString getStyledParticipantText(Object element) {
	ILabelProvider labelProvider= getLabelProvider(element);
	if (labelProvider instanceof IStyledLabelProvider)
		return ((IStyledLabelProvider) labelProvider).getStyledText(element);
	if (labelProvider != null)
		return new StyledString(labelProvider.getText(element));
	return new StyledString();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:SearchLabelProvider.java

示例12: createdStyledLabelProvider

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected IStyledLabelProvider createdStyledLabelProvider() {
	IStyledLabelProvider labelProvider = new JenkinsEditorOutlineLabelProvider();
	return labelProvider;
}
 
开发者ID:de-jcup,项目名称:eclipse-jenkins-editor,代码行数:5,代码来源:JenkinsQuickOutlineDialog.java

示例13: createLabelProvider

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
@Override
protected IBaseLabelProvider createLabelProvider() {
	IStyledLabelProvider labelProvider = createdStyledLabelProvider();
	return new DelegatingStyledCellLabelProvider(labelProvider);
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:6,代码来源:AbstractGroovyBasedQuickOutline.java

示例14: createdStyledLabelProvider

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected IStyledLabelProvider createdStyledLabelProvider() {
	IStyledLabelProvider labelProvider = new GradleEditorOutlineLabelProvider();
	return labelProvider;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:5,代码来源:GradleQuickOutlineDialog.java

示例15: getText

import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected Object getText(Object modelElement) {
	if (labelProvider instanceof IStyledLabelProvider)
		return ((IStyledLabelProvider) labelProvider).getStyledText(modelElement);
	else
		return labelProvider.getText(modelElement);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:7,代码来源:BackgroundOutlineTreeProvider.java


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