import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.linuxtools.lttng.tracecontrol.model.TraceResource;
+import org.eclipse.linuxtools.lttng.core.tracecontrol.model.TraceResource;
import org.eclipse.linuxtools.lttng.ui.tracecontrol.Messages;
import org.eclipse.linuxtools.lttng.ui.tracecontrol.dialogs.ImportTraceDialog;
import org.eclipse.rse.core.RSECorePlugin;
String traceName = dialog.getTraceName();
if (trace.getTraceConfig().isNetworkTrace()) {
if (dialog.getLinkOnly()) {
- linkTrace(trace, project, traceName);
+ linkTrace(getShell(), trace, project, traceName);
} else {
copyTrace(trace, project, traceName);
}
/*
* Method to create a symbolic link to a trace residing on the local host.
*/
- private void linkTrace(TraceResource trace, IProject project, String traceName) {
+ public static void linkTrace(Shell shell, TraceResource trace, IProject project, String traceName) {
IFolder traceFolder = project.getFolder(TRACE_FOLDER_NAME);
if (!traceFolder.exists()) {
- MessageDialog.openWarning(getShell(),
+ MessageDialog.openWarning(shell,
Messages.ImportToProject_ImportFailed,
Messages.ImportToProject_NoProjectTraceFolder);
return;
IFolder folder = traceFolder.getFolder(traceName);
if (folder.exists()) {
- MessageDialog.openWarning(getShell(),
+ MessageDialog.openWarning(shell,
Messages.ImportToProject_ImportFailed,
Messages.ImportToProject_AlreadyExists);
return;
try {
folder.createLink(sourceFolder.toURI(), IResource.REPLACE, null);
} catch (CoreException e) {
- MessageDialog.openWarning(getShell(),
+ MessageDialog.openWarning(shell,
Messages.ImportToProject_ImportFailed,
e.getMessage());
}