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(); }
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); }
protected void doLinkActivated(Hyperlink link) { Object object = link.getData(); getPage().getEditor().setActivePage(morePageId, object); }
private void doEnter(Hyperlink link) { String statusText = labelProvider != null ? labelProvider.getStatusText(link.getData()) : link.getText(); getPage().getEditorSite().getActionBars().getStatusLineManager().setMessage(statusText); }
private void disposeLink(Object obj) { Hyperlink link = find(obj); if (link != null) link.dispose(); }