Search in sources :

Example 1 with UrlLauncher

use of org.eclipse.rap.rwt.client.service.UrlLauncher in project netxms by netxms.

the class AlarmList method showIssue.

/**
 * Show in web browser helpdesk ticket (issue) linked to selected alarm
 */
private void showIssue() {
    IStructuredSelection selection = (IStructuredSelection) alarmViewer.getSelection();
    if (selection.size() != 1)
        return;
    final long id = ((Alarm) selection.getFirstElement()).getId();
    new ConsoleJob(Messages.get().AlarmList_JobTitle_ShowTicket, viewPart, Activator.PLUGIN_ID, AlarmList.JOB_FAMILY) {

        @Override
        protected void runInternal(IProgressMonitor monitor) throws Exception {
            final String url = session.getHelpdeskIssueUrl(id);
            runInUIThread(new Runnable() {

                @Override
                public void run() {
                    UrlLauncher launcher = RWT.getClient().getService(UrlLauncher.class);
                    launcher.openURL(url);
                }
            });
        }

        @Override
        protected String getErrorMessage() {
            return Messages.get().AlarmList_JobError_ShowTicket;
        }
    }.start();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) UrlLauncher(org.eclipse.rap.rwt.client.service.UrlLauncher) Alarm(org.netxms.client.events.Alarm) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ConsoleJob(org.netxms.ui.eclipse.jobs.ConsoleJob) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with UrlLauncher

use of org.eclipse.rap.rwt.client.service.UrlLauncher in project netxms by netxms.

the class ExternalResources method openUrl.

/**
 * Open URL
 *
 * @param url URL to open
 */
private void openUrl(URL url) {
    final UrlLauncher launcher = RWT.getClient().getService(UrlLauncher.class);
    launcher.openURL(url.toExternalForm());
}
Also used : UrlLauncher(org.eclipse.rap.rwt.client.service.UrlLauncher)

Example 3 with UrlLauncher

use of org.eclipse.rap.rwt.client.service.UrlLauncher in project netxms by netxms.

the class ObjectToolExecutor method openURL.

/**
 * @param node
 * @param tool
 * @param inputValues
 */
private static void openURL(final ObjectContext node, final ObjectTool tool, Map<String, String> inputValues, String url) {
    final UrlLauncher launcher = RWT.getClient().getService(UrlLauncher.class);
    launcher.openURL(url);
}
Also used : UrlLauncher(org.eclipse.rap.rwt.client.service.UrlLauncher)

Aggregations

UrlLauncher (org.eclipse.rap.rwt.client.service.UrlLauncher)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 PartInitException (org.eclipse.ui.PartInitException)1 Alarm (org.netxms.client.events.Alarm)1 ConsoleJob (org.netxms.ui.eclipse.jobs.ConsoleJob)1