aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2017-09-01 05:54:07 -0400
committerSarika Sinha2017-09-01 05:54:07 -0400
commit54ffa511aed2d6633ff077dd48c8865690e9cc66 (patch)
treeda9f9d3aa74a3bc6e0d7b556fd0a3eac932951cc
parent05dd5ce963c009959ec7be3905321757e3a96b5e (diff)
downloadeclipse.platform.debug-BETA_JAVA9.tar.gz
eclipse.platform.debug-BETA_JAVA9.tar.xz
eclipse.platform.debug-BETA_JAVA9.zip
classpath while launching Change-Id: I5192082c2076f5a39dbb82e29dec3e747d237aa7
-rw-r--r--org.eclipse.debug.ui/.settings/.api_filters6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java8
3 files changed, 63 insertions, 28 deletions
diff --git a/org.eclipse.debug.ui/.settings/.api_filters b/org.eclipse.debug.ui/.settings/.api_filters
index e7430a98a..b6cbd924f 100644
--- a/org.eclipse.debug.ui/.settings/.api_filters
+++ b/org.eclipse.debug.ui/.settings/.api_filters
@@ -55,6 +55,12 @@
<message_argument value="OkToLeaveTab()"/>
</message_arguments>
</filter>
+ <filter id="404000815">
+ <message_arguments>
+ <message_argument value="org.eclipse.debug.ui.ILaunchConfigurationTab"/>
+ <message_argument value="postApply()"/>
+ </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">
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 d287fec6b..2bb34429e 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
@@ -105,7 +105,7 @@ public class LaunchConfigurationTabGroupViewer {
/**
* The old configuration
*/
- private boolean sameInput = false;
+ private boolean fRefreshTabs = false;
/**
* This view's control, which contains a composite area of controls
@@ -324,6 +324,10 @@ public class LaunchConfigurationTabGroupViewer {
@Override
public void widgetSelected(SelectionEvent evt) {
handleApplyPressed();
+ ILaunchConfigurationTab[] tabs = getTabs();
+ for (ILaunchConfigurationTab tab : tabs) {
+ tab.postApply();
+ }
}
});
Dialog.applyDialogFont(parent);
@@ -392,16 +396,11 @@ public class LaunchConfigurationTabGroupViewer {
public void handleEvent(Event newEvent) {
if (newEvent.detail == SWT.Selection) { //
display.removeListener(SWT.PostEvent, this);
- if (sameInput) {
- displayInstanceTabs(true);
+ if (fRefreshTabs) {
+ refreshTabs(true);
fTabFolder.setSelection(selectedIndex);
refreshStatus();
}
- if (canChangeTab) {
- handleTabSelected();
- refresh();
- }
-
}
}
});
@@ -411,8 +410,6 @@ public class LaunchConfigurationTabGroupViewer {
}
}
- private boolean canChangeTab = true;
-
private void handleTabChange(int newPageIndex) {
if (fCurrentTabIndex == newPageIndex) {
return;
@@ -422,13 +419,10 @@ public class LaunchConfigurationTabGroupViewer {
if (fCurrentTabIndex != -1) {
ILaunchConfigurationTab tab = tabs[fCurrentTabIndex];
fTabFolder.setSelection(fCurrentTabIndex);
- if (!tab.OkToLeaveTab()) {
- canChangeTab = false;
-
- }
- else {
- canChangeTab = true;
+ if (tab.OkToLeaveTab()) {
fTabFolder.setSelection(newPageIndex);
+ handleTabSelected();
+ refresh();
}
}
} else {
@@ -667,8 +661,25 @@ public class LaunchConfigurationTabGroupViewer {
}
inputChanged(input);
} else {
- // Input needs to be changed even if same for Tab initializations
- inputChanged(input);
+ if (!input.equals(getConfiguration())) {
+ inputChanged(input);
+ }
+ }
+ }
+ /*
+ * Refresh tabs for same input
+ */
+
+ public void refreshTabs(boolean refresh) {
+ if (DebugUIPlugin.getStandardDisplay().getThread().equals(Thread.currentThread())) {
+ refreshTabs0(refresh);
+ } else {
+ DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ refreshTabs0(refresh);
+ }
+ });
}
}
@@ -677,6 +688,26 @@ public class LaunchConfigurationTabGroupViewer {
*
* @param input the new input, possibly <code>null</code>
*/
+ protected void refreshTabs0(boolean refreshTabs) {
+ final boolean refresh = refreshTabs;
+ Runnable r = new Runnable() {
+ @Override
+ public void run() {
+ fViewform.setRedraw(false);
+ fRefreshTabs = !refresh;
+ displayInstanceTabs(refresh);
+ refreshStatus();
+ fViewform.setRedraw(true);
+ }
+ };
+ BusyIndicator.showWhile(getShell().getDisplay(), r);
+ }
+
+ /**
+ * The input has changed to the given object, possibly <code>null</code>.
+ *
+ * @param input the new input, possibly <code>null</code>
+ */
protected void inputChanged(Object input) {
final Object finput = input;
Runnable r = new Runnable() {
@@ -688,10 +719,7 @@ public class LaunchConfigurationTabGroupViewer {
ILaunchConfiguration configuration = (ILaunchConfiguration)finput;
boolean refreshTabs = true;
if (fWorkingCopy != null && fWorkingCopy.getOriginal().equals(configuration.getWorkingCopy().getOriginal())) {
- sameInput = true;
refreshTabs = false;
- } else {
- sameInput = false;
}
fOriginal = configuration;
fWorkingCopy = configuration.getWorkingCopy();
@@ -1452,13 +1480,6 @@ public class LaunchConfigurationTabGroupViewer {
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 {
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 fb2ccc2c5..158530f36 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
@@ -245,5 +245,13 @@ public interface ILaunchConfigurationTab {
public default boolean OkToLeaveTab() {
return true;
}
+
+ /**
+ * Perform the changes after apply.
+ *
+ * @since 3.12
+ */
+ public default void postApply() {
+ }
}