}
Runnable runnable = new Runnable() {
public void run() {
Shell activeShell = Display.getCurrent().getActiveShell();
MessageDialog dialog = new MessageDialog(
activeShell,
"Sorry, your trial expired",
null,
"Your trial is expired, please visit <a>http://appwrench.onpositive.com/buy</a> and purchase license to AppWrench",
MessageDialog.ERROR,
new String[] { IDialogConstants.OK_LABEL }, 0) {
protected Control createMessageArea(Composite composite) {
Image image = getImage();
if (image != null) {
imageLabel = new Label(composite, SWT.NULL);
image.setBackground(imageLabel.getBackground());
imageLabel.setImage(image);
GridDataFactory.fillDefaults().align(SWT.CENTER,
SWT.BEGINNING).applyTo(imageLabel);
}
// create message
if (message != null) {
Link link = new Link(composite,
getMessageLabelStyle());
link.setText(message);
GridDataFactory
.fillDefaults()
.align(SWT.FILL, SWT.BEGINNING)
.grab(true, false)
.hint(
convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
SWT.DEFAULT).applyTo(link);
link.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(
org.eclipse.swt.events.SelectionEvent e) {
try {
PlatformUI
.getWorkbench()
.getBrowserSupport()
.getExternalBrowser()
.openURL(
new URL(
"http://appwrench.onpositive.com/buy/"));
} catch (PartInitException e1) {
Activator.log(e1);
} catch (MalformedURLException e1) {
Activator.log(e1);
}
};
});
}
return composite;
}
};
dialog.open();
}
};
if (Display.getCurrent() != null) {
runnable.run();
} else {