本文整理了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);
}
}
}