Skip to content

Commit 30180a8

Browse files
SougandhSlaeubi
authored andcommitted
Add option to show import configuration in launch tool bar
New users often found it difficult to locate the import functionality quickly. This change adds an "Import Launch Configurations" option to the toolbar, making it consistent with the existing export option.
1 parent e0bd9db commit 30180a8

File tree

9 files changed

+386
-6
lines changed

9 files changed

+386
-6
lines changed
Lines changed: 294 additions & 0 deletions
Loading

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2017 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -164,6 +164,8 @@ private static void declareImages() {
164164
ELCL + "restart_co.svg"); //$NON-NLS-1$
165165
declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_EXPORT_CONFIG,
166166
IInternalDebugUIConstants.IMG_DLCL_EXPORT_CONFIG, ELCL + "export_config.svg"); //$NON-NLS-1$
167+
declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_IMPORT_CONFIG,
168+
IInternalDebugUIConstants.IMG_DLCL_IMPORT_CONFIG, ELCL + "import_config.svg"); //$NON-NLS-1$
167169

168170
//Object
169171
declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_DEBUG, OBJECT + "ldebug_obj.svg"); //$NON-NLS-1$

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public interface IInternalDebugUIConstants {
7777
String IMG_DLCL_PREVIOUS_THREAD = "IMG_DLCL_PREVIOUS_THREAD"; //$NON-NLS-1$
7878
String IMG_DLCL_RESTART = "IMG_DLCL_RESTART"; //$NON-NLS-1$
7979
String IMG_DLCL_EXPORT_CONFIG = "IMG_DLCL_EXPORT_CONFIG"; //$NON-NLS-1$
80+
String IMG_DLCL_IMPORT_CONFIG = "IMG_DLCL_IMPORT_CONFIG"; //$NON-NLS-1$
8081

8182
//TODO: Move this IDebugUIConstants. Created too late in 3.2 cycle to add API.
8283
//The enabled icon is already API.
@@ -120,7 +121,7 @@ public interface IInternalDebugUIConstants {
120121
String IMG_ELCL_RESTART = "IMG_ELCL_RESTART"; //$NON-NLS-1$
121122
String IMG_ELCL_DEBUG_VIEW_COMPACT_LAYOUT = "IMG_ELCL_DEBUG_VIEW_BREADCRUMB_LAYOUT"; //$NON-NLS-1$
122123
String IMG_ELCL_EXPORT_CONFIG = "IMG_ELCL_EXPORT_CONFIG"; //$NON-NLS-1$
123-
124+
String IMG_ELCL_IMPORT_CONFIG = "IMG_ELCL_IMPORT_CONFIG"; //$NON-NLS-1$
124125
String IMG_OBJS_COMMON_TAB = "IMG_OBJS_COMMON_TAB"; //$NON-NLS-1$
125126
String IMG_OBJS_REFRESH_TAB = "IMG_OBJS_REFRESH_TAB"; //$NON-NLS-1$
126127
String IMG_OBJS_PERSPECTIVE_TAB = "IMG_OBJS_PERSPECTIVE_TAB"; //$NON-NLS-1$
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 IBM Corporation.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.debug.internal.ui.launchConfigurations;
15+
16+
import org.eclipse.debug.internal.ui.DebugUIPlugin;
17+
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
18+
import org.eclipse.debug.internal.ui.importexport.launchconfigurations.ImportLaunchConfigurationsWizard;
19+
import org.eclipse.debug.ui.DebugUITools;
20+
import org.eclipse.jface.resource.ImageDescriptor;
21+
import org.eclipse.jface.viewers.Viewer;
22+
import org.eclipse.jface.wizard.WizardDialog;
23+
import org.eclipse.ui.PlatformUI;
24+
25+
public class ImportLaunchConfigurationAction extends AbstractLaunchConfigurationAction {
26+
/**
27+
* Action identifier for IDebugView#getAction(String)
28+
*/
29+
public static final String ID_IMPORT_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_IMPORT_ACTION"; //$NON-NLS-1$
30+
31+
/**
32+
* Constructs an action to import launch configuration(s)
33+
*/
34+
public ImportLaunchConfigurationAction(Viewer viewer, String mode) {
35+
super(LaunchConfigurationsMessages.ImportLaunchConfigurationAction, viewer, mode);
36+
}
37+
38+
@Override
39+
protected void performAction() {
40+
ImportLaunchConfigurationsWizard wizard = new ImportLaunchConfigurationsWizard();
41+
wizard.init(PlatformUI.getWorkbench(), null);
42+
WizardDialog dialog = new WizardDialog(getShell(), wizard);
43+
dialog.open();
44+
}
45+
46+
@Override
47+
public ImageDescriptor getDisabledImageDescriptor() {
48+
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_IMPORT_CONFIG);
49+
}
50+
51+
@Override
52+
public ImageDescriptor getImageDescriptor() {
53+
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_IMPORT_CONFIG);
54+
}
55+
56+
@Override
57+
public String getToolTipText() {
58+
return LaunchConfigurationsMessages.LaunchConfigurationImportDialog;
59+
}
60+
61+
}

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ private void createGettingStarted(Composite parent) {
365365
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_2, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG), 1, width);
366366
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_NEW_PROTO), 1, width);
367367
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_7, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_EXPORT_CONFIG), 1, width);
368+
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_19,
369+
DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_IMPORT_CONFIG), 1, width);
368370
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_6, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG), 1, width);
369371
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_4, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG), 1, width);
370372
SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_8, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS), 1, width);

0 commit comments

Comments
 (0)