+/**********************************************************************
+ * 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 {
// ------------------------------------------------------------------------
private INewConnectionDialog fNewConnectionDialog;
/**
- * The create channel dialog (on domain level)
+ * The enable channel dialog
*/
- private ICreateChannelDialog fCreateChannelDialog;
+ private IEnableChannelDialog fEnableChannelDialog;
/**
* The create session dialog.
private IGetEventInfoDialog fGetEventInfoDialog;
/**
- * The confirmation dialog implementation
+ * The confirmation dialog implementation.
*/
private IConfirmDialog fConfirmDialog;
/**
- * The add context dialog implementation
+ * The add context dialog implementation.
*/
private IAddContextDialog fAddContextDialog;
+
+ /**
+ * The import dialog implementation.
+ */
+ private IImportDialog fImportDialog;
+
+ /**
+ * The import confirmation dialog.
+ */
+ private IImportConfirmationDialog fImportConfirmationDialog;
// ------------------------------------------------------------------------
// Constructors
}
/**
- * @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;
}
/**
/**
* Sets the confirmation dialog implementation
- * @param confirmDialog
+ * @param confirmDialog - a confirmation dialog implementation
*/
public void setConfirmDialog(IConfirmDialog confirmDialog) {
fConfirmDialog = confirmDialog;
/**
* Sets the add context dialog information
- * @param addContextDialog
+ * @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;
+ }
}
-