Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java77
1 files changed, 49 insertions, 28 deletions
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 {

Back to the top