How to create a hyperlink in Eclipse plugin preferences page?

感情迁移 提交于 2019-12-08 07:53:17

问题


I have an Eclipse plugin with a description and three text fields.

However, I would like to add a group of three radio buttons that perform specific actions on changing the selected choice. I would also like to have a hyperlink to an information page where people can click it and be directed to their browser for viewing the information.

The library org.eclipse.jface.preference does not seem to contain such classes and functions.

Would it be possible to guide me to the appropriate resources or give me any hints on how to do that using the Eclipse libraries? I would like to have labels, links, buttons, all in the preferences page.


回答1:


You can use org.eclipse.swt.widgets.Link to add a hyperlink to a preference page (or any other dialog or wizard):

final Link link = new Link(parent, SWT.NONE);
link.setText("text");
link.setLayoutData(your layour data);

link.addSelectionListener(new SelectionAdapter() {
  @Override
  public void widgetSelected(final SelectionEvent e)
  {
    // TODO deal with hyperlink selection
  }
});


来源:https://stackoverflow.com/questions/22107112/how-to-create-a-hyperlink-in-eclipse-plugin-preferences-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!