Search in sources :

Example 1 with EditElementXmlDlg

use of org.netxms.ui.eclipse.dashboard.dialogs.EditElementXmlDlg in project netxms by netxms.

the class DashboardElements method editElementXml.

/**
 * Edit selected element's configuration directly as XML
 */
private void editElementXml() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() != 1)
        return;
    DashboardElement element = (DashboardElement) selection.getFirstElement();
    EditElementXmlDlg dlg = new EditElementXmlDlg(getShell(), element.getData());
    if (dlg.open() == Window.OK) {
        element.setData(dlg.getValue());
        viewer.update(element, null);
    }
}
Also used : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditElementXmlDlg(org.netxms.ui.eclipse.dashboard.dialogs.EditElementXmlDlg) DashboardElement(org.netxms.client.dashboards.DashboardElement)

Example 2 with EditElementXmlDlg

use of org.netxms.ui.eclipse.dashboard.dialogs.EditElementXmlDlg in project netxms by netxms.

the class DashboardControl method editElementXml.

/**
 * Edit element XML
 *
 * @param element
 */
void editElementXml(DashboardElement element) {
    EditElementXmlDlg dlg = new EditElementXmlDlg(getShell(), element.getData());
    if (dlg.open() == Window.OK) {
        element.setData(dlg.getValue());
        recreateElement(element);
        redoLayout();
        setModified();
    }
}
Also used : EditElementXmlDlg(org.netxms.ui.eclipse.dashboard.dialogs.EditElementXmlDlg)

Aggregations

EditElementXmlDlg (org.netxms.ui.eclipse.dashboard.dialogs.EditElementXmlDlg)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 DashboardElement (org.netxms.client.dashboards.DashboardElement)1