• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LineBackgroundEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
/**
 * Return the correct background highlight for the kill ring entry line offset
 * 
 * @see org.eclipse.swt.custom.LineBackgroundListener#lineGetBackground(org.eclipse.swt.custom.LineBackgroundEvent)
 */
public void lineGetBackground(LineBackgroundEvent event) {
	KilledText kt = offsetHash.get(event.lineOffset);
	if (kt == null) {
		for (KilledText k : ringEntries) {
			if (event.lineOffset >= k.begin && event.lineOffset <= k.end) {
				offsetHash.put(event.lineOffset, k);
				kt = k;
				break;
			}
		}
	}
	if (kt != null) {
		event.lineBackground = kt.color;
	}
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:21,代码来源:BrowseKillRingHandler.java


示例2: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
@Override
public void lineGetBackground(LineBackgroundEvent event)
{
	int lineIndex = m_view.getLineAtOffset(event.lineOffset);
	TextViewLine line = (TextViewLine) m_model.getLineObject(lineIndex);
	// Set background color
	Color lineBg = m_labelProvider.getBackgroundColor(line.getType());
	event.lineBackground = lineBg;
}
 
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:10,代码来源:CustomStyledText.java


示例3: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
@Override
public void lineGetBackground(LineBackgroundEvent event) {
  if (currentInput == null) {
    return;
  }
  TextChangesMap changesMap = currentInput.getMap(side);
  ColorName colorName =
      changesMap.getLineColorName(event.lineOffset, event.lineText.length() + 1);
  if (colorName != null) {
    event.lineBackground = colors.get(colorName);
  }
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:13,代码来源:LiveEditDiffViewer.java


示例4: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
@Override
public void lineGetBackground(LineBackgroundEvent event) {
	if (!btnRadioSelected.getSelection())
		return;
	if (isOverlappingOriginalSelectionLineOffsetRange(event.lineOffset, event.lineText.length()))
		event.lineBackground = originalSelectionHighlightColor;
}
 
开发者ID:DaveVoorhis,项目名称:Rel,代码行数:8,代码来源:FindReplaceDialog.java


示例5: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
public void lineGetBackground(LineBackgroundEvent event) {
	boolean go = false;

	for( int i : customLines)
		if( i == txt.getLineAtOffset(event.lineOffset) )
		{
			go = true;
			break;
		}

	if( go ){
		event.lineBackground = customColor;
	}
}
 
开发者ID:jakepoz,项目名称:RepDev,代码行数:15,代码来源:SyntaxHighlighter.java


示例6: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
public void lineGetBackground(LineBackgroundEvent event)
{
	if (fViewer == null)
	{
		return;
	}
	final StyledText textWidget = fViewer.getTextWidget();
	if (textWidget == null)
	{
		return;
	}

	try
	{
		final int offset = event.lineOffset;
		IDocument document = fViewer.getDocument();
		int line = document.getLineOfOffset(offset);
		final IRegion lineRegion = document.getLineInformation(line);

		// Handle fully opaque line highlight here. A modified approach from CursorLinePainter.
		if (fEnabled && isOpaque() && isCurrentLine(line))
		{
			// draw current line
			drawCurrentLine(event, lineRegion);
			return;
		}

		// Not drawing an opaque line highlight, so we need to do our normal line coloring here.
		// This extends the bg color out for a given line based on it's end scope.
		String endOfLineScope = getScopeManager().getScopeAtOffset(document, lineRegion.getLength() + offset);
		String commonPrefix = getScope(document, line, endOfLineScope);
		TextAttribute at = getCurrentTheme().getTextAttribute(commonPrefix);

		// if we have no color we need to extend to end of line, but this used to be the highlight line, force the
		// theme bg color
		if (at.getBackground() == null && isOpaque() && fLastLine.includes(offset))
		{
			event.lineBackground = getColorManager().getColor(getCurrentTheme().getBackground());
		}
		else
		{
			event.lineBackground = at.getBackground();
		}
	}
	catch (BadLocationException e)
	{
		IdeLog.logError(CommonEditorPlugin.getDefault(), e);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:50,代码来源:LineBackgroundPainter.java


示例7: drawCurrentLine

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
private void drawCurrentLine(LineBackgroundEvent event, final IRegion lineRegion)
{
	final StyledText textWidget = fViewer.getTextWidget();
	final int offset = event.lineOffset;
	final RGBa lineHighlight = getCurrentTheme().getLineHighlight();
	event.lineBackground = getColorManager().getColor(lineHighlight.toRGB());

	// In this case, we should be overriding the bg of the style ranges for the line too!
	if (textWidget.isDisposed())
	{
		return;
	}
	// FIXME Only change bg colors of visible ranges!
	int replaceLength = 160;
	if (lineRegion != null)
	{
		replaceLength = Math.min(replaceLength, lineRegion.getLength());
	}

	// be safe about offsets
	int charCount = textWidget.getCharCount();
	if (offset + replaceLength > charCount)
	{
		replaceLength = charCount - offset;
		if (replaceLength < 0)
		{
			// Just playing safe here
			replaceLength = 0;
		}
	}
	final StyleRange[] ranges = textWidget.getStyleRanges(offset, replaceLength, true);
	if (ranges == null || ranges.length == 0)
	{
		return;
	}
	Color background = textWidget.getBackground();
	final int[] positions = new int[ranges.length << 1];
	int x = 0;
	boolean apply = false;
	for (StyleRange range : ranges)
	{
		if (range.background != null)
		{
			if (!range.background.equals(background))
			{
				positions[x] = range.start;
				positions[x + 1] = range.length;
				x += 2;
				continue;
			}
			apply = true;
		}
		range.background = null;
		positions[x] = range.start;
		positions[x + 1] = range.length;
		x += 2;
	}

	if (apply)
	{
		textWidget.setStyleRanges(offset, replaceLength, positions, ranges);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:64,代码来源:LineBackgroundPainter.java


示例8: lineGetBackground

import org.eclipse.swt.custom.LineBackgroundEvent; //导入依赖的package包/类
public void lineGetBackground(LineBackgroundEvent event) {
    viewer.lineGetBackground(event);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:4,代码来源:ScriptConsoleViewerWrapper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Repository类代码示例发布时间:2022-05-23
下一篇:
Java TippedArrow类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap