use of org.netxms.client.objects.AbstractNode in project netxms by netxms.
the class MibExplorer method init.
/* (non-Javadoc)
* @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
*/
@Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
if (memento != null) {
// $NON-NLS-1$
long nodeId = safeCast(memento.getInteger("CurrentNode"), 0);
if (nodeId != 0) {
AbstractObject object = ((NXCSession) ConsoleSharedData.getSession()).findObjectById(nodeId);
if ((object != null) && (object instanceof AbstractNode))
currentNode = (AbstractNode) object;
}
}
session = (NXCSession) ConsoleSharedData.getSession();
IDialogSettings settings = Activator.getDefault().getDialogSettings();
initShowFilter = safeCast(settings.get("MibExplorer.showFilter"), settings.getBoolean("MibExplorer.showFilter"), initShowFilter);
super.init(site, memento);
}
use of org.netxms.client.objects.AbstractNode in project netxms by netxms.
the class MibExplorer method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction() {
@Override
public void run() {
mibBrowser.refreshTree();
}
};
actionWalk = new Action(Messages.get().MibExplorer_Walk) {
@Override
public void run() {
doWalk();
}
};
actionWalk.setEnabled(currentNode != null);
actionSetNode = new Action(Messages.get().MibExplorer_SetNodeObject) {
@Override
public void run() {
ObjectSelectionDialog dlg = new ObjectSelectionDialog(MibExplorer.this.getSite().getShell(), null, ObjectSelectionDialog.createNodeSelectionFilter(false));
dlg.enableMultiSelection(false);
if (dlg.open() == Window.OK) {
setNode((AbstractNode) dlg.getSelectedObjects().get(0));
}
}
};
actionSelect = new Action("Select in MIB tree") {
@Override
public void run() {
selectInTree();
}
};
actionSelect.setEnabled(false);
actionExportToCsv = new ExportToCsvAction(this, viewer, true);
actionShowFilter = new Action("Show filter", Action.AS_CHECK_BOX) {
@Override
public void run() {
enableFilter(!initShowFilter);
actionShowFilter.setChecked(initShowFilter);
}
};
actionShowFilter.setChecked(initShowFilter);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.snmp.commands.showFilter");
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
Aggregations