Search in sources :

Example 1 with IMessage

use of org.eclipse.ui.forms.IMessage in project bndtools by bndtools.

the class MessageHyperlinkAdapter method showPopup.

private void showPopup(final HyperlinkEvent e) {
    Hyperlink link = (Hyperlink) e.getSource();
    link.setToolTipText(null);
    if (popupDialog != null)
        popupDialog.close();
    IMessage[] messages = (IMessage[]) e.data;
    if (messages == null) {
        messages = new IMessage[0];
    } else {
        messages = Stream.of(messages).filter(Objects::nonNull).toArray(IMessage[]::new);
    }
    if (messages.length == 0) {
        MessageDialog.openInformation(part.getSite().getShell(), part.getTitle(), "No further information available.");
    } else {
        popupDialog = new MessagesPopupDialog(link, (IMessage[]) e.data, part);
        popupDialog.open();
    }
}
Also used : IMessage(org.eclipse.ui.forms.IMessage) Objects(java.util.Objects) Hyperlink(org.eclipse.ui.forms.widgets.Hyperlink)

Aggregations

Objects (java.util.Objects)1 IMessage (org.eclipse.ui.forms.IMessage)1 Hyperlink (org.eclipse.ui.forms.widgets.Hyperlink)1