Search in sources :

Example 1 with StartClientToAgentFolderUploadDialog

use of org.netxms.ui.eclipse.filemanager.dialogs.StartClientToAgentFolderUploadDialog in project netxms by netxms.

the class AgentFileManager method uploadFolder.

/**
 * Upload local folder to agent
 */
private void uploadFolder() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.isEmpty())
        return;
    final Object[] objects = selection.toArray();
    final AgentFile upladFolder = ((AgentFile) objects[0]).isDirectory() ? ((AgentFile) objects[0]) : ((AgentFile) objects[0]).getParent();
    final StartClientToAgentFolderUploadDialog dlg = new StartClientToAgentFolderUploadDialog(getSite().getShell());
    if (dlg.open() == Window.OK) {
        ConsoleJob job = new UploadConsoleJob(Messages.get().AgentFileManager_UploadFolderJobTitle, null, Activator.PLUGIN_ID, null, dlg.getLocalFile(), upladFolder, dlg.getRemoteFileName());
        job.start();
    }
}
Also used : StartClientToAgentFolderUploadDialog(org.netxms.ui.eclipse.filemanager.dialogs.StartClientToAgentFolderUploadDialog) AgentFile(org.netxms.client.server.AgentFile) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ConsoleJob(org.netxms.ui.eclipse.jobs.ConsoleJob)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 AgentFile (org.netxms.client.server.AgentFile)1 StartClientToAgentFolderUploadDialog (org.netxms.ui.eclipse.filemanager.dialogs.StartClientToAgentFolderUploadDialog)1 ConsoleJob (org.netxms.ui.eclipse.jobs.ConsoleJob)1