热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.swt.custom.StyledText.getClientArea()方法的使用及代码示例

本文整理了Java中org.eclipse.swt.custom.StyledText.getClientArea()方法的一些代码示例,展示了Styled

本文整理了Java中org.eclipse.swt.custom.StyledText.getClientArea()方法的一些代码示例,展示了StyledText.getClientArea()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StyledText.getClientArea()方法的具体详情如下:
包路径:org.eclipse.swt.custom.StyledText
类名称:StyledText
方法名:getClientArea

StyledText.getClientArea介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
* Returns the last visible pixel in the widget's client area.
*
* @param widget the widget
* @return the last visible pixel in the widget's client area
*/
private static int computeLastVisiblePixel(StyledText widget) {
int cat take trim as this includes the scrollbars which are not part of the client area
// if ((textWidget.getStyle() & SWT.BORDER) != 0)
// lastPixel -= 4;
return lastPixel;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

/**
* @return true if the client are changed from the last time this method
* was called (and false otherwise). Has a side effect of
* updating fCurrClientArea.
*/
private boolean clientAreaChangedFromLastCall() {
Rectangle clientArea = fStyledText.getClientArea();
if (fCurrClientArea == null || !fCurrClientArea.equals(clientArea)) {
fCurrClientArea = clientArea;
return true;
}
return false;
}

代码示例来源:origin: ajermakovics/eclipse-instasearch

@Override
public Rectangle getInsertionBounds(Control control) {
StyledText text = (StyledText) control;
Point caretOrigin = text.getCaret().getLocation();

return new Rectangle(caretOrigin.x + text.getClientArea().x,
caretOrigin.y + text.getClientArea().y + 3, 1, text.getLineHeight());
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
* Returns the number of the currently visible lines.
*
* @return the number of the currently visible lines
*/
private int computeNumberOfVisibleLines() {
StyledText textWidget= fSourceViewer.getTextWidget();
int line| !oldClientArea.equals(boxText.getClientArea())){
drawBackgroundBoxes();
return true;
}
return false;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
protected Point computeSizeConstraints(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) {
Point cOnstraints= super.computeSizeConstraints(subjectControl, subjectArea, informationControl);
// make as big as text area, if possible
StyledText styledText= fSourceViewer.getTextWidget();
if (styledText != null) {
Rectangle r= styledText.getClientArea();
if (r != null) {
constraints.x= r.width;
constraints.y= r.height;
}
}
return constraints;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void calculateClientArea () {
int index = Math.max (0, styledText.getTopIndex());
int lineCount = content.getLineCount();
int height = styledText.getClientArea().height;
int y = 0;
/*
* There exists a possibility of ArrayIndexOutOfBounds Exception in
* below code, exact scenario not known. To avoid this exception added
* check for 'index' value, refer Bug 471192.
*/
while (height > y && lineCount > index && lineHeight.length > index) {
calculate(index, 1);
y += lineHeight[index++];
}
}
void calculateIdle () {

代码示例来源:origin: org.eclipse/org.eclipse.compare

public int getViewportLines() {
StyledText te= getTextWidget();
Rectangle clArea= te.getClientArea();
if (!clArea.isEmpty())
return clArea.height / te.getLineHeight();
return 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

public int getViewportHeight() {
StyledText te= getSourceViewer().getTextWidget();
Rectangle clArea= te.getClientArea();
if (!clArea.isEmpty())
return clArea.height;
return 0;
}

代码示例来源:origin: org.eclipse/org.eclipse.compare

private static void reveal(MergeSourceViewer v, Position p) {
if (v != null && p != null) {
StyledText st= v.getTextWidget();
if (st != null) {
Rectangle r= st.getClientArea();
if (!r.isEmpty()) // workaround for #7320: Next diff scrolls when going into current diff
v.revealRange(p.offset, p.length);
}
}
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void calculateClientArea () {
int index = styledText.getTopIndex();
int lineCount = content.getLineCount();
int height = styledText.getClientArea().height;
int y = 0;
while (height > y && lineCount > index) {
calculate(index, 1);
y += lineHeight[index++];
}
}
void calculateIdle () {

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

public int getViewportLines() {
StyledText te= getSourceViewer().getTextWidget();
Rectangle clArea= te.getClientArea();
if (!clArea.isEmpty())
return clArea.height / te.getLineHeight();
return 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

@Override
public void redrawScrollBars() {
if (Display.getCurrent() != null && fStyledText != null) {
if (!fStyledText.isDisposed() && fStyledText.isVisible()) {
Rectangle clientArea = fStyledText.getClientArea();
fStyledText.redraw(clientArea.x, clientArea.y, clientArea.width, clientArea.height, false);
}
}
}
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

private static void reveal(MergeSourceViewer v, Position p) {
if (v != null && p != null) {
StyledText st= v.getSourceViewer().getTextWidget();
if (st != null) {
Rectangle r= st.getClientArea();
if (!r.isEmpty()) // workaround for #7320: Next diff scrolls when going into current diff
v.getSourceViewer().revealRange(p.offset, p.length);
}
}
}

代码示例来源:origin: org.eclipse/org.eclipse.compare

private int getViewportHeight() {
StyledText te= fLeft.getTextWidget();

int vh= te.getClientArea().height;
if (vh == 0) {
Rectangle trim= te.computeTrim(0, 0, 0, 0);
int scrollbarHeight= trim.height;

int headerHeight= getHeaderHeight();
Composite composite= (Composite) getControl();
Rectangle r= composite.getClientArea();

vh= r.height-headerHeight-scrollbarHeight;
}
return vh / te.getLineHeight();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

void updateMinimap(boolean textChanged) {
StyledText editorTextWidget = fEditorViewer.getTextWidget();
int editorTopIndex = JFaceTextUtil.getPartialTopIndex(editorTextWidget);
int editorBottomIndex = JFaceTextUtil.getPartialBottomIndex(editorTextWidget);
int maximalLines = fEditorViewer.getTextWidget().getClientArea().height
/ fEditorViewer.getTextWidget().getLineHeight();
fMinimapTracker.updateMinimap(editorTopIndex, editorBottomIndex, maximalLines, textChanged);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

private int getViewportHeight() {
StyledText te= fLeft.getSourceViewer().getTextWidget();
int vh= te.getClientArea().height;
if (vh == 0) {
Rectangle trim= te.computeTrim(0, 0, 0, 0);
int scrollbarHeight= trim.height;
int headerHeight= getHeaderHeight();
Composite composite= (Composite) getControl();
Rectangle r= composite.getClientArea();
vh= r.height-headerHeight-scrollbarHeight;
}
return vh / te.getLineHeight();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void paintControl(PaintEvent e) {
if (fTextWidget != null) {
if (fFontForCachedWidgetX != fTextWidget.getFont()) {
computeWidgetX();
}
int x= fCachedWidgetX - fTextWidget.getHorizontalPixel();
if (x >= 0) {
Rectangle area= fTextWidget.getClientArea();
e.gc.setForeground(fColor);
e.gc.setLineStyle(fLineStyle);
e.gc.setLineWidth(fLineWidth);
e.gc.drawLine(x, 0, x, area.height);
}
}
}

推荐阅读
  • Java学习笔记之使用反射+泛型构建通用DAO
    本文介绍了使用反射和泛型构建通用DAO的方法,通过减少代码冗余度来提高开发效率。通过示例说明了如何使用反射和泛型来实现对不同表的相同操作,从而避免重复编写相似的代码。该方法可以在Java学习中起到较大的帮助作用。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
  • 个人学习使用:谨慎参考1Client类importcom.thoughtworks.gauge.Step;importcom.thoughtworks.gauge.T ... [详细]
  • Ihavethefollowingonhtml我在html上有以下内容<html><head><scriptsrc..3003_Tes ... [详细]
  • 本文讨论了在VMWARE5.1的虚拟服务器Windows Server 2008R2上安装oracle 10g客户端时出现的问题,并提供了解决方法。错误日志显示了异常访问违例,通过分析日志中的问题帧,找到了解决问题的线索。文章详细介绍了解决方法,帮助读者顺利安装oracle 10g客户端。 ... [详细]
  • 如何在HTML中获取鼠标的当前位置
    本文介绍了在HTML中获取鼠标当前位置的三种方法,分别是相对于屏幕的位置、相对于窗口的位置以及考虑了页面滚动因素的位置。通过这些方法可以准确获取鼠标的坐标信息。 ... [详细]
  • 本文整理了315道Python基础题目及答案,帮助读者检验学习成果。文章介绍了学习Python的途径、Python与其他编程语言的对比、解释型和编译型编程语言的简述、Python解释器的种类和特点、位和字节的关系、以及至少5个PEP8规范。对于想要检验自己学习成果的读者,这些题目将是一个不错的选择。请注意,答案在视频中,本文不提供答案。 ... [详细]
  • 安卓select模态框样式改变_微软Office风格的多端(Web、安卓、iOS)组件库——Fabric UI...
    介绍FabricUI是微软开源的一套Office风格的多端组件库,共有三套针对性的组件,分别适用于web、android以及iOS,Fab ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 猜字母游戏
    猜字母游戏猜字母游戏——设计数据结构猜字母游戏——设计程序结构猜字母游戏——实现字母生成方法猜字母游戏——实现字母检测方法猜字母游戏——实现主方法1猜字母游戏——设计数据结构1.1 ... [详细]
  • ALTERTABLE通过更改、添加、除去列和约束,或者通过启用或禁用约束和触发器来更改表的定义。语法ALTERTABLEtable{[ALTERCOLUMNcolu ... [详细]
  • 本文介绍了在处理不规则数据时如何使用Python自动提取文本中的时间日期,包括使用dateutil.parser模块统一日期字符串格式和使用datefinder模块提取日期。同时,还介绍了一段使用正则表达式的代码,可以支持中文日期和一些特殊的时间识别,例如'2012年12月12日'、'3小时前'、'在2012/12/13哈哈'等。 ... [详细]
  • 本文介绍了如何使用vue-awesome-swiper组件,包括在main.js中引入和使用swiper和swiperSlide组件,以及设置options和ref属性。同时还介绍了如何在模板中使用swiper和swiperSlide组件,并展示了如何通过循环渲染swipes数组中的数据,并使用picUrl属性显示图片。最后还介绍了如何添加分页器。 ... [详细]
author-avatar
860520430_a87a12
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有