Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 private void createLink(Object object) {
   Image image = labelProvider != null ? labelProvider.getImage(object) : null;
   Hyperlink hyperlink;
   if (image != null) {
     hyperlink = getManagedForm().getToolkit().createImageHyperlink(linkContainer, SWT.NULL);
     ((ImageHyperlink) hyperlink).setImage(image);
   } else hyperlink = getManagedForm().getToolkit().createHyperlink(linkContainer, null, SWT.NULL);
   update(hyperlink, object);
   hyperlink.setData(object);
   hyperlink.addHyperlinkListener(linkHandler);
 }
Esempio n. 3
0
 protected void doLinkActivated(Hyperlink link) {
   Object object = link.getData();
   getPage().getEditor().setActivePage(morePageId, object);
 }
Esempio n. 4
0
 private void doEnter(Hyperlink link) {
   String statusText =
       labelProvider != null ? labelProvider.getStatusText(link.getData()) : link.getText();
   getPage().getEditorSite().getActionBars().getStatusLineManager().setMessage(statusText);
 }
Esempio n. 5
0
 private void disposeLink(Object obj) {
   Hyperlink link = find(obj);
   if (link != null) link.dispose();
 }