Search in sources :

Example 1 with EnterIpAddressDlg

use of org.netxms.ui.eclipse.topology.dialogs.EnterIpAddressDlg in project netxms by netxms.

the class FindIpAddress method run.

/* (non-Javadoc)
	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
	 */
@Override
public void run(IAction action) {
    final EnterIpAddressDlg dlg = new EnterIpAddressDlg(window.getShell());
    if (dlg.open() != Window.OK)
        return;
    final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
    new ConsoleJob(String.format(Messages.get().FindIpAddress_JobTitle, dlg.getIpAddress().getHostAddress()), null, Activator.PLUGIN_ID, null) {

        @Override
        protected void runInternal(IProgressMonitor monitor) throws Exception {
            final ConnectionPoint cp = session.findConnectionPoint((int) dlg.getZoneId(), dlg.getIpAddress());
            runInUIThread(new Runnable() {

                @Override
                public void run() {
                    HostSearchResults.showConnection(cp);
                }
            });
        }

        @Override
        protected String getErrorMessage() {
            return String.format(Messages.get().FindIpAddress_JobError, dlg.getIpAddress().getHostAddress());
        }
    }.start();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) NXCSession(org.netxms.client.NXCSession) EnterIpAddressDlg(org.netxms.ui.eclipse.topology.dialogs.EnterIpAddressDlg) ConsoleJob(org.netxms.ui.eclipse.jobs.ConsoleJob) ConnectionPoint(org.netxms.client.topology.ConnectionPoint)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 NXCSession (org.netxms.client.NXCSession)1 ConnectionPoint (org.netxms.client.topology.ConnectionPoint)1 ConsoleJob (org.netxms.ui.eclipse.jobs.ConsoleJob)1 EnterIpAddressDlg (org.netxms.ui.eclipse.topology.dialogs.EnterIpAddressDlg)1