Index: stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
===================================================================
--- stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs	(revision 12718)
+++ stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs	(revision 14075)
@@ -21,4 +21,6 @@
 
 using System;
+using System.IO;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using HeuristicLab.Common;
@@ -26,10 +28,12 @@
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.Instances.DataAnalysis;
+using HeuristicLab.Problems.Instances.DataAnalysis.Views;
 
 namespace HeuristicLab.DataPreprocessing.Views {
   [View("DataPreprocessing View")]
   [Content(typeof(PreprocessingContext), true)]
-  [Content(typeof(IPreprocessingContext), false)]
-  public partial class DataPreprocessingView : ItemView {
+  public partial class DataPreprocessingView : NamedItemView {
 
     public DataPreprocessingView() {
@@ -37,6 +41,6 @@
     }
 
-    public new IPreprocessingContext Content {
-      get { return (IPreprocessingContext)base.Content; }
+    public new PreprocessingContext Content {
+      get { return (PreprocessingContext)base.Content; }
       set { base.Content = value; }
     }
@@ -60,5 +64,5 @@
           new CorrelationMatrixContent(Content),
           new DataCompletenessChartContent(searchLogic),
-          
+
           new FilterContent(filterLogic),
           new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
@@ -67,15 +71,28 @@
 
         viewShortcutListView.Content = viewShortcuts.AsReadOnly();
-
         viewShortcutListView.ItemsListView.Items[0].Selected = true;
         viewShortcutListView.Select();
 
+        applyTypeContextMenuStrip.Items.Clear();
+        exportTypeContextMenuStrip.Items.Clear();
+        foreach (var exportOption in Content.GetSourceExportOptions()) {
+          var applyMenuItem = new ToolStripMenuItem(exportOption.Key) { Tag = exportOption.Value };
+          applyMenuItem.Click += applyToolStripMenuItem_Click;
+          applyTypeContextMenuStrip.Items.Add(applyMenuItem);
+
+          var exportMenuItem = new ToolStripMenuItem(exportOption.Key) { Tag = exportOption.Value };
+          exportMenuItem.Click += exportToolStripMenuItem_Click;
+          exportTypeContextMenuStrip.Items.Add(exportMenuItem);
+        }
+        var exportCsvMenuItem = new ToolStripMenuItem(".csv");
+        exportCsvMenuItem.Click += exportCsvMenuItem_Click;
+        exportTypeContextMenuStrip.Items.Add(exportCsvMenuItem);
       } else {
         viewShortcutListView.Content = null;
       }
     }
-
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
+      Content.Reset += Content_Reset;
       Content.Data.FilterChanged += Data_FilterChanged;
     }
@@ -83,5 +100,10 @@
     protected override void DeregisterContentEvents() {
       base.DeregisterContentEvents();
+      Content.Reset -= Content_Reset;
       Content.Data.FilterChanged -= Data_FilterChanged;
+    }
+
+    void Content_Reset(object sender, EventArgs e) {
+      OnContentChanged(); // Reset by setting new content
     }
 
@@ -94,11 +116,91 @@
       viewShortcutListView.Enabled = Content != null;
       applyInNewTabButton.Enabled = Content != null;
-      exportProblemButton.Enabled = Content != null && Content.Problem != null;
+      exportProblemButton.Enabled = Content != null && Content.CanExport;
       undoButton.Enabled = Content != null;
     }
 
+    #region New
+    private void newButton_Click(object sender, EventArgs e) {
+      newProblemDataTypeContextMenuStrip.Show(Cursor.Position);
+    }
+    private void newRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
+      Content.Import(new RegressionProblemData());
+    }
+    private void newClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
+      Content.Import(new ClassificationProblemData());
+    }
+    private void newTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
+      Content.Import(new TimeSeriesPrognosisProblemData());
+    }
+    #endregion
+
+    #region Import
+    private void importButton_Click(object sender, EventArgs e) {
+      importProblemDataTypeContextMenuStrip.Show(Cursor.Position);
+    }
+    private void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
+      Import(new RegressionCSVInstanceProvider(), new RegressionImportTypeDialog(),
+        (dialog => ((RegressionImportTypeDialog)dialog).ImportType));
+    }
+    private void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
+      Import(new ClassificationCSVInstanceProvider(), new ClassificationImportTypeDialog(),
+        (dialog => ((ClassificationImportTypeDialog)dialog).ImportType));
+    }
+    private void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
+      Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportTypeDialog(),
+        (dialog => ((TimeSeriesPrognosisImportTypeDialog)dialog).ImportType));
+    }
+    private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportTypeDialog importTypeDialog,
+      Func<DataAnalysisImportTypeDialog, TImportType> getImportType)
+      where TProblemData : class, IDataAnalysisProblemData
+      where TImportType : DataAnalysisImportType {
+      if (importTypeDialog.ShowDialog() == DialogResult.OK) {
+        Task.Run(() => {
+          TProblemData instance;
+          var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
+          // lock active view and show progress bar
+          var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
+
+          try {
+            var progress = mainForm.AddOperationProgressToContent(activeView.Content, "Loading problem instance.");
+
+            instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
+
+            instance = instanceProvider.ImportData(importTypeDialog.Path, getImportType(importTypeDialog), importTypeDialog.CSVFormat);
+          } catch (IOException ex) {
+            MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
+            mainForm.RemoveOperationProgressFromContent(activeView.Content);
+            return;
+          }
+          try {
+            Content.Import(instance);
+          } catch (IOException ex) {
+            MessageBox.Show(string.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importTypeDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");
+          } finally {
+            mainForm.RemoveOperationProgressFromContent(activeView.Content);
+          }
+        });
+      }
+    }
+    #endregion
+
+    #region Apply
+    private void applyInNewTabButton_Click(object sender, EventArgs e) {
+      applyTypeContextMenuStrip.Show(Cursor.Position);
+    }
+    private void applyToolStripMenuItem_Click(object sender, EventArgs e) {
+      var menuItem = (ToolStripMenuItem)sender;
+      var itemCreator = (Func<IItem>)menuItem.Tag;
+      MainFormManager.MainForm.ShowContent(itemCreator());
+    }
+    #endregion
+
+    #region Export
     private void exportProblemButton_Click(object sender, EventArgs e) {
-      var problem = Content.ExportProblem();
-
+      exportTypeContextMenuStrip.Show(Cursor.Position);
+    }
+    private void exportToolStripMenuItem_Click(object sender, EventArgs e) {
+      var menuItem = (ToolStripMenuItem)sender;
+      var itemCreator = (Func<IItem>)menuItem.Tag;
       var saveFileDialog = new SaveFileDialog {
         Title = "Save Item",
@@ -108,20 +210,60 @@
       };
 
-      var content = problem as IStorableContent;
       if (saveFileDialog.ShowDialog() == DialogResult.OK) {
-        bool compressed = saveFileDialog.FilterIndex != 1;
-        ContentManager.Save(content, saveFileDialog.FileName, compressed);
-      }
-    }
-
-    private void applyInNewTabButton_Click(object sender, EventArgs e) {
-      var item = Content.Export();
-
-      MainFormManager.MainForm.ShowContent(item);
-    }
-
+        Task.Run(() => {
+          bool compressed = saveFileDialog.FilterIndex != 1;
+          var storable = itemCreator() as IStorableContent;
+          if (storable != null) {
+            var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
+            var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
+            try {
+              mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");
+              ContentManager.Save(storable, saveFileDialog.FileName, compressed);
+            } finally {
+              mainForm.RemoveOperationProgressFromContent(activeView.Content);
+            }
+          }
+        });
+      }
+    }
+    private void exportCsvMenuItem_Click(object sender, EventArgs e) {
+      var saveFileDialog = new SaveFileDialog {
+        Title = "Save Data",
+        DefaultExt = "csv",
+        Filter = "CSV files|*.csv|All files|*.*",
+        FilterIndex = 1
+      };
+
+      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
+        Task.Run(() => {
+          var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
+          var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
+          try {
+            var problemData = Content.CreateNewProblemData();
+            mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");
+            if (problemData is TimeSeriesPrognosisProblemData)
+              Export(new TimeSeriesPrognosisCSVInstanceProvider(), problemData, saveFileDialog.FileName);
+            else if (problemData is RegressionProblemData)
+              Export(new RegressionCSVInstanceProvider(), problemData, saveFileDialog.FileName);
+            else if (problemData is ClassificationProblemData)
+              Export(new ClassificationCSVInstanceProvider(), problemData, saveFileDialog.FileName);
+          } finally {
+            mainForm.RemoveOperationProgressFromContent(activeView.Content);
+          }
+        });
+      }
+    }
+    private void Export<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider,
+      IDataAnalysisProblemData problemData, string path)
+      where TProblemData : class, IDataAnalysisProblemData where TImportType : DataAnalysisImportType {
+      instanceProvider.ExportData((TProblemData)problemData, path);
+    }
+    #endregion
+
+    #region Undo / Redo
     private void undoButton_Click(object sender, EventArgs e) {
       Content.Data.Undo();
     }
+    #endregion
   }
 }
