コード例 #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();
 }
コード例 #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);
 }
コード例 #3
0
 private void doEnter(Hyperlink link) {
   String statusText =
       labelProvider != null ? labelProvider.getStatusText(link.getData()) : link.getText();
   getPage().getEditorSite().getActionBars().getStatusLineManager().setMessage(statusText);
 }