org.eclipse.ui.forms.widgets.Hyperlink.getText()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(137)

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

Hyperlink.getText介绍

[英]Returns the current hyperlink text.
[中]返回当前超链接文本。

代码示例

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

@Override
public void getName(AccessibleEvent e) {
  e.result = getText();
  if (e.result == null)
    getHelp(e);
}

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

@Override
public void getName(AccessibleEvent e) {
  e.result = getText();
  if (e.result == null)
    getHelp(e);
}

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

/**
 * Returns the title string.
 *
 * @return the title string
 * @see #setText(String)
 */
public String getText() {
  if (textLabel instanceof Label)
    return ((Label) textLabel).getText();
  else if (textLabel instanceof Hyperlink)
    return ((Hyperlink) textLabel).getText();
  else
    return ""; //$NON-NLS-1$
}

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

/**
 * Returns the title string.
 *
 * @return the title string
 * @see #setText(String)
 */
public String getText() {
  if (textLabel instanceof Label)
    return ((Label) textLabel).getText();
  else if (textLabel instanceof Hyperlink)
    return ((Hyperlink) textLabel).getText();
  else
    return ""; //$NON-NLS-1$
}

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

protected Point computeTextSize(int wHint, int hHint) {
    Point extent;
    GC gc = new GC(this);
    gc.setFont(getFont());
    if ((getStyle() & SWT.WRAP) != 0 && wHint != SWT.DEFAULT) {
      extent = FormUtil.computeWrapSize(gc, getText(), wHint);
    } else {
      extent = gc.textExtent(getText());
      if ((getStyle() & SWT.WRAP)==0 && wHint!=SWT.DEFAULT)
        extent.x = wHint;
    }
    gc.dispose();
    return extent;
  }
}

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

@Override
  public String getPrefix(Control c) {
    Composite parent = c.getParent();
    Control[] siblings = parent.getChildren();
    for (int i = 0; i < siblings.length; i++) {
      if (siblings[i] == c) {
        // this is us - go backward until you hit
        // a label-like widget
        for (int j = i - 1; j >= 0; j--) {
          Control label = siblings[j];
          String ltext = null;
          if (label instanceof Label) {
            ltext = ((Label) label).getText();
          } else if (label instanceof Hyperlink) {
            ltext = ((Hyperlink) label).getText();
          } else if (label instanceof CLabel) {
            ltext = ((CLabel) label).getText();
          }
          if (ltext != null) {
            if (!ltext.endsWith(":")) //$NON-NLS-1$
              return ltext + ": "; //$NON-NLS-1$
            return ltext + " "; //$NON-NLS-1$
          }
        }
        break;
      }
    }
    return null;
  }
}

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

protected Point computeTextSize(int wHint, int hHint) {
    Point extent;
    GC gc = new GC(this);
    gc.setFont(getFont());
    if ((getStyle() & SWT.WRAP) != 0 && wHint != SWT.DEFAULT) {
      extent = FormUtil.computeWrapSize(gc, getText(), wHint);
    } else {
      extent = gc.textExtent(getText());
      if ((getStyle() & SWT.WRAP)==0 && wHint!=SWT.DEFAULT)
        extent.x = wHint;
    }
    gc.dispose();
    return extent;
  }
}

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

@Override
  public String getPrefix(Control c) {
    Composite parent = c.getParent();
    Control[] siblings = parent.getChildren();
    for (int i = 0; i < siblings.length; i++) {
      if (siblings[i] == c) {
        // this is us - go backward until you hit
        // a label-like widget
        for (int j = i - 1; j >= 0; j--) {
          Control label = siblings[j];
          String ltext = null;
          if (label instanceof Label) {
            ltext = ((Label) label).getText();
          } else if (label instanceof Hyperlink) {
            ltext = ((Hyperlink) label).getText();
          } else if (label instanceof CLabel) {
            ltext = ((CLabel) label).getText();
          }
          if (ltext != null) {
            if (!ltext.endsWith(":")) //$NON-NLS-1$
              return ltext + ": "; //$NON-NLS-1$
            return ltext + " "; //$NON-NLS-1$
          }
        }
        break;
      }
    }
    return null;
  }
}

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

private void doEnter(Hyperlink link) {
  String statusText = labelProvider != null ? labelProvider.getStatusText(link.getData()) : link.getText();
  getPage().getEditorSite().getActionBars().getStatusLineManager().setMessage(statusText);
}

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

String textToDraw = getText();
if (shortenText) {
  textToDraw = shortenText(gc, getText(), bounds.width);
  if (appToolTipText == null) {
    super.setToolTipText(getText());

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

String textToDraw = getText();
if (shortenText) {
  textToDraw = shortenText(gc, getText(), bounds.width);
  if (appToolTipText == null) {
    super.setToolTipText(getText());

代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

String currentServerText = hLinkClientServer_.getText();
String currentRuntimeText = hLinkClientRuntime_.getText();
String newServerText = CLIENT_SERVER_PREFIX + " " + clientServerText;
String newRuntimeText = CLIENT_RUNTIME_PREFIX + " " + clientRuntimeText;

相关文章