org.eclipse.swt.widgets.Text.computeTrim()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(103)

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

Text.computeTrim介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 * Creates the area for the Description field.
 */
private void createDescriptionArea(Composite parent) {
  Label label = new Label(parent, SWT.NONE);
  label.setText(MarkerMessages.propertiesDialog_description_text);
  GridData labelGridData= new GridData(SWT.LEFT, SWT.TOP, false, false);
  label.setLayoutData(labelGridData);
  descriptionText = new Text(parent, (SWT.MULTI|SWT.WRAP|SWT.V_SCROLL|SWT.BORDER));
  labelGridData.verticalIndent= -descriptionText.computeTrim(0, 0, 0, 0).y;
  GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
  gridData.widthHint = convertHorizontalDLUsToPixels(250);
  gridData.heightHint = convertHeightInCharsToPixels(3);
  descriptionText.setLayoutData(gridData);
  descriptionText.setText(Util.getProperty(IMarker.MESSAGE, marker));
  descriptionText.selectAll();
  descriptionText.setEditable(Util.isEditable(marker));
}

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

Rectangle rect = messageLabel.computeTrim(0, 0, 100, 100);
xTrim = rect.width - 100;
yTrim = rect.height - 100;

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

Rectangle trim = computeTrim( 0, 0, width, height );
return new Point( trim.width, trim.height );

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

Rectangle rect = messageLabel.computeTrim(0, 0, 100, 100);
xTrim = rect.width - 100;
yTrim = rect.height - 100;

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

Rectangle rect = messageLabel.computeTrim(0, 0, 100, 100);
xTrim = rect.width - 100;
yTrim = rect.height - 100;

代码示例来源:origin: BiglySoftware/BiglyBT

editor.minimumWidth = 50;
Rectangle r = text.computeTrim(0, 0, 100, text.getLineHeight());
editor.minimumHeight = r.height;

代码示例来源:origin: BiglySoftware/BiglyBT

editor.minimumWidth = 50;
Rectangle r = text.computeTrim(0, 0, 100, text.getLineHeight());
editor.minimumHeight = r.height;

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

if (wHint != SWT.DEFAULT) width = wHint;
if (hHint != SWT.DEFAULT) height = hHint;
Rectangle trim = computeTrim (0, 0, width, height);
width = trim.width;
height = trim.height;

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

private void updateQuickAccessText() {
  if (txtQuickAccess == null || txtQuickAccess.isDisposed()) {
    return;
  }
  updateQuickAccessTriggerSequence();
  if (triggerSequence != null) {
    txtQuickAccess.setToolTipText(
        NLS.bind(QuickAccessMessages.QuickAccess_TooltipDescription, triggerSequence.format()));
  } else {
    txtQuickAccess.setToolTipText(QuickAccessMessages.QuickAccess_TooltipDescription_Empty);
  }
  GC gc = new GC(txtQuickAccess);
  // workaround for Bug 491317
  if (Util.isWin32() || Util.isGtk()) {
    FontMetrics fm = gc.getFontMetrics();
    int wHint = QuickAccessMessages.QuickAccess_EnterSearch.length() * fm.getAverageCharWidth();
    int hHint = fm.getHeight();
    gc.dispose();
    txtQuickAccess.setSize(txtQuickAccess.computeSize(wHint, hHint));
  } else {
    Point p = gc.textExtent(QuickAccessMessages.QuickAccess_EnterSearch);
    Rectangle r = txtQuickAccess.computeTrim(0, 0, p.x, p.y);
    gc.dispose();
    // computeTrim() may result in r.x < 0
    GridDataFactory.fillDefaults().hint(r.width - r.x, SWT.DEFAULT).applyTo(txtQuickAccess);
  }
  txtQuickAccess.requestLayout();
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0);
boundingRect.translate(trim.x, trim.y);
boundingRect.height = boundingRect.height - trim.y;

相关文章

Text类方法