tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / project / wizards / CopyExperimentDialog.java
index 4db3bf2cb58a6abd96726b9258d941434c380a3d..53b558df0c816ee8c14af441fa3938592947a07f 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
- * Copyright (c) 2011 Ericsson
- * 
+ * Copyright (c) 2011, 2013 Ericsson
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Copied and adapted from NewFolderDialog
  *******************************************************************************/
@@ -49,8 +49,10 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation;
 import org.eclipse.ui.dialogs.SelectionStatusDialog;
 
 /**
- * <b><u>CopyExperimentDialog</u></b>
+ * Implementation of the copy experiement dialog box.
  * <p>
+ * @version 1.0
+ * @author Francois Chouinard
  */
 public class CopyExperimentDialog extends SelectionStatusDialog {
 
@@ -67,6 +69,11 @@ public class CopyExperimentDialog extends SelectionStatusDialog {
     // Constructor
     // ------------------------------------------------------------------------
 
+    /**
+     * Constructor
+     * @param shell The parent shell
+     * @param experiment The TMF experiment model element
+     */
     public CopyExperimentDialog(Shell shell, TmfExperimentElement experiment) {
         super(shell);
         fExperiment = experiment;
@@ -81,6 +88,10 @@ public class CopyExperimentDialog extends SelectionStatusDialog {
     // Dialog
     // ------------------------------------------------------------------------
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+     */
     @Override
     protected Control createDialogArea(Composite parent) {
         Composite composite = (Composite) super.createDialogArea(parent);
@@ -133,7 +144,7 @@ public class CopyExperimentDialog extends SelectionStatusDialog {
     }
 
     private void validateNewExperimentName() {
-        
+
        String name = fNewExperimentName.getText();
         IWorkspace workspace = fExperimentFolder.getWorkspace();
         IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);
@@ -142,12 +153,12 @@ public class CopyExperimentDialog extends SelectionStatusDialog {
                updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
                return;
         }
-        
+
         if (!nameStatus.isOK()) {
                updateStatus(nameStatus);
                return;
         }
-        
+
         IPath path = new Path(name);
         if (fExperimentFolder.getFolder(path).exists() || fExperimentFolder.getFile(path).exists()) {
             updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
@@ -160,17 +171,28 @@ public class CopyExperimentDialog extends SelectionStatusDialog {
     // ------------------------------------------------------------------------
     // SelectionStatusDialog
     // ------------------------------------------------------------------------
-
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
+     */
     @Override
     protected void computeResult() {
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.dialogs.SelectionStatusDialog#create()
+     */
     @Override
     public void create() {
         super.create();
         getButton(IDialogConstants.OK_ID).setEnabled(false);
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
+     */
     @Override
     protected void okPressed() {
         IFolder folder = copyExperiment(fNewExperimentName.getText());
@@ -198,6 +220,8 @@ public class CopyExperimentDialog extends SelectionStatusDialog {
                     if (monitor.isCanceled()) {
                         throw new OperationCanceledException();
                     }
+                    // Copy supplementary files first
+                    fExperiment.copySupplementaryFolder(newName);
                     fExperiment.getResource().copy(newPath, IResource.FORCE | IResource.SHALLOW, null);
                     // Delete any bookmarks file found in copied experiment folder
                     IFolder folder = fExperimentFolder.getFolder(newName);
This page took 0.024738 seconds and 5 git commands to generate.