Update internal packages export in LTTng 2.0 control + update java doc
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui / src / org / eclipse / linuxtools / internal / lttng2 / ui / views / control / dialogs / TraceControlDialogFactory.java
index f8d5d8a7205fc9f6e2a8942231cf259b65075723..71b3a8563440b420ec9c8a77efa1ccb6438704d2 100644 (file)
@@ -1,8 +1,27 @@
+/**********************************************************************
+ * Copyright (c) 2012 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: 
+ *   Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
 package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
 
 import org.eclipse.ui.PlatformUI;
 
-
+/**
+ * <p>
+ * Factory for generating dialog boxes. It allows to overwrite the dialog implementation.
+ * Useful also for testing purposes.  
+ * </p>
+ * 
+ * @author Bernd Hufmann
+ *
+ */
 final public class TraceControlDialogFactory {
 
     // ------------------------------------------------------------------------
@@ -20,9 +39,9 @@ final public class TraceControlDialogFactory {
     private INewConnectionDialog fNewConnectionDialog;
     
     /**
-     * The create channel dialog (on domain level)
+     * The enable channel dialog
      */
-    private ICreateChannelDialog fCreateChannelDialog;
+    private IEnableChannelDialog fEnableChannelDialog;
     
     /**
      * The create session dialog.
@@ -40,9 +59,24 @@ final public class TraceControlDialogFactory {
     private IGetEventInfoDialog fGetEventInfoDialog;
     
     /**
-     * The confirmation dialog implementation
+     * The confirmation dialog implementation.
      */
     private IConfirmDialog fConfirmDialog;
+    
+    /**
+     * The add context dialog implementation.
+     */
+    private IAddContextDialog fAddContextDialog;
+    
+    /**
+     * The import dialog implementation.
+     */
+    private IImportDialog fImportDialog;
+    
+    /**
+     * The import confirmation dialog.
+     */
+    private IImportConfirmationDialog fImportConfirmationDialog;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -87,21 +121,21 @@ final public class TraceControlDialogFactory {
     }
     
     /**
-     * @return create channel dialog (on domain level)
+     * @return enable channel dialog
      */
-    public ICreateChannelDialog getCreateChannelDialog() {
-        if (fCreateChannelDialog == null) {
-            fCreateChannelDialog = new CreateChannelDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+    public IEnableChannelDialog getEnableChannelDialog() {
+        if (fEnableChannelDialog == null) {
+            fEnableChannelDialog = new EnableChannelDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
         }
-        return fCreateChannelDialog;
+        return fEnableChannelDialog;
     }
 
     /**
-     * Sets a create channel dialog implementation (on domain level).
-     * @param createChannelDialog - a create channel dialog implementation
+     * Sets a enable channel dialog implementation.
+     * @param createEnableDialog - a create channel dialog implementation
      */
-    public void setCreateChannelDialog(ICreateChannelDialog createChannelDialog) {
-        fCreateChannelDialog = createChannelDialog;
+    public void setEnableChannelDialog(IEnableChannelDialog createEnableDialog) {
+        fEnableChannelDialog = createEnableDialog;
     }
     
     /**
@@ -170,11 +204,64 @@ final public class TraceControlDialogFactory {
     
     /**
      * Sets the confirmation dialog implementation
-     * @param confirmDialog
+     * @param confirmDialog - a confirmation dialog implementation
      */
     public void setConfirmDialog(IConfirmDialog confirmDialog) {
         fConfirmDialog = confirmDialog;
     }
+    
+    /**
+     * @return the add context dialog implementation
+     */
+    public IAddContextDialog getAddContextDialog() {
+        if (fAddContextDialog == null) {
+            fAddContextDialog = new AddContextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+        }
+        return fAddContextDialog;
+    }
+    
+    /**
+     * Sets the add context dialog information
+     * @param addContextDialog - a add context dialog implementation
+     */
+    public void setAddContextDialog(IAddContextDialog addContextDialog) {
+        fAddContextDialog = addContextDialog;
+    }
+    
+    /**
+     * @return the import dialog implementation
+     */
+    public IImportDialog getImportDialog() {
+        if (fImportDialog == null) {
+            fImportDialog = new ImportDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+        }
+        return fImportDialog;
+    }
+    
+    /**
+     * Sets the import dialog implementation.
+     * @param importDialog - a import dialog implementation
+     */
+    public void setImportDialog(IImportDialog importDialog) {
+        fImportDialog = importDialog;
+    }
+    
+    /**
+     * @return the import confirmation dialog implementation.
+     */
+    public IImportConfirmationDialog getImportConfirmationDialog() {
+        if (fImportConfirmationDialog == null) {
+            fImportConfirmationDialog = new ImportConfirmationDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+        }
+        return fImportConfirmationDialog;
+    }
+    
+    /**
+     * Sets the import confirmation dialog implementation.
+     * @param confirmDialog - a import confirmation dialog implementation. 
+     */
+    public void setImportConfirmationDialog(IImportConfirmationDialog confirmDialog) {
+        fImportConfirmationDialog = confirmDialog;
+    }
 }
 
-
This page took 0.02598 seconds and 5 git commands to generate.