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

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

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

Hyperlink.setText介绍

[英]Sets the text of this hyperlink.
[中]设置此超链接的文本。

代码示例

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

/**
 * Sets the title of the expandable composite. The title will act as a
 * hyperlink and activating it will toggle the client between expanded and
 * collapsed state.
 *
 * @param title
 *            the new title string
 * @see #getText()
 */
public void setText(String title) {
  if (textLabel instanceof Label) {
    ((Label) textLabel).setText(title);
  } else if (textLabel instanceof Hyperlink) {
    ((Hyperlink) textLabel).setText(title);
  } else {
    return;
  }
  layout();
}

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

/**
 * Sets the title of the expandable composite. The title will act as a
 * hyperlink and activating it will toggle the client between expanded and
 * collapsed state.
 *
 * @param title
 *            the new title string
 * @see #getText()
 */
public void setText(String title) {
  if (textLabel instanceof Label) {
    ((Label) textLabel).setText(title);
  } else if (textLabel instanceof Hyperlink) {
    ((Hyperlink) textLabel).setText(title);
  } else {
    return;
  }
  layout();
}

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

public void setClientProjectName(String name)
{
 projectName_ = name;      
 hLinkClientProject_.setText(CLIENT_PROJECT_PREFIX + " " + projectName_);	
 hLinkClientProject_.pack(true);   
 packIt();
}

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

public void updateHyperlinkText(String s) {
  for (Hyperlink hyperlink : arrayHyperLink) {
    if (hyperlink == null || hyperlink.isDisposed()) {
      continue;
    }
    hyperlink.setText(s);
  }
  updateTextualEditor();
}

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

public void refreshEARLink()
{
  hLinkClientEAR_.setVisible(needEar_ && getGenerateProxy());
  if (needEar_)
  {        
    hLinkClientEAR_.setText(CLIENT_EAR_PREFIX + " " + earProjectName_);
    hLinkClientEAR_.pack(true); 
    packIt();
  }  
}

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

private void update(Hyperlink hyperlink, Object object) {
  String text = labelProvider != null ? labelProvider.getText(object) : object.toString();
  Image image = labelProvider != null ? labelProvider.getImage(object) : null;
  String tooltip = labelProvider != null ? labelProvider.getToolTipText(object) : text;
  hyperlink.setText(text);
  hyperlink.setToolTipText(tooltip);
  if (hyperlink instanceof ImageHyperlink)
    ((ImageHyperlink) hyperlink).setImage(image);
  reflow();
}

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

protected Control createInfoTextArea(Composite parent)
{
 Composite infoComposite = new Composite(parent, SWT.NONE);
 GridLayout gridLayout = new GridLayout(2, false);
 gridLayout.marginHeight = 0;
 gridLayout.marginWidth = 0;
 infoComposite.setLayout(gridLayout);
 GridData gd = new GridData(GridData.FILL_BOTH);
 infoComposite.setLayoutData(gd);
 nsInfoLabel = new Label(infoComposite, SWT.LEFT);
 nsInfoLabel.setText(infoText);
 Font font = nsInfoLabel.getFont();
 FontData[] fontDatas = font.getFontData();
 for (int i = 0; i < fontDatas.length; i++)
 {
  fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
 }
 infoFont = new Font(nsInfoLabel.getDisplay(), fontDatas);
 nsInfoLabel.setFont(infoFont);
 gd = new GridData(GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
 nsInfoLabel.setLayoutData(gd);
 nsInfoLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
 link = new Hyperlink(infoComposite, SWT.RIGHT);
 link.setText(Messages._UI_ACTION_OPEN_IN_NEW_EDITOR);
 link.setFont(infoFont);
 link.addHyperlinkListener(linkListener);
 return infoComposite;
}

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

private void setActiveScopeSet(ScopeSet set) {
  scopeSetLink.setText(set.getName());
  scopeSetManager.setActiveSet(set);
  updateMasters(set);
  scopeSection.layout();
  if (parent != null)
    parent.reflow();
}

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

/**
 * Creates a hyperlink as a part of the form. The hyperlink will be added to
 * the hyperlink group that belongs to this toolkit.
 *
 * @param parent
 *            the hyperlink parent
 * @param text
 *            the text of the hyperlink
 * @param style
 *            the hyperlink style
 * @return the hyperlink widget
 */
public Hyperlink createHyperlink(Composite parent, String text, int style) {
  Hyperlink hyperlink = new Hyperlink(parent, style | orientation);
  if (text != null)
    hyperlink.setText(text);
  hyperlink.addFocusListener(visibilityHandler);
  hyperlink.addKeyListener(keyboardHandler);
  hyperlinkGroup.add(hyperlink);
  return hyperlink;
}

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

link.setText(TeamUIMessages.ChangesSection_8); 
link.addHyperlinkListener(new HyperlinkAdapter() {
  public void linkActivated(HyperlinkEvent e) {
link.setText(TeamUIMessages.ChangesSection_9); 
link.addHyperlinkListener(new HyperlinkAdapter() {
  public void linkActivated(HyperlinkEvent e) {

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

link.setText(TeamUIMessages.ChangesSection_8);
link.addHyperlinkListener(new HyperlinkAdapter() {
  @Override
link.setText(TeamUIMessages.ChangesSection_9);
link.addHyperlinkListener(new HyperlinkAdapter() {
  @Override

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

/**
 * Creates a hyperlink as a part of the form. The hyperlink will be added to
 * the hyperlink group that belongs to this toolkit.
 *
 * @param parent
 *            the hyperlink parent
 * @param text
 *            the text of the hyperlink
 * @param style
 *            the hyperlink style
 * @return the hyperlink widget
 */
public Hyperlink createHyperlink(Composite parent, String text, int style) {
  checkDisposed();
  Hyperlink hyperlink = new Hyperlink(parent, style | orientation);
  if (text != null)
    hyperlink.setText(text);
  hyperlink.addFocusListener(visibilityHandler);
  hyperlink.addKeyListener(keyboardHandler);
  hyperlinkGroup.add(hyperlink);
  return hyperlink;
}

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

private void createHeadLink(final Repository repository, Composite composite) throws IOException {
  final ObjectId objectId = repository
      .resolve(repository.getFullBranch());
  if (objectId == null) {
    Text headLabel = createLabeledReadOnlyText(composite, UIText.GitProjectPropertyPage_LabelId);
    if (repository.getAllRefs().size() == 0)
      headLabel.setText(UIText.GitProjectPropertyPage_ValueEmptyRepository);
    else
      headLabel.setText(UIText.GitProjectPropertyPage_ValueUnbornBranch);
  } else {
    Hyperlink headLink = createHeadHyperLink(composite, UIText.GitProjectPropertyPage_LabelId);
    headLink.setText(objectId.name());
    headLink.setUnderlined(true);
    headLink.setFont(JFaceResources.getDialogFont());
    headLink.setForeground(JFaceColors.getHyperlinkText(headLink
        .getDisplay()));
    headLink.addHyperlinkListener(new HyperlinkAdapter() {
      @Override
      public void linkActivated(HyperlinkEvent e) {
        RepositoryCommit commit = getCommit(repository, objectId);
        if(commit != null)
          CommitEditor.openQuiet(commit);
      }
    });
  }
}

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

@Override
public void updateFields(ISchemaObject object) {
  if (!(object instanceof SchemaElementReference))
    return;
  fElement = (SchemaElementReference) object;
  setDecription(NLS.bind(PDEUIMessages.SchemaElementReferenceDetails_description, fElement.getName()));
  fReferenceLink.setText(fElement.getName());
  updateMinOccur(fElement.getMinOccurs());
  updateMaxOccur(fElement.getMaxOccurs());
  boolean editable = isEditableElement();
  fRefLabel.setEnabled(editable);
  fReferenceLink.setEnabled(editable);
  enableMinMax(editable);
}

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

Color color = new Color(parent.getDisplay(),new RGB(0,0,255) );
link.setForeground(color);
link.setText("Configure Target Runtime...");
link.addHyperlinkListener(new IHyperlinkListener() {
  public static final String DATA_NO_LINK = "PropertyAndPreferencePage.nolink"; //$NON-NLS-1$

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

public void showMessage(String newMessage, int newType,
    IMessage[] messages) {
  Control oldControl = getMessageControl();
  int oldType = messageType;
  this.message = newMessage;
  this.messageType = newType;
  this.messages = messages;
  if (newMessage == null) {
    // clearing of the message
    if (oldControl != null && oldControl.getVisible())
      oldControl.setVisible(false);
    if (oldType != newType)
      updateForeground();
    return;
  }
  ensureControlExists();
  if (needHyperlink()) {
    messageHyperlink.setText(newMessage);
    messageHyperlink.setHref(messages);
  } else {
    messageLabel.setText(newMessage);
  }
  if (oldType != newType)
    updateForeground();
}

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

prev.setText(PDEUIMessages.ImageBrowserView_PrevPage);
prev.setForeground(hyperlinkColor);
prev.addHyperlinkListener(new HyperlinkAdapter() {
for (int i = start; i <= maxPage; i++) {
  Hyperlink pageLink = new Hyperlink(this, SWT.NONE);
  pageLink.setText(String.valueOf(i));
  pageLink.setBackground(pageLink.getParent().getBackground());
  if (i != curPage) {
next.setText(PDEUIMessages.ImageBrowserView_NextPage);
next.setForeground(hyperlinkColor);
next.addHyperlinkListener(new HyperlinkAdapter() {

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

public void showMessage(String newMessage, int newType,
    IMessage[] messages) {
  Control oldControl = getMessageControl();
  int oldType = messageType;
  this.message = newMessage;
  this.messageType = newType;
  this.messages = messages;
  if (newMessage == null) {
    // clearing of the message
    if (oldControl != null && oldControl.getVisible())
      oldControl.setVisible(false);
    if (oldType != newType)
      updateForeground();
    return;
  }
  ensureControlExists();
  if (needHyperlink()) {
    messageHyperlink.setText(newMessage);
    messageHyperlink.setHref(messages);
  } else {
    messageLabel.setText(newMessage);
  }
  if (oldType != newType)
    updateForeground();
}

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

messageHyperlink.setUnderlined(true);
  messageHyperlink.setBackground(getBackground());
  messageHyperlink.setText(message);
  messageHyperlink.setHref(messages);
  for (IHyperlinkListener element : listeners)
    messageToolTipManager.createToolTip(messageHyperlink, false);
} else if (!messageHyperlink.getVisible()) {
  messageHyperlink.setText(message);
  messageHyperlink.setHref(messages);
  messageHyperlink.setVisible(true);

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

messageHyperlink.setUnderlined(true);
  messageHyperlink.setBackground(getBackground());
  messageHyperlink.setText(message);
  messageHyperlink.setHref(messages);
  for (IHyperlinkListener element : listeners)
    messageToolTipManager.createToolTip(messageHyperlink, false);
} else if (!messageHyperlink.getVisible()) {
  messageHyperlink.setText(message);
  messageHyperlink.setHref(messages);
  messageHyperlink.setVisible(true);

相关文章