本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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());
}
}
}
示例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);
}
示例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;
}
示例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();
}
示例12: createdStyledLabelProvider
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected IStyledLabelProvider createdStyledLabelProvider() {
IStyledLabelProvider labelProvider = new JenkinsEditorOutlineLabelProvider();
return labelProvider;
}
示例13: createLabelProvider
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
@Override
protected IBaseLabelProvider createLabelProvider() {
IStyledLabelProvider labelProvider = createdStyledLabelProvider();
return new DelegatingStyledCellLabelProvider(labelProvider);
}
示例14: createdStyledLabelProvider
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; //导入依赖的package包/类
protected IStyledLabelProvider createdStyledLabelProvider() {
IStyledLabelProvider labelProvider = new GradleEditorOutlineLabelProvider();
return labelProvider;
}
示例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);
}