diff options
author | Darin Wright | 2002-11-21 22:18:42 +0000 |
---|---|---|
committer | Darin Wright | 2002-11-21 22:18:42 +0000 |
commit | d11c021f3386ad72042661b78c8a61250d8b2424 (patch) | |
tree | cf492dc72cce7134b5acd9231ffbefc26d1b286d /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java | |
parent | 446694a690b46079789b7c95b60d96f4ce1786ff (diff) | |
download | eclipse.platform.debug-d11c021f3386ad72042661b78c8a61250d8b2424.tar.gz eclipse.platform.debug-d11c021f3386ad72042661b78c8a61250d8b2424.tar.xz eclipse.platform.debug-d11c021f3386ad72042661b78c8a61250d8b2424.zip |
bug 19764
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.java | 41 |
1 files changed, 21 insertions, 20 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 72acab94b..22bd6c6d1 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 @@ -369,16 +369,12 @@ public class LaunchConfigurationTabGroupViewer extends Viewer { * @see org.eclipse.jface.viewers.Viewer#refresh() */ public void refresh() { - if (!isInitializingTabs()) { - updateWorkingCopyFromPages(); - boolean dirty = isDirty(); - getApplyButton().setEnabled(dirty && canSave()); - getRevertButton().setEnabled(dirty); + ILaunchConfigurationTab[] tabs = getTabs(); + if (!isInitializingTabs() && tabs != null) { + // update the working copy from the active tab + getActiveTab().performApply(getWorkingCopy()); + updateButtons(); // update error ticks - ILaunchConfigurationTab[] tabs = getTabs(); - if (tabs == null) { - return; - } TabFolder folder = getTabFolder(); for (int i = 0; i < tabs.length; i++) { ILaunchConfigurationTab tab = tabs[i]; @@ -388,6 +384,12 @@ public class LaunchConfigurationTabGroupViewer extends Viewer { } } } + + private void updateButtons() { + boolean dirty = isDirty(); + getApplyButton().setEnabled(dirty && canSave()); + getRevertButton().setEnabled(dirty); + } /** * Set the specified tab item's icon to an error icon if <code>error</code> is true, @@ -970,6 +972,7 @@ public class LaunchConfigurationTabGroupViewer extends Viewer { * Notification the name field has been modified */ protected void handleNameModified() { + getWorkingCopy().rename(getNameWidget().getText().trim()); refreshStatus(); } @@ -982,13 +985,21 @@ public class LaunchConfigurationTabGroupViewer extends Viewer { Text widget = getNameWidget(); String name = widget.getText(); String trimmed = name.trim(); + + // update launch config + setInitializingTabs(true); if (!name.equals(trimmed)) { widget.setText(trimmed); } + getWorkingCopy().rename(trimmed); + getTabGroup().performApply(getWorkingCopy()); + setInitializingTabs(false); + // + if (isDirty()) { getWorkingCopy().doSave(); - refresh(); } + updateButtons(); } catch (CoreException e) { DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Configuration_Error_46"), LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Exception_occurred_while_saving_launch_configuration_47"), e); //$NON-NLS-1$ //$NON-NLS-2$ return; @@ -1003,16 +1014,6 @@ public class LaunchConfigurationTabGroupViewer extends Viewer { } /** - * Iterate over the pages to update the working copy - */ - private void updateWorkingCopyFromPages() { - ILaunchConfigurationWorkingCopy workingCopy = getWorkingCopy(); - if (getTabGroup() != null) { - getTabGroup().performApply(workingCopy); - } - } - - /** * Show an error dialog on the given exception. * * @param exception |