Search in sources :

Example 1 with ObjectUrlEditDialog

use of org.netxms.ui.eclipse.objectmanager.dialogs.ObjectUrlEditDialog in project netxms by netxms.

the class ExternalResources method addUrl.

/**
 * Add new URL
 */
private void addUrl() {
    ObjectUrlEditDialog dlg = new ObjectUrlEditDialog(getShell(), null, null);
    if (dlg.open() != Window.OK)
        return;
    urls.add(new ObjectUrl(urls.size(), dlg.getUrl(), dlg.getDescription()));
    viewer.refresh();
    modified = true;
}
Also used : ObjectUrlEditDialog(org.netxms.ui.eclipse.objectmanager.dialogs.ObjectUrlEditDialog) ObjectUrl(org.netxms.client.ObjectUrl)

Example 2 with ObjectUrlEditDialog

use of org.netxms.ui.eclipse.objectmanager.dialogs.ObjectUrlEditDialog in project netxms by netxms.

the class ExternalResources method editUrl.

/**
 * Edit selected URL
 */
private void editUrl() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() != 1)
        return;
    ObjectUrl url = (ObjectUrl) selection.getFirstElement();
    ObjectUrlEditDialog dlg = new ObjectUrlEditDialog(getShell(), url.getUrl(), url.getDescription());
    if (dlg.open() != Window.OK)
        return;
    int index = urls.indexOf(url);
    urls.set(index, new ObjectUrl(url.getId(), dlg.getUrl(), dlg.getDescription()));
    viewer.refresh();
    viewer.setSelection(new StructuredSelection(urls.get(index)));
    modified = true;
}
Also used : ObjectUrlEditDialog(org.netxms.ui.eclipse.objectmanager.dialogs.ObjectUrlEditDialog) ObjectUrl(org.netxms.client.ObjectUrl) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

ObjectUrl (org.netxms.client.ObjectUrl)2 ObjectUrlEditDialog (org.netxms.ui.eclipse.objectmanager.dialogs.ObjectUrlEditDialog)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1