Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-10-02 20:58:59 +0000
committerMichael Rennie2007-10-02 20:58:59 +0000
commite3d8a4714560089edc10d9232cce56acc0607d7d (patch)
treeda82b8994f4f60e2e92752190fb7dbc23bf21e86 /org.eclipse.debug.ui
parent4187b162f297be47991870f2ba491fddf17656f9 (diff)
downloadeclipse.platform.debug-e3d8a4714560089edc10d9232cce56acc0607d7d.tar.gz
eclipse.platform.debug-e3d8a4714560089edc10d9232cce56acc0607d7d.tar.xz
eclipse.platform.debug-e3d8a4714560089edc10d9232cce56acc0607d7d.zip
Bug 12898 [launching] Import/Export of launch configs
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.debug.ui/plugin.properties4
-rw-r--r--org.eclipse.debug.ui/plugin.xml26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java390
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java388
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/MultiLaunchGroupFilter.java9
16 files changed, 1048 insertions, 114 deletions
diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index 90c6ad3bd..cd25e51a4 100644
--- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -18,6 +18,7 @@ Export-Package: org.eclipse.debug.internal.ui;x-internal:=true,
org.eclipse.debug.internal.ui.contexts;x-internal:=true,
org.eclipse.debug.internal.ui.elements.adapters;x-internal:=true,
org.eclipse.debug.internal.ui.importexport.breakpoints;x-internal:=true,
+ org.eclipse.debug.internal.ui.importexport.launchconfigurations;x-internal:=true,
org.eclipse.debug.internal.ui.launchConfigurations;x-internal:=true,
org.eclipse.debug.internal.ui.memory;x-internal:=true,
org.eclipse.debug.internal.ui.memory.provisional;x-internal:=true,
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index c1ff91ade..227cc9ee7 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -358,6 +358,10 @@ exportBreakpoints.name=Breakpoints
importBreakpoints.description=Import breakpoints from the local file system.
exportBreakpoints.description=Export breakpoints to the local file system.
+importLaunchConfigurations.name=Launch Configurations
+importLaunchConfigurations.description=Import launch configurations from the local file system.
+exportLaunchConfigurations.description=Export launch configurations to the local file system.
+
switchMemoryBlock.label = Switch &Memory Monitor
switchMemoryBlock.tooltip = Switch Memory Monitor
toggleMemoryMonitorsPane.label = Toggle Memory Monitors Pane
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 6b5c5198f..74d0c625f 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -2527,6 +2527,19 @@ M4 = Platform-specific fourth key
</description>
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
+ <wizard
+ category="org.eclipse.ui.Basic"
+ class="org.eclipse.debug.internal.ui.importexport.launchconfigurations.ImportLaunchConfigurationsWizard"
+ icon="$nl$/icons/full/etool16/run_exc.gif"
+ id="org.eclipse.debug.ui.import.launchconfigurations"
+ name="%importLaunchConfigurations.name">
+ <description>
+ %importLaunchConfigurations.description
+ </description>
+ <selection
+ class="org.eclipse.core.resources.IResource">
+ </selection>
+ </wizard>
</extension>
<extension
point="org.eclipse.ui.exportWizards">
@@ -2541,6 +2554,19 @@ M4 = Platform-specific fourth key
</description>
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
+ <wizard
+ category="org.eclipse.ui.Basic"
+ class="org.eclipse.debug.internal.ui.importexport.launchconfigurations.ExportLaunchConfigurationsWizard"
+ icon="$nl$/icons/full/etool16/run_exc.gif"
+ id="org.eclipse.debug.ui.export.launchconfigurations"
+ name="%importLaunchConfigurations.name">
+ <description>
+ %exportLaunchConfigurations.description
+ </description>
+ <selection
+ class="org.eclipse.core.resources.IResource">
+ </selection>
+ </wizard>
</extension>
<extension
point="org.eclipse.debug.ui.detailPaneFactories">
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
index 88bb12872..fc8cf06a2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
@@ -138,6 +138,8 @@ public interface IDebugHelpContextIds {
//Wizards
public static final String IMPORT_BREAKPOINTS_WIZARD_PAGE = PREFIX + "import_breakpoints_wizard_page_context"; //$NON-NLS-1$
public static final String EXPORT_BREAKPOINTS_WIZARD_PAGE = PREFIX + "export_breakpoints_wizard_page_context"; //$NON-NLS-1$
+ public static final String IMPORT_LAUNCH_CONFIGURATIONS_PAGE = PREFIX + "import_launch_configurations_context"; //$NON-NLS-1$
+ public static final String EXPORT_LAUNCH_CONFIGURATIONS_PAGE = PREFIX + "export_launch_configurations_context"; //$NON-NLS-1$
//Editor
public static final String NO_SOURCE_EDITOR = PREFIX + "debugger_editor_no_source_common";//$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties
index 83adbbc96..36791f95f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties
@@ -19,12 +19,12 @@ WizardImportBreakpointsPage_6=Please specify a file to import.
WizardExportBreakpoints_0=Export Breakpoints
WizardExportBreakpointsPage_0=Please specify a destination file.
WizardExportBreakpointsPage_1=Select one or more breakpoints to export.
+WizardExportBreakpointsPage_2=&Breakpoints:
WizardBreakpointsPage_0=Breakpoint Files
WizardBreakpointsPage_1=&Select All
WizardBreakpointsPage_2=&Deselect All
WizardBreakpointsPage_3=org.eclipse.debug.ui.BreakpointView
WizardBreakpointsPage_4=Export breakpoints to the local file system.
-WizardBreakpointsPage_5=Options
WizardBreakpointsPage_6=&Overwrite existing file without warning
WizardBreakpointsPage_7=&To file:
WizardBreakpointsPage_8=Brows&e...
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
index 3d5f7373b..60fcc0cf0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
@@ -17,10 +17,11 @@ import java.util.Vector;
import org.eclipse.core.runtime.Assert;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
+import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsComparator;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsContentProvider;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsLabelProvider;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsComparator;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer;
import org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer;
@@ -31,9 +32,7 @@ import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
@@ -113,13 +112,7 @@ public class EmbeddedBreakpointsViewer {
fSelection = new StructuredSelection();
}
}
- Font font = parent.getFont();
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(1, true));
- GridData grid = new GridData(GridData.FILL_BOTH);
- grid.heightHint = HEIGHT_HINT;
- composite.setLayoutData(grid);
- composite.setFont(font);
+ Composite composite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
// create the treeview
fTree = new Tree(composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java
index 1eee03e1e..de307a3c3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java
@@ -30,7 +30,6 @@ public class ImportExportMessages extends NLS {
public static String WizardBreakpointsPage_2;
public static String WizardBreakpointsPage_3;
public static String WizardBreakpointsPage_4;
- public static String WizardBreakpointsPage_5;
public static String WizardBreakpointsPage_6;
public static String WizardBreakpointsPage_7;
public static String WizardBreakpointsPage_8;
@@ -49,5 +48,6 @@ public class ImportExportMessages extends NLS {
public static String WizardImportBreakpointsPage_5;
public static String WizardExportBreakpointsPage_0;
public static String WizardExportBreakpointsPage_1;
+ public static String WizardExportBreakpointsPage_2;
public static String WizardImportBreakpointsPage_6;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
index a7021a27a..81453c1d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
@@ -12,7 +12,6 @@
package org.eclipse.debug.internal.ui.importexport.breakpoints;
import java.lang.reflect.InvocationTargetException;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -36,21 +35,19 @@ import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.PlatformUI;
+import com.ibm.icu.text.MessageFormat;
+
/**
* <p>
* This class provides an internal implementation of a WizardPage, which is used
@@ -131,7 +128,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
}
/**
- * Handles the deselect all button pressed
+ * Handles the de-select all button pressed
*
*/
private void handleDeselectAllPressed() {
@@ -142,7 +139,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
}
/**
- * This method handles the modified event fomr the path combobox.
+ * This method handles the modified event from the path combo box.
*/
protected void handlePathTextModifiedEvent() {
setPageComplete(detectPageComplete());
@@ -176,10 +173,8 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
*/
public void createControl(Composite parent) {
initializeDialogUnits(parent);
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
-
+ Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
+ SWTFactory.createLabel(composite, ImportExportMessages.WizardExportBreakpointsPage_2, 1);
fTView = new EmbeddedBreakpointsViewer(composite, DebugPlugin.getDefault().getBreakpointManager(), fSelection);
fTView.getViewer().addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
@@ -193,7 +188,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
fTView.getViewer().getTree().getHorizontalBar().setSelection(0);
createButtonsGroup(composite);
createDestinationGroup(composite);
- createOptionsGroup(composite);
+ fOverwriteExistingFilesCheckbox = SWTFactory.createCheckButton(composite, ImportExportMessages.WizardBreakpointsPage_6, null, false, 1);
setControl(composite);
setPageComplete(detectPageComplete());
restoreWidgetState();
@@ -215,13 +210,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
* @param parent the parent control
*/
private void createButtonsGroup(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setFont(parent.getFont());
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.makeColumnsEqualWidth = true;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
+ Composite composite = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 0);
fSelectAll = SWTFactory.createPushButton(composite, ImportExportMessages.WizardBreakpointsPage_1, null);
fSelectAll.addListener(SWT.Selection, this);
fDeselectAll = SWTFactory.createPushButton(composite, ImportExportMessages.WizardBreakpointsPage_2, null);
@@ -234,7 +223,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
* To be determined "finishable" there must be a save path and there must be
* a selection in the tree.
*
- * @return if the prerequesites of the wizard are met to allow the wizard to complete.
+ * @return if the prerequisites of the wizard are met to allow the wizard to complete.
*/
private boolean detectPageComplete() {
boolean emptyFile = fDestinationNameField.getText().trim().equals(IInternalDebugCoreConstants.EMPTY_STRING);
@@ -252,51 +241,19 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
}
/**
- * Create the Options specification widgets.
- *
- * @param parent the parent to add this
- */
- protected void createOptionsGroup(Composite parent) {
- Font font = parent.getFont();
- // Options group
- Group OptionsGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- OptionsGroup.setLayout(layout);
- OptionsGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
- OptionsGroup.setText(ImportExportMessages.WizardBreakpointsPage_5);
- OptionsGroup.setFont(parent.getFont());
- fOverwriteExistingFilesCheckbox = new Button(OptionsGroup, SWT.CHECK | SWT.LEFT);
- fOverwriteExistingFilesCheckbox.setText(ImportExportMessages.WizardBreakpointsPage_6);
- fOverwriteExistingFilesCheckbox.setFont(font);
- }
-
- /**
* Create the export destination specification widgets
*
* @param parent org.eclipse.swt.widgets.Composite
*/
protected void createDestinationGroup(Composite parent) {
- Font font = parent.getFont();
// destination specification group
- Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- destinationSelectionGroup.setLayout(layout);
- destinationSelectionGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
- destinationSelectionGroup.setFont(font);
- Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
- destinationLabel.setText(ImportExportMessages.WizardBreakpointsPage_7);
- destinationLabel.setFont(font);
- fDestinationNameField = new Text(destinationSelectionGroup, SWT.BORDER);
+ Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 10);
+ SWTFactory.createLabel(comp, ImportExportMessages.WizardBreakpointsPage_7, 1);
+
+ fDestinationNameField = SWTFactory.createText(comp, SWT.SINGLE | SWT.BORDER, 1, GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
fDestinationNameField.addListener(SWT.Modify, this);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- fDestinationNameField.setLayoutData(data);
- fDestinationNameField.setFont(font);
- fDestinationBrowseButton = new Button(destinationSelectionGroup, SWT.PUSH);
- fDestinationBrowseButton.setText(ImportExportMessages.WizardBreakpointsPage_8);
+ fDestinationBrowseButton = SWTFactory.createPushButton(comp, ImportExportMessages.WizardBreakpointsPage_8, null);
fDestinationBrowseButton.addListener(SWT.Selection, this);
- fDestinationBrowseButton.setFont(font);
- setButtonLayoutData(fDestinationBrowseButton);
}
/**
@@ -326,7 +283,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
/**
* The Finish button is clicked on the main wizard
- * dialog to export the breakpoints, we write them out with all persistnat
+ * dialog to export the breakpoints, we write them out with all persistent
* information to a simple XML file via the use of XMLMemento.
*
* @return if the save operation was successful or not
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
index 242327126..395506f25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
@@ -13,7 +13,6 @@ package org.eclipse.debug.internal.ui.importexport.breakpoints;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
-import com.ibm.icu.text.MessageFormat;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
@@ -25,21 +24,19 @@ import org.eclipse.debug.ui.actions.ImportBreakpointsOperation;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.PlatformUI;
+import com.ibm.icu.text.MessageFormat;
+
/**
* The import breakpoints wizard page.
*
@@ -98,10 +95,7 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
*/
public void createControl(Composite parent) {
initializeDialogUnits(parent);
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
- composite.setFont(parent.getFont());
+ Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
createDestinationGroup(composite);
createOptionsGroup(composite);
setControl(composite);
@@ -121,7 +115,7 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
* This method is used to determine if the page can be "finished".
* To be determined "finishable" there must be an import path.
*
- * @return if the prerequesites of the wizard are met to allow the wizard to complete.
+ * @return if the prerequisites of the wizard are met to allow the wizard to complete.
*/
private boolean detectPageComplete() {
String fileName = fFileNameField.getText().trim();
@@ -145,20 +139,8 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
* @param parent the parent composite to add this one to
*/
protected void createOptionsGroup(Composite parent) {
- Font font = parent.getFont();
- // options group
- Group optionsGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- optionsGroup.setLayout(layout);
- optionsGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
- optionsGroup.setText(ImportExportMessages.WizardBreakpointsPage_5);
- optionsGroup.setFont(parent.getFont());
- fAutoRemoveDuplicates = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
- fAutoRemoveDuplicates.setText(ImportExportMessages.WizardImportBreakpointsPage_3);
- fAutoRemoveDuplicates.setFont(font);
- fAutoCreateWorkingSets = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
- fAutoCreateWorkingSets.setText(ImportExportMessages.WizardImportBreakpointsPage_5);
- fAutoCreateWorkingSets.setFont(font);
+ fAutoRemoveDuplicates = SWTFactory.createCheckButton(parent, ImportExportMessages.WizardImportBreakpointsPage_3, null, false, 1);
+ fAutoCreateWorkingSets = SWTFactory.createCheckButton(parent, ImportExportMessages.WizardImportBreakpointsPage_5, null, false, 1);
}
/**
@@ -167,26 +149,15 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
* @param parent the parent composite to add this one to
*/
protected void createDestinationGroup(Composite parent) {
- Font font = parent.getFont();
- Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- destinationSelectionGroup.setLayout(layout);
- destinationSelectionGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
- destinationSelectionGroup.setFont(font);
- Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
- destinationLabel.setText(ImportExportMessages.WizardImportBreakpointsPage_4);
- destinationLabel.setFont(font);
+ Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 10);
+ SWTFactory.createLabel(comp, ImportExportMessages.WizardImportBreakpointsPage_4, 1);
// file name entry field
- fFileNameField = new Text(destinationSelectionGroup, SWT.BORDER);
+ fFileNameField = SWTFactory.createText(comp, SWT.BORDER | SWT.SINGLE, 1, GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
fFileNameField.addListener(SWT.Modify, this);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- fFileNameField.setLayoutData(data);
- fFileNameField.setFont(font);
-
+
// destination browse button
- fBrowseForFileButton = SWTFactory.createPushButton(destinationSelectionGroup, ImportExportMessages.WizardBreakpointsPage_8, null);
+ fBrowseForFileButton = SWTFactory.createPushButton(comp, ImportExportMessages.WizardBreakpointsPage_8, null);
fBrowseForFileButton.addListener(SWT.Selection, this);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
new file mode 100644
index 000000000..cfbbe1fcc
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
+
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IExportWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * This class provides a wizard for exporting launch configurations to the local
+ * file system
+ *
+ * @since 3.4.0
+ */
+public class ExportLaunchConfigurationsWizard extends Wizard implements IExportWizard {
+
+ private String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
+
+ /**
+ * Constructor
+ */
+ public ExportLaunchConfigurationsWizard() {
+ super();
+ DebugUIPlugin plugin = DebugUIPlugin.getDefault();
+ IDialogSettings workbenchSettings = plugin.getDialogSettings();
+ IDialogSettings section = workbenchSettings.getSection(EXPORT_DIALOG_SETTINGS);
+ if (section == null)
+ section = workbenchSettings.addNewSection(EXPORT_DIALOG_SETTINGS);
+ setDialogSettings(section);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages() {
+ IWizardPage page = new ExportLaunchConfigurationsWizardPage();
+ addPage(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ public boolean performFinish() {
+ return ((ExportLaunchConfigurationsWizardPage)getStartingPage()).finish();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ setWindowTitle(WizardMessages.ExportLaunchConfigurationsWizard_0);
+ setNeedsProgressMonitor(true);
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
new file mode 100644
index 000000000..0fb9ed215
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -0,0 +1,390 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
+import org.eclipse.debug.internal.core.LaunchConfiguration;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.debug.internal.ui.launchConfigurations.MultiLaunchGroupFilter;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.ILaunchGroup;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.model.WorkbenchViewerComparator;
+import org.eclipse.ui.progress.UIJob;
+
+import com.ibm.icu.text.MessageFormat;
+
+/**
+ * This calls provides the one and only wizard page to the
+ * export launch configurations wizard.
+ * @since 3.4.0
+ */
+public class ExportLaunchConfigurationsWizardPage extends WizardPage {
+
+ /**
+ * The content provider for the tree viewer
+ * @since 3.4.0
+ */
+ class ConfigContentProvider implements ITreeContentProvider {
+
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof ILaunchConfigurationType) {
+ try {
+ return lm.getLaunchConfigurations((ILaunchConfigurationType) parentElement);
+ }
+ catch (Exception e) {
+ DebugUIPlugin.logErrorMessage(e.getMessage());
+ }
+ }
+ return null;
+ }
+ public Object getParent(Object element) {
+ if(element instanceof ILaunchConfiguration) {
+ try {
+ return ((ILaunchConfiguration)element).getType();
+ } catch (CoreException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+ public boolean hasChildren(Object element) {
+ return element instanceof ILaunchConfigurationType;
+ }
+ public Object[] getElements(Object inputElement) {
+ return lm.getLaunchConfigurationTypes();
+ }
+ public void dispose() {lm = null;}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+
+ }
+ private String OVERWRITE = "overwrite"; //$NON-NLS-1$
+ private String OLD_PATH = "oldpath"; //$NON-NLS-1$
+ private CheckboxTreeViewer fViewer = null;
+ private Text fFilePath = null;
+ private Button fOverwrite = null;
+
+ /**
+ * Constructor
+ */
+ protected ExportLaunchConfigurationsWizardPage() {
+ super(WizardMessages.ExportLaunchConfigurationsWizard_0);
+ setTitle(WizardMessages.ExportLaunchConfigurationsWizard_0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
+ //add the check table
+ createViewer(comp);
+ //add the file path and browse button
+ createFilePath(comp);
+ //add the overwrite option
+ fOverwrite = SWTFactory.createCheckButton(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_1, null, getDialogSettings().getBoolean(OVERWRITE), 2);
+ setControl(comp);
+ PlatformUI .getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.EXPORT_LAUNCH_CONFIGURATIONS_PAGE);
+ setMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_7);
+ //do not set page complete, Eclipse UI guidelines states wizards cannot start off with an error showing
+ setPageComplete(false);
+ }
+
+ /**
+ * Creates the check table viewer portion of the control
+ * @param parent the parent to add the check table viewer to
+ */
+ protected void createViewer(Composite parent) {
+ SWTFactory.createWrapLabel(parent, WizardMessages.ExportLaunchConfigurationsWizardPage_3, 2);
+ Tree tree = new Tree(parent, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ tree.setLayoutData(gd);
+ fViewer = new CheckboxTreeViewer(tree);
+ fViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
+ fViewer.setComparator(new WorkbenchViewerComparator());
+ fViewer.setContentProvider(new ConfigContentProvider());
+ fViewer.setInput(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
+ //we don't want to see builders....
+ ILaunchGroup[] groups = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroups();
+ ArrayList list = new ArrayList();
+ for(int i = 0; i < groups.length; i++) {
+ if(!"org.eclipse.ui.externaltools.launchGroup.builder".equals(groups[i].getIdentifier())) { //$NON-NLS-1$
+ list.add(groups[i]);
+ }
+ }
+ fViewer.addFilter(new MultiLaunchGroupFilter((ILaunchGroup[]) list.toArray(new ILaunchGroup[list.size()])));
+ //need to force load the children so that select all works initially
+ fViewer.expandAll();
+ fViewer.collapseAll();
+ fViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ updateCheckedState(event.getElement());
+ setPageComplete(isComplete());
+ }
+ });
+ Composite buttoncomp = SWTFactory.createComposite(parent, parent.getFont(), 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
+ Button button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_8, null);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ fViewer.setAllChecked(true);
+ setPageComplete(isComplete());
+ }
+ });
+ button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_9, null);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ fViewer.setAllChecked(false);
+ setPageComplete(isComplete());
+ }
+ });
+ }
+
+ /**
+ * Updates the checked state of child launch configurations if the parent type is checked
+ * @param item
+ */
+ protected void updateCheckedState(Object element) {
+ boolean state = fViewer.getChecked(element);
+ if(element instanceof ILaunchConfigurationType) {
+ Object[] items = ((ConfigContentProvider)fViewer.getContentProvider()).getChildren(element);
+ for(int i = 0; i < items.length; i++) {
+ fViewer.setChecked(items[i], state);
+ }
+ fViewer.setGrayed(element, false);
+ }
+ else if(element instanceof ILaunchConfiguration) {
+ ConfigContentProvider ccp = (ConfigContentProvider) fViewer.getContentProvider();
+ Object parent = ccp.getParent(element);
+ Object[] items = ccp.getChildren(parent);
+ boolean checked = true;
+ boolean onechecked = false;
+ for(int i = 0; i < items.length; i++) {
+ state = fViewer.getChecked(items[i]);
+ checked &= state;
+ if(state) {
+ onechecked = true;
+ }
+ }
+ fViewer.setGrayed(parent, onechecked & !checked);
+ fViewer.setChecked(parent, checked | onechecked);
+ }
+ }
+
+ /**
+ * Creates the controls for the file path selection area of the page
+ * @param parent
+ */
+ protected void createFilePath(Composite parent) {
+ Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 2, GridData.FILL_HORIZONTAL, 0, 10);
+ SWTFactory.createLabel(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_4, 1);
+ fFilePath = SWTFactory.createText(comp, SWT.SINGLE | SWT.BORDER, 1);
+ String opath = getDialogSettings().get(OLD_PATH);
+ fFilePath.setText((opath == null ? IInternalDebugCoreConstants.EMPTY_STRING : opath));
+ Button button = SWTFactory.createPushButton(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_0, null, GridData.END);
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog dd = new DirectoryDialog(getContainer().getShell());
+ dd.setText(WizardMessages.ExportLaunchConfigurationsWizard_0);
+ String file = dd.open();
+ if(file != null) {
+ IPath path = new Path(file);
+ if (path != null) {
+ fFilePath.setText(path.toString());
+ setPageComplete(isComplete());
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Returns if the page is complete
+ * @return true if the page is complete and can be 'finished', false otherwise
+ */
+ protected boolean isComplete() {
+ Object[] elements = fViewer.getCheckedElements();
+ boolean oneconfig = false;
+ for(int i = 0; i < elements.length; i++) {
+ if(elements[i] instanceof ILaunchConfiguration) {
+ oneconfig = true;
+ break;
+ }
+ }
+ if(elements.length < 1 || !oneconfig) {
+ setErrorMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_5);
+ return false;
+ }
+ if(fFilePath.getText().trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
+ setErrorMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_6);
+ return false;
+ }
+ setErrorMessage(null);
+ setMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_7);
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.WizardPage#getImage()
+ */
+ public Image getImage() {
+ return DebugUITools.getImage(IDebugUIConstants.IMG_WIZBAN_RUN);
+ }
+
+ /**
+ * This method performs the work of the page
+ * @return if the export job was successful or not
+ */
+ public boolean finish() {
+ final String dpath = fFilePath.getText().trim();
+ IDialogSettings settings = getDialogSettings();
+ settings.put(OVERWRITE, fOverwrite.getSelection());
+ settings.put(OLD_PATH, dpath);
+ final Object[] configs = fViewer.getCheckedElements();
+ final boolean overwrite = fOverwrite.getSelection();
+ UIJob exportjob = new UIJob(getContainer().getShell().getDisplay(), WizardMessages.ExportLaunchConfigurationsWizard_0) {
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ if(monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+ IPath destpath = new Path(dpath);
+ File destfolder = destpath.toFile();
+ if(!destfolder.exists()) {
+ destfolder.mkdirs();
+ }
+ monitor.beginTask(WizardMessages.ExportLaunchConfigurationsWizardPage_10, configs.length);
+ try {
+ File file = null, newfile = null;
+ boolean owall = false, nowall = false;
+ MessageDialog dialog = null;
+ for(int i = 0; i < configs.length; i++) {
+ if(monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ if(configs[i] instanceof ILaunchConfiguration) {
+ file = new File(((LaunchConfiguration) configs[i]).getLocation().toOSString());
+ try {
+ newfile = new File(destpath.append(file.getName()).toOSString());
+ if(newfile.exists() & !overwrite) {
+ if(nowall) {
+ continue;
+ }
+ dialog = new MessageDialog(DebugUIPlugin.getShell(),
+ WizardMessages.ExportLaunchConfigurationsWizardPage_11,
+ null,
+ MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new String[] {file.getName()}),
+ MessageDialog.QUESTION, new String[] {WizardMessages.ExportLaunchConfigurationsWizardPage_13, WizardMessages.ExportLaunchConfigurationsWizardPage_14, WizardMessages.ExportLaunchConfigurationsWizardPage_15, WizardMessages.ExportLaunchConfigurationsWizardPage_16, WizardMessages.ExportLaunchConfigurationsWizardPage_17}, 0);
+ if(!owall) {
+ int ret = dialog.open();
+ switch(ret) {
+ case 0: {
+ copyFile(file, newfile);
+ break;
+ }
+ case 1: {
+ owall = true;
+ copyFile(file, newfile);
+ break;
+ }
+ case 3: {
+ nowall = true;
+ break;
+ }
+ case 4: {
+ monitor.setCanceled(true);
+ break;
+ }
+ }
+ }
+ else if(!nowall) {
+ copyFile(file, newfile);
+ }
+ }
+ else {
+ copyFile(file, newfile);
+ }
+ }
+ catch (Exception e) {
+ DebugUIPlugin.logErrorMessage(e.getMessage());
+ }
+ }
+ if(!monitor.isCanceled()) {
+ monitor.worked(1);
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ finally {
+ monitor.done();
+ }
+ }
+ };
+ exportjob.schedule();
+ return true;
+ }
+
+ /**
+ * Copies a file from one location to another
+ * @param in the file to copy
+ * @param out the file to be copied out to
+ * @throws Exception
+ */
+ protected void copyFile(File in, File out) throws Exception {
+ FileInputStream fis = new FileInputStream(in);
+ FileOutputStream fos = new FileOutputStream(out);
+ byte[] buf = new byte[1024];
+ int i = 0;
+ while((i = fis.read(buf)) != -1) {
+ fos.write(buf, 0, i);
+ }
+ fis.close();
+ fos.close();
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
new file mode 100644
index 000000000..a02537b8b
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
+
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * This class provides a wizard for importing launch configurations from the local
+ * file system into the current workspace.
+ *
+ * It allows the suer to specify if the configuration should be shared or local
+ * once imported
+ *
+ * @since 3.4.0
+ */
+public class ImportLaunchConfigurationsWizard extends Wizard implements IImportWizard {
+
+ private String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
+
+ /**
+ * Constructor
+ */
+ public ImportLaunchConfigurationsWizard() {
+ super();
+ DebugUIPlugin plugin = DebugUIPlugin.getDefault();
+ IDialogSettings workbenchSettings = plugin.getDialogSettings();
+ IDialogSettings section = workbenchSettings.getSection(EXPORT_DIALOG_SETTINGS);
+ if (section == null)
+ section = workbenchSettings.addNewSection(EXPORT_DIALOG_SETTINGS);
+ setDialogSettings(section);
+ setNeedsProgressMonitor(true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ public boolean performFinish() {
+ return ((ImportLaunchConfigurationsWizardPage)getStartingPage()).finish();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages() {
+ addPage(new ImportLaunchConfigurationsWizardPage());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ setWindowTitle("Import Launch Configurations");
+ setNeedsProgressMonitor(true);
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
new file mode 100644
index 000000000..dd95586ee
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
@@ -0,0 +1,388 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
+import org.eclipse.debug.internal.core.LaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
+import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FileSystemElement;
+import org.eclipse.ui.dialogs.WizardResourceImportPage;
+import org.eclipse.ui.model.AdaptableList;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.progress.UIJob;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+
+import com.ibm.icu.text.MessageFormat;
+
+/**
+ * This class providers the one and only page for the import launch configurations wizard
+ * @since 3.4.0
+ */
+public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPage {
+
+ /**
+ * Represents a debug view of the file system, in that we only care about folders and files with the
+ * extension *.launch
+ * @since 3.4.0
+ */
+ class DebugFileSystemElement extends FileSystemElement {
+
+ private boolean populated = false;
+
+ public DebugFileSystemElement(String name, FileSystemElement parent, boolean isDirectory) {
+ super(name, parent, isDirectory);
+ }
+
+ public void setPopulated() {
+ populated = true;
+ }
+
+ public boolean isPopulated() {
+ return populated;
+ }
+
+ public AdaptableList getFiles() {
+ if(!populated) {
+ populateElementChildren();
+ }
+ return super.getFiles();
+ }
+
+ public AdaptableList getFolders() {
+ if(!populated) {
+ populateElementChildren();
+ }
+ return super.getFolders();
+ }
+
+ /**
+ * Populates the children of the specified parent <code>FileSystemElement</code>
+ * @param element
+ * @param folderonly
+ */
+ private void populateElementChildren() {
+ FileSystemStructureProvider provider = FileSystemStructureProvider.INSTANCE;
+ List allchildren = provider.getChildren(this.getFileSystemObject());
+ File child = null;
+ DebugFileSystemElement newelement = null;
+ Iterator iter = allchildren.iterator();
+ while(iter.hasNext()) {
+ child = (File) iter.next();
+ if(child.isFile()) {
+ Path childpath = new Path(child.getAbsolutePath());
+ String extension = childpath.getFileExtension();
+ if(extension != null && extension.equals(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION)) {
+ newelement = new DebugFileSystemElement(provider.getLabel(child), this, provider.isFolder(child));
+ newelement.setFileSystemObject(child);
+ }
+ }
+ else {
+ newelement = new DebugFileSystemElement(provider.getLabel(child), this, provider.isFolder(child));
+ newelement.setFileSystemObject(child);
+ }
+ }
+ setPopulated();
+ }
+ }
+
+ private String OVERWRITE = "import_config_overwrite"; //$NON-NLS-1$
+ private String OLD_PATH = "import_config_oldpath"; //$NON-NLS-1$
+
+ private Text fFromDirectory = null;
+ private Button fOverwrite = null;
+
+ /**
+ * Constructor
+ */
+ public ImportLaunchConfigurationsWizardPage() {
+ super(WizardMessages.ImportLaunchConfigurationsWizardPage_0, new StructuredSelection());
+ setTitle(WizardMessages.ImportLaunchConfigurationsWizardPage_0);
+ setMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_5);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
+ createRootDirectoryGroup(comp);
+ createFileSelectionGroup(comp);
+ IDialogSettings settings = getDialogSettings();
+ fOverwrite = SWTFactory.createCheckButton(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_1, null, settings.getBoolean(OVERWRITE), 1);
+ String oldpath = settings.get(OLD_PATH);
+ fFromDirectory.setText((oldpath == null ? IInternalDebugCoreConstants.EMPTY_STRING : oldpath));
+ resetSelection(new Path(oldpath));
+ setControl(comp);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.IMPORT_LAUNCH_CONFIGURATIONS_PAGE);
+ setPageComplete(false);
+ //do not set page complete, Eclipse UI guidelines states wizards cannot start off with an error showing
+ }
+
+ /**
+ * Performs the actual work of the wizard page and return is the work was successful
+ * @return true if the import completed normally, false otherwise
+ */
+ public boolean finish() {
+ IDialogSettings settings = getDialogSettings();
+ settings.put(OVERWRITE, fOverwrite.getSelection());
+ settings.put(OLD_PATH, fFromDirectory.getText().trim());
+ final boolean overwrite = fOverwrite.getSelection();
+ UIJob importjob = new UIJob(getContainer().getShell().getDisplay(), WizardMessages.ExportLaunchConfigurationsWizard_0) {
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ if(monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+ List items = selectionGroup.getAllCheckedListItems();
+ monitor.beginTask(WizardMessages.ImportLaunchConfigurationsWizardPage_2, items.size());
+ try {
+ File config, newconfig = null;
+ boolean owall = false, nowall = false;
+ MessageDialog dialog = null;
+ for(Iterator iter = items.iterator(); iter.hasNext();) {
+ if(monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+ config = (File) ((DebugFileSystemElement) iter.next()).getFileSystemObject();
+ newconfig = new File(new Path(LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.toOSString()).append(config.getName()).toOSString());
+ try {
+ if(newconfig.exists() & !overwrite) {
+ if(nowall) {
+ continue;
+ }
+ dialog = new MessageDialog(DebugUIPlugin.getShell(),
+ WizardMessages.ExportLaunchConfigurationsWizardPage_11,
+ null,
+ MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new String[] {config.getName()}),
+ MessageDialog.QUESTION, new String[] {WizardMessages.ExportLaunchConfigurationsWizardPage_13, WizardMessages.ExportLaunchConfigurationsWizardPage_14, WizardMessages.ExportLaunchConfigurationsWizardPage_15, WizardMessages.ExportLaunchConfigurationsWizardPage_16, WizardMessages.ExportLaunchConfigurationsWizardPage_17}, 0);
+ if(!owall) {
+ int ret = dialog.open();
+ switch(ret) {
+ case 0: {
+ copyFile(config, newconfig);
+ break;
+ }
+ case 1: {
+ owall = true;
+ copyFile(config, newconfig);
+ break;
+ }
+ case 3: {
+ nowall = true;
+ break;
+ }
+ case 4: {
+ monitor.setCanceled(true);
+ break;
+ }
+ }
+ }
+ else if(!nowall) {
+ copyFile(config, newconfig);
+ }
+ }
+ else {
+ copyFile(config, newconfig);
+ }
+ }
+ catch (Exception e) {
+ DebugUIPlugin.log(e);
+ }
+ if(!monitor.isCanceled()) {
+ monitor.worked(1);
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ finally {
+ monitor.done();
+ }
+ }
+ };
+ importjob.schedule();
+ return true;
+ }
+
+ /**
+ * Copies a file from one location to another
+ * @param in the file to copy
+ * @param out the file to be copied out to
+ * @throws Exception
+ */
+ protected void copyFile(File in, File out) throws Exception {
+ FileInputStream fis = new FileInputStream(in);
+ FileOutputStream fos = new FileOutputStream(out);
+ byte[] buf = new byte[1024];
+ int i = 0;
+ while((i = fis.read(buf)) != -1) {
+ fos.write(buf, 0, i);
+ }
+ fis.close();
+ fos.close();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.WizardPage#getImage()
+ */
+ public Image getImage() {
+ return DebugUITools.getImage(IDebugUIConstants.IMG_WIZBAN_RUN);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.WizardResourceImportPage#updateWidgetEnablements()
+ */
+ protected void updateWidgetEnablements() {
+ setPageComplete(determinePageCompletion());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.WizardResourceImportPage#determinePageCompletion()
+ */
+ protected boolean determinePageCompletion() {
+ if(fFromDirectory.getText().trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
+ setErrorMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_3);
+ return false;
+ }
+ if(selectionGroup.getCheckedElementCount() < 1) {
+ setErrorMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_4);
+ return false;
+ }
+ setErrorMessage(null);
+ setMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_5);
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createSourceGroup(org.eclipse.swt.widgets.Composite)
+ */
+ protected void createSourceGroup(Composite parent) {}
+
+ /**
+ * Create the group for creating the root directory
+ */
+ protected void createRootDirectoryGroup(Composite parent) {
+ Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 0);
+ SWTFactory.createLabel(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_6, 1);
+ // source name entry field
+ fFromDirectory = SWTFactory.createText(comp, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY, 1, GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
+ // source browse button
+ Button browse = SWTFactory.createPushButton(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_7, null);
+ browse.addSelectionListener(new SelectionAdapter () {
+ public void widgetSelected(SelectionEvent e) {
+ DirectoryDialog dd = new DirectoryDialog(getContainer().getShell());
+ dd.setText(WizardMessages.ImportLaunchConfigurationsWizardPage_0);
+ String filename = dd.open();
+ if(filename != null) {
+ IPath path = new Path(filename);
+ if (path != null) {
+ fFromDirectory.setText(path.toString());
+ resetSelection(path);
+ setPageComplete(determinePageCompletion());
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Resets the selection of the tree root element for the viewer
+ * @param path the path from the text widget
+ */
+ protected void resetSelection(final IPath path) {
+ BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
+ public void run() {
+ File file = new File(path.toOSString());
+ DebugFileSystemElement dummyparent = new DebugFileSystemElement(IInternalDebugCoreConstants.EMPTY_STRING, null, true);
+ dummyparent.setPopulated();
+ DebugFileSystemElement element = new DebugFileSystemElement(FileSystemStructureProvider.INSTANCE.getLabel(file),
+ dummyparent,
+ file.isDirectory());
+ element.setFileSystemObject(file);
+ element.getFiles();
+ selectionGroup.setRoot(dummyparent);
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFileProvider()
+ */
+ protected ITreeContentProvider getFileProvider() {
+ return new WorkbenchContentProvider() {
+ public Object[] getChildren(Object o) {
+ if (o instanceof DebugFileSystemElement) {
+ DebugFileSystemElement element = (DebugFileSystemElement) o;
+ return element.getFiles().getChildren(element);
+ }
+ return new Object[0];
+ }
+ };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFolderProvider()
+ */
+ protected ITreeContentProvider getFolderProvider() {
+ return new WorkbenchContentProvider() {
+ public Object[] getChildren(Object o) {
+ if (o instanceof DebugFileSystemElement) {
+ DebugFileSystemElement element = (DebugFileSystemElement) o;
+ return element.getFolders().getChildren();
+ }
+ return new Object[0];
+ }
+
+ public boolean hasChildren(Object o) {
+ if (o instanceof DebugFileSystemElement) {
+ DebugFileSystemElement element = (DebugFileSystemElement) o;
+ if (element.isPopulated()) {
+ return getChildren(element).length > 0;
+ }
+ //If we have not populated then wait until asked
+ return true;
+ }
+ return false;
+ }
+ };
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java
new file mode 100644
index 000000000..cda8f44cf
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java
@@ -0,0 +1,40 @@
+package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
+
+import org.eclipse.osgi.util.NLS;
+
+public class WizardMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.importexport.launchconfigurations.WizardMessages"; //$NON-NLS-1$
+ public static String ExportLaunchConfigurationsWizard_0;
+ public static String ExportLaunchConfigurationsWizardPage_0;
+ public static String ExportLaunchConfigurationsWizardPage_1;
+ public static String ExportLaunchConfigurationsWizardPage_10;
+ public static String ExportLaunchConfigurationsWizardPage_11;
+ public static String ExportLaunchConfigurationsWizardPage_12;
+ public static String ExportLaunchConfigurationsWizardPage_13;
+ public static String ExportLaunchConfigurationsWizardPage_14;
+ public static String ExportLaunchConfigurationsWizardPage_15;
+ public static String ExportLaunchConfigurationsWizardPage_16;
+ public static String ExportLaunchConfigurationsWizardPage_17;
+ public static String ExportLaunchConfigurationsWizardPage_3;
+ public static String ExportLaunchConfigurationsWizardPage_4;
+ public static String ExportLaunchConfigurationsWizardPage_5;
+ public static String ExportLaunchConfigurationsWizardPage_6;
+ public static String ExportLaunchConfigurationsWizardPage_7;
+ public static String ExportLaunchConfigurationsWizardPage_8;
+ public static String ExportLaunchConfigurationsWizardPage_9;
+ public static String ImportLaunchConfigurationsWizardPage_0;
+ public static String ImportLaunchConfigurationsWizardPage_1;
+ public static String ImportLaunchConfigurationsWizardPage_2;
+ public static String ImportLaunchConfigurationsWizardPage_3;
+ public static String ImportLaunchConfigurationsWizardPage_4;
+ public static String ImportLaunchConfigurationsWizardPage_5;
+ public static String ImportLaunchConfigurationsWizardPage_6;
+ public static String ImportLaunchConfigurationsWizardPage_7;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, WizardMessages.class);
+ }
+
+ private WizardMessages() {
+ }
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties
new file mode 100644
index 000000000..5349f4b0e
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties
@@ -0,0 +1,26 @@
+ExportLaunchConfigurationsWizard_0=Export Launch Configurations
+ExportLaunchConfigurationsWizardPage_0=Brows&e...
+ExportLaunchConfigurationsWizardPage_1=&Overwrite existing file(s) without warning
+ExportLaunchConfigurationsWizardPage_10=Exporting Launch Configurations
+ExportLaunchConfigurationsWizardPage_11=Overwrite?
+ExportLaunchConfigurationsWizardPage_12=Would you like overwrite {0}?
+ExportLaunchConfigurationsWizardPage_13=Yes
+ExportLaunchConfigurationsWizardPage_14=Yes to All
+ExportLaunchConfigurationsWizardPage_15=No
+ExportLaunchConfigurationsWizardPage_16=No to All
+ExportLaunchConfigurationsWizardPage_17=Cancel
+ExportLaunchConfigurationsWizardPage_3=&Launch Configurations:
+ExportLaunchConfigurationsWizardPage_4=Location:
+ExportLaunchConfigurationsWizardPage_5=Please select at least one launch configuration to export
+ExportLaunchConfigurationsWizardPage_6=Please specify a path to export the launch configurations to
+ExportLaunchConfigurationsWizardPage_7=Export launch configurations to the local file system
+ExportLaunchConfigurationsWizardPage_8=&Select All
+ExportLaunchConfigurationsWizardPage_9=&Deselect All
+ImportLaunchConfigurationsWizardPage_0=Import Launch Configurations
+ImportLaunchConfigurationsWizardPage_1=&Overwrite existing launch configurations without warning.
+ImportLaunchConfigurationsWizardPage_2=Importing launch configurations
+ImportLaunchConfigurationsWizardPage_3=You must select a root folder
+ImportLaunchConfigurationsWizardPage_4=You must select at least one configuration to import
+ImportLaunchConfigurationsWizardPage_5=Import launch configurations from the local file system
+ImportLaunchConfigurationsWizardPage_6=From &Directory:
+ImportLaunchConfigurationsWizardPage_7=Brows&e...
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/MultiLaunchGroupFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/MultiLaunchGroupFilter.java
index 7ca6555f3..8c1dc5c5c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/MultiLaunchGroupFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/MultiLaunchGroupFilter.java
@@ -14,6 +14,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
@@ -27,11 +28,11 @@ import org.eclipse.ui.activities.WorkbenchActivityHelper;
public class MultiLaunchGroupFilter extends ViewerFilter {
/**
- * array of launchgroup extensions to test for filtering against
+ * array of launch group extensions to test for filtering against
*/
- private LaunchGroupExtension[] fGroups;
+ private ILaunchGroup[] fGroups;
- public MultiLaunchGroupFilter(LaunchGroupExtension[] groups) {
+ public MultiLaunchGroupFilter(ILaunchGroup[] groups) {
fGroups = groups;
}
@@ -80,7 +81,7 @@ public class MultiLaunchGroupFilter extends ViewerFilter {
/**
* compares a category against those passed in the creation of the filter
* @param category the category to compare
- * @return true if the category matches any one fo the categories in the listing, false otherwise
+ * @return true if the category matches any one of the categories in the listing, false otherwise
*/
private boolean equalCategories(String category) {
String lcat = null;

Back to the top