Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2017-08-29 01:47:16 -0400
committerSarika Sinha2017-09-01 01:15:06 -0400
commit05dd5ce963c009959ec7be3905321757e3a96b5e (patch)
treee8054765eb80ba9d83deab7579094126c921a60a
parentc0a97a9cdcf3b2a426e9d2f6cbae36cbbfea28b5 (diff)
downloadeclipse.platform.debug-05dd5ce963c009959ec7be3905321757e3a96b5e.tar.gz
eclipse.platform.debug-05dd5ce963c009959ec7be3905321757e3a96b5e.tar.xz
eclipse.platform.debug-05dd5ce963c009959ec7be3905321757e3a96b5e.zip
Bug 518866 - [9] User should have the ability to define module path and
classpath while launching Change-Id: I55dbc85b53d87d5936f9335023ad4385314a53d9
-rw-r--r--org.eclipse.debug.ui/.settings/.api_filters140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java97
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java12
4 files changed, 171 insertions, 82 deletions
diff --git a/org.eclipse.debug.ui/.settings/.api_filters b/org.eclipse.debug.ui/.settings/.api_filters
index ff2070863..e7430a98a 100644
--- a/org.eclipse.debug.ui/.settings/.api_filters
+++ b/org.eclipse.debug.ui/.settings/.api_filters
@@ -1,66 +1,74 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.debug.ui" version="2">
- <resource path="ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java" type="org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationViewer">
- <filter comment="Known illegal extension" id="571473929">
- <message_arguments>
- <message_argument value="TreeViewer"/>
- <message_argument value="LaunchConfigurationViewer"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java" type="org.eclipse.debug.internal.ui.preferences.LaunchPerspectivePreferencePage$PerspectivesTreeViewer">
- <filter comment="Known illegal extension" id="571473929">
- <message_arguments>
- <message_argument value="TreeViewer"/>
- <message_argument value="PerspectivesTreeViewer"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java" type="org.eclipse.debug.internal.ui.sourcelookup.SourceContainerViewer">
- <filter comment="Known illegal extension" id="571473929">
- <message_arguments>
- <message_argument value="TreeViewer"/>
- <message_argument value="SourceContainerViewer"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java" type="org.eclipse.debug.internal.ui.sourcelookup.browsers.ProjectSourceContainerDialog">
- <filter comment="Known illegal extension" id="571473929">
- <message_arguments>
- <message_argument value="ListSelectionDialog"/>
- <message_argument value="ProjectSourceContainerDialog"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java" type="org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer">
- <filter comment="Known illegal extension for the async viewer support" id="571473929">
- <message_arguments>
- <message_argument value="TreeViewer"/>
- <message_argument value="InternalTreeModelViewer"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java" type="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer">
- <filter comment="Known illegal extension" id="571473929">
- <message_arguments>
- <message_argument value="CheckboxTreeViewer"/>
- <message_argument value="BreakpointsViewer"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java" type="org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction">
- <filter comment="Known leaked internal types" id="576725006">
- <message_arguments>
- <message_argument value="ILaunchHistoryChangedListener"/>
- <message_argument value="AbstractLaunchHistoryAction"/>
- </message_arguments>
- </filter>
- <filter comment="Known leaked internal types" id="643842064">
- <message_arguments>
- <message_argument value="LaunchHistory"/>
- <message_argument value="AbstractLaunchHistoryAction"/>
- <message_argument value="getLaunchHistory()"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.debug.ui" version="2">
+ <resource path="ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java" type="org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationViewer">
+ <filter comment="Known illegal extension" id="571473929">
+ <message_arguments>
+ <message_argument value="TreeViewer"/>
+ <message_argument value="LaunchConfigurationViewer"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java" type="org.eclipse.debug.internal.ui.preferences.LaunchPerspectivePreferencePage$PerspectivesTreeViewer">
+ <filter comment="Known illegal extension" id="571473929">
+ <message_arguments>
+ <message_argument value="TreeViewer"/>
+ <message_argument value="PerspectivesTreeViewer"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java" type="org.eclipse.debug.internal.ui.sourcelookup.SourceContainerViewer">
+ <filter comment="Known illegal extension" id="571473929">
+ <message_arguments>
+ <message_argument value="TreeViewer"/>
+ <message_argument value="SourceContainerViewer"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java" type="org.eclipse.debug.internal.ui.sourcelookup.browsers.ProjectSourceContainerDialog">
+ <filter comment="Known illegal extension" id="571473929">
+ <message_arguments>
+ <message_argument value="ListSelectionDialog"/>
+ <message_argument value="ProjectSourceContainerDialog"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java" type="org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer">
+ <filter comment="Known illegal extension for the async viewer support" id="571473929">
+ <message_arguments>
+ <message_argument value="TreeViewer"/>
+ <message_argument value="InternalTreeModelViewer"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java" type="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer">
+ <filter comment="Known illegal extension" id="571473929">
+ <message_arguments>
+ <message_argument value="CheckboxTreeViewer"/>
+ <message_argument value="BreakpointsViewer"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java" type="org.eclipse.debug.ui.ILaunchConfigurationTab">
+ <filter id="404000815">
+ <message_arguments>
+ <message_argument value="org.eclipse.debug.ui.ILaunchConfigurationTab"/>
+ <message_argument value="OkToLeaveTab()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java" type="org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction">
+ <filter comment="Known leaked internal types" id="576725006">
+ <message_arguments>
+ <message_argument value="ILaunchHistoryChangedListener"/>
+ <message_argument value="AbstractLaunchHistoryAction"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Known leaked internal types" id="643842064">
+ <message_arguments>
+ <message_argument value="LaunchHistory"/>
+ <message_argument value="AbstractLaunchHistoryAction"/>
+ <message_argument value="getLaunchHistory()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index dc91023de..d287fec6b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -68,8 +68,11 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbenchPreferenceConstants;
@@ -100,6 +103,11 @@ public class LaunchConfigurationTabGroupViewer {
private ILaunchConfigurationWorkingCopy fWorkingCopy;
/**
+ * The old configuration
+ */
+ private boolean sameInput = false;
+
+ /**
* This view's control, which contains a composite area of controls
*/
private Composite fViewerControl;
@@ -373,15 +381,63 @@ public class LaunchConfigurationTabGroupViewer {
fTabFolder.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
+ int selectedIndex = fTabFolder.indexOf((CTabItem) event.item);
if (!fInitializingTabs) {
- handleTabSelected();
- refresh();
+ handleTabChange(selectedIndex);
}
+
+ Display display = fTabFolder.getDisplay();
+ display.addListener(SWT.PostEvent, new Listener() {
+ @Override
+ public void handleEvent(Event newEvent) {
+ if (newEvent.detail == SWT.Selection) { //
+ display.removeListener(SWT.PostEvent, this);
+ if (sameInput) {
+ displayInstanceTabs(true);
+ fTabFolder.setSelection(selectedIndex);
+ refreshStatus();
+ }
+ if (canChangeTab) {
+ handleTabSelected();
+ refresh();
+ }
+
+ }
+ }
+ });
+
}
});
}
}
+ private boolean canChangeTab = true;
+
+ private void handleTabChange(int newPageIndex) {
+ if (fCurrentTabIndex == newPageIndex) {
+ return;
+ }
+ if (isDirty() && !fInitializingTabs) {
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (fCurrentTabIndex != -1) {
+ ILaunchConfigurationTab tab = tabs[fCurrentTabIndex];
+ fTabFolder.setSelection(fCurrentTabIndex);
+ if (!tab.OkToLeaveTab()) {
+ canChangeTab = false;
+
+ }
+ else {
+ canChangeTab = true;
+ fTabFolder.setSelection(newPageIndex);
+ }
+ }
+ } else {
+ handleTabSelected();
+ refresh();
+ }
+
+ }
+
/**
* Returns the apply button
* @return the 'Apply' button
@@ -611,9 +667,8 @@ public class LaunchConfigurationTabGroupViewer {
}
inputChanged(input);
} else {
- if (!input.equals(getConfiguration())) {
- inputChanged(input);
- }
+ // Input needs to be changed even if same for Tab initializations
+ inputChanged(input);
}
}
@@ -631,10 +686,17 @@ public class LaunchConfigurationTabGroupViewer {
fViewform.setRedraw(false);
if (finput instanceof ILaunchConfiguration) {
ILaunchConfiguration configuration = (ILaunchConfiguration)finput;
- boolean refreshtabs = !delegatesEqual(fWorkingCopy, configuration);
+ boolean refreshTabs = true;
+ if (fWorkingCopy != null && fWorkingCopy.getOriginal().equals(configuration.getWorkingCopy().getOriginal())) {
+ sameInput = true;
+ refreshTabs = false;
+ } else {
+ sameInput = false;
+ }
fOriginal = configuration;
fWorkingCopy = configuration.getWorkingCopy();
- displayInstanceTabs(refreshtabs);
+ // Need to refresh all the time as tabs might have changed
+ displayInstanceTabs(refreshTabs);
} else if (finput instanceof ILaunchConfigurationType) {
fDescription = getDescription((ILaunchConfigurationType)finput);
setNoInput();
@@ -1383,13 +1445,20 @@ public class LaunchConfigurationTabGroupViewer {
*
* @return the saved launch configuration or <code>null</code> if not saved
*/
- protected ILaunchConfiguration handleApplyPressed() {
+ public ILaunchConfiguration handleApplyPressed() {
if(fOriginal != null && fOriginal.isReadOnly()) {
IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {fOriginal.getFile()}, fViewerControl.getShell());
if(!status.isOK()) {
return null;
}
}
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (fCurrentTabIndex != -1) {
+ ILaunchConfigurationTab tab = tabs[fCurrentTabIndex];
+ if (!tab.OkToLeaveTab()) {
+ return null;
+ }
+ }
Exception exception = null;
final ILaunchConfiguration[] saved = new ILaunchConfiguration[1];
try {
@@ -1484,10 +1553,12 @@ public class LaunchConfigurationTabGroupViewer {
* @param index the index of the tab to display
*/
public void setActiveTab(int index) {
- ILaunchConfigurationTab[] tabs = getTabs();
- if (index >= 0 && index < tabs.length) {
- fTabFolder.setSelection(index);
- handleTabSelected();
+ if (!fTabFolder.isDisposed()) {
+ ILaunchConfigurationTab[] tabs = getTabs();
+ if (index >= 0 && index < tabs.length) {
+ fTabFolder.setSelection(index);
+ handleTabSelected();
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index 969382d89..5c6d458fb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -931,7 +931,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
*
* @return LaunchConfigurationTabGroupViewer
*/
- protected LaunchConfigurationTabGroupViewer getTabViewer() {
+ public LaunchConfigurationTabGroupViewer getTabViewer() {
return fTabViewer;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
index 3a8551d88..fb2ccc2c5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 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
@@ -235,5 +235,15 @@ public interface ILaunchConfigurationTab {
* @since 3.0
*/
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy);
+
+ /**
+ * Checks if it is OK to leave the Tab.
+ *
+ * @return <code>true</code> if OK to leave the tab or <code>false</code>
+ * @since 3.12
+ */
+ public default boolean OkToLeaveTab() {
+ return true;
+ }
}

Back to the top