Search in sources :

Example 1 with EnterMacAddressDlg

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

the class FindMacAddress method run.

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

        @Override
        protected void runInternal(IProgressMonitor monitor) throws Exception {
            final ConnectionPoint cp = session.findConnectionPoint(macAddr);
            runInUIThread(new Runnable() {

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

        @Override
        protected String getErrorMessage() {
            return String.format(Messages.get().FindMacAddress_JobError, macAddr);
        }
    }.start();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) NXCSession(org.netxms.client.NXCSession) EnterMacAddressDlg(org.netxms.ui.eclipse.topology.dialogs.EnterMacAddressDlg) ConsoleJob(org.netxms.ui.eclipse.jobs.ConsoleJob) MacAddress(org.netxms.base.MacAddress) ConnectionPoint(org.netxms.client.topology.ConnectionPoint)

Aggregations

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