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


Java ViewerCell.setFont方法代码示例

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


在下文中一共展示了ViewerCell.setFont方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@Override
public void update ( final ViewerCell cell )
{
    final Object element = cell.getElement ();
    if ( element instanceof TreeNode )
    {
        final TreeNode node = (TreeNode)element;
        cell.setText ( node.getName () );

        final CurrentStyle style = node.getStyle ();
        cell.setImage ( style.image );
        cell.setFont ( style.font );
        cell.setForeground ( style.foreground );
        cell.setBackground ( style.background );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:17,代码来源:NameLabelProviderImpl.java

示例2: applyCellDefaultStyles

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private RankedItem<T> applyCellDefaultStyles(final ColumnOptions<T> options, ViewerCell cell) {
	final RankedItem<T> rankedItem = (RankedItem<T>) cell.getElement();
	cell.setForeground(fromRegistry(options.getFontColor()));
	int rowState = rowStateResolver.apply(rankedItem);
	
    if ((rowState & RowState.SELECTED.value) != 0 && options.isEnableBackgroundSelection()) {
		cell.setBackground(fromRegistry(new RGB(225,226,206)));
	} else {
		cell.setBackground(fromRegistry(options.getBackgroundColor()));
	}
    if ((rowState & RowState.CURSOR.value) != 0 && options.isEnableBackgroundSelection()) {
		cell.setBackground(fromRegistry(ColorUtil.blend(cell.getBackground().getRGB(), new RGB(200,200,200))));
    }
	Font font = createColumnFont(options, cell);
	cell.setFont(font);
	return rankedItem;
}
 
开发者ID:dakaraphi,项目名称:eclipse-plugin-commander,代码行数:19,代码来源:KaviListColumns.java

示例3: update

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

示例4: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
@Override
public void update(ViewerCell cell) {
	try {
		Object element = cell.getElement();
		StyledString st = getStyledText(element);
		cell.setText(st.getString());
		cell.setStyleRanges(getStyledText(element).getStyleRanges());
		cell.setImage(getImage(element));
		cell.setBackground(getBackground(element));
		cell.setForeground(getForeground(element));
		cell.setFont(getFont(element));
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:ReportTreeLabelProvider.java

示例5: setCellFontStyle

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
private void setCellFontStyle(final ViewerCell cell, final int style) {
    if (style == SWT.ITALIC) {
        if (italicFont == null) {
            italicFont = createFont(cell.getFont(), SWT.ITALIC);
        }
        cell.setFont(italicFont);
    } else if (style == SWT.BOLD) {
        if (boldFont == null) {
            boldFont = createFont(cell.getFont(), SWT.BOLD);
        }
        cell.setFont(boldFont);
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:14,代码来源:GitImportWizardSelectProjectsPage.java

示例6: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
public void update(ViewerCell cell) {
	// labels
	cell.setText(getColumnText(cell.getElement(), cell.getColumnIndex()));
	
	// images
	cell.setImage(getColumnImage(cell.getElement(), cell.getColumnIndex()));
	
	// font
	cell.setFont(getFont(cell.getElement(), cell.getColumnIndex()));
	
	// colors
	cell.setForeground(getForeground(cell.getElement(), cell.getColumnIndex()));
	cell.setBackground(getBackground(cell.getElement(), cell.getColumnIndex()));
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:15,代码来源:TLCErrorView.java

示例7: update

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
/**************************************************************************
 * 
 *************************************************************************/
@Override
   public void update(ViewerCell cell)
   {
	Object element = cell.getElement();
    cell.setText(getText(element));
    cell.setBackground(getBackground(element));
    cell.setForeground(getForeground(element));
    cell.setImage(getImage(element));
    cell.setFont(getFont(element));
   }
 
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:14,代码来源:HistoryTreeLabelProvider.java

示例8: updateListEntry

import org.eclipse.jface.viewers.ViewerCell; //导入方法依赖的package包/类
private void updateListEntry ( final ListEntry listEntry, final ViewerCell cell )
{
    cell.setFont ( listEntry.getFont () );
    cell.setForeground ( listEntry.getForeground () );
    cell.setBackground ( listEntry.getBackground () );

    switch ( cell.getColumnIndex () )
    {
        case 0:
            cell.setImage ( listEntry.getImage () );
            cell.setText ( listEntry.getDataItem ().getItem ().getId () );
            break;
        case 1:
            if ( listEntry.getSubscriptionError () != null )
            {
                cell.setText ( String.format ( "%s (%s)", listEntry.getSubscriptionState (), listEntry.getSubscriptionError ().getMessage () ) ); //$NON-NLS-1$
            }
            else
            {
                cell.setText ( listEntry.getSubscriptionState ().name () );
            }
            break;
        case 2:
            if ( listEntry.getValue () != null )
            {
                cell.setText ( listEntry.getValue ().getType ().name () );
            }
            break;
        case 3:
            if ( listEntry.getValue () != null )
            {
                cell.setText ( listEntry.getValue ().asString ( "<null>" ) ); //$NON-NLS-1$
            }
            break;
        case 4:
            if ( listEntry.getItemValue () != null )
            {
                final Calendar timestamp = listEntry.getItemValue ().getTimestamp ();
                if ( timestamp != null )
                {
                    cell.setText ( formatTimestamp ( timestamp ) );
                }
                else
                {
                    cell.setText ( null );
                }
            }
            break;
        default:
            break;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:53,代码来源:ItemCellLabelProvider.java


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