fix for 22195
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
index e3c462a..f6984a9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
@@ -53,6 +53,8 @@
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
@@ -109,6 +111,11 @@
private TreeViewer fConfigTree;
/**
+ * The label appearing above tree of configs & config types.
+ */
+ private Label fTreeLabel;
+
+ /**
* The workbench context present when this dialog is opened.
*/
private Object fContext;
@@ -964,11 +971,12 @@
layout.marginWidth = 5;
comp.setLayout(layout);
- Label treeLabel = new Label(comp, SWT.NONE);
- treeLabel.setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Con&figurations__1")); //$NON-NLS-1$
+ setTreeLabel(new Label(comp, SWT.NONE));
GridData gd = new GridData();
gd.horizontalSpan = 3;
- treeLabel.setLayoutData(gd);
+ getTreeLabel().setLayoutData(gd);
+ getTreeLabel().setText(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Launch_Con&figurations__1")); //$NON-NLS-1$
+ updateTreeLabelTooltip();
TreeViewer tree = new TreeViewer(comp);
gd = new GridData(GridData.FILL_BOTH);
@@ -999,7 +1007,14 @@
setButtonActionDuplicate(new ButtonActionDuplicate(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Duplicate_1"), null)); //$NON-NLS-1$
- setWorkingSetActionManager(new LaunchConfigurationWorkingSetActionManager(tree, getShell()));
+ IPropertyChangeListener titleUpdater= new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ String property= event.getProperty();
+ if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property))
+ updateTreeLabelTooltip();
+ }
+ };
+ setWorkingSetActionManager(new LaunchConfigurationWorkingSetActionManager(tree, getShell(), titleUpdater));
return comp;
}
@@ -2701,6 +2716,24 @@
}
/**
+ * Set the tooltip of the config tree label based on the current working set in effect.
+ */
+ private void updateTreeLabelTooltip() {
+ LaunchConfigurationWorkingSetActionManager mgr = getWorkingSetActionManager();
+ if (mgr != null) {
+ IWorkingSet workingSet = mgr.getWorkingSet();
+ if (workingSet != null) {
+ String newTooltip = MessageFormat.format(LaunchConfigurationsMessages.getString("LaunchConfigurationDialog.Working_Set__{0}_1"), new String[] {workingSet.getName()} ); //$NON-NLS-1$
+ getTreeLabel().setToolTipText(newTooltip);
+ return;
+ }
+ }
+
+ // No working set, so don't show a tooltip
+ getTreeLabel().setToolTipText(null);
+ }
+
+ /**
* Force the tab to update it's error state and return any error message.
*/
private String checkTabForError(ILaunchConfigurationTab tab) {
@@ -2934,6 +2967,14 @@
return fWorkingSetActionManager;
}
+ private void setTreeLabel(Label treeLabel) {
+ fTreeLabel = treeLabel;
+ }
+
+ private Label getTreeLabel() {
+ return fTreeLabel;
+ }
+
/**
* Extension of <code>Action</code> that manages a <code>Button</code>
* widget. This allows common handling for actions that must appear in
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationWorkingSetActionManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationWorkingSetActionManager.java
index 7c4d328..d50bb04 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationWorkingSetActionManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationWorkingSetActionManager.java
@@ -31,6 +31,10 @@
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
+/**
+ * Manage the enablement of the standard working set actions (Select & Clear) and manage
+ * 'shortcut' actions for recently used working sets.
+ */
public class LaunchConfigurationWorkingSetActionManager {
private static final String TAG_WORKING_SET_NAME= "launchConfigurationWorkingSetName"; //$NON-NLS-1$
@@ -47,14 +51,16 @@
private int fLRUMenuCount;
private IPropertyChangeListener fPropertyChangeListener;
+ private IPropertyChangeListener fTitleUpdater;
private IMenuManager fMenuManager;
private IMenuListener fMenuListener;
- public LaunchConfigurationWorkingSetActionManager(StructuredViewer viewer, Shell shell) {
+ public LaunchConfigurationWorkingSetActionManager(StructuredViewer viewer, Shell shell, IPropertyChangeListener titleUpdater) {
setViewer(viewer);
setShell(shell);
setClearAction(new LaunchConfigurationClearWorkingSetAction(this));
setSelectAction(new LaunchConfigurationSelectWorkingSetAction(this, getShell()));
+ setTitleUpdater(titleUpdater);
addWorkingSetChangeSupport();
}
@@ -86,6 +92,10 @@
if (refreshViewer) {
fViewer.refresh();
}
+ IPropertyChangeListener titleUpdater = getTitleUpdater();
+ if (titleUpdater != null) {
+ titleUpdater.propertyChange(new PropertyChangeEvent(this, IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE, null, workingSet));
+ }
fViewer.getControl().setRedraw(true);
}
}
@@ -204,7 +214,16 @@
fViewer.getControl().setRedraw(false);
fViewer.refresh();
+ IPropertyChangeListener titleUpdater = getTitleUpdater();
+ if (titleUpdater != null) {
+ titleUpdater.propertyChange(new PropertyChangeEvent(this, IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE, null, newWorkingSet));
+ }
fViewer.getControl().setRedraw(true);
+ } else if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property)) {
+ IPropertyChangeListener titleUpdater = getTitleUpdater();
+ if (titleUpdater != null) {
+ titleUpdater.propertyChange(event);
+ }
} else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) {
fViewer.getControl().setRedraw(false);
fViewer.refresh();
@@ -252,5 +271,13 @@
private LaunchConfigurationSelectWorkingSetAction getSelectAction() {
return fSelectWorkingSetAction;
}
+
+ private void setTitleUpdater(IPropertyChangeListener titleUpdater) {
+ fTitleUpdater = titleUpdater;
+ }
+
+ private IPropertyChangeListener getTitleUpdater() {
+ return fTitleUpdater;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index 5782e72..4e08616 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -73,6 +73,7 @@
LaunchConfigurationDialog.Cannot_relaunch_[{1}]_because_it_does_not_support_{2}_mode_2=Cannot relaunch [{0}] because it does not support {1} mode
LaunchConfigurationDialog.Duplicate_1=&Duplicate
LaunchConfigurationDialog.Launch_Con&figurations__1=Launch Con&figurations:
+LaunchConfigurationDialog.Working_Set__{0}_1=Working Set: {0}
LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_does_not_specify_launch_configuration_type_1=Launch configuration tab group extension {0} does not specify launch configuration type
LaunchConfigurationPresentationManager.Launch_configuration_tab_group_extension_{0}_refers_to_non-existant_launch_configuration_type_{1}_2=Launch configuration tab group extension {0} refers to non-existent launch configuration type {1}
@@ -87,10 +88,10 @@
CommonTab.Cannot_save_launch_configuration_in_a_closed_project._1=Cannot save launch configuration in a closed project.
-LaunchConfigurationClearWorkingSetAction.Deselect_working_set_1=Deselect working set
+LaunchConfigurationClearWorkingSetAction.Deselect_working_set_1=Deselect Working Set
LaunchConfigurationClearWorkingSetAction.Remove_the_the_current_working_as_a_filter_for_this_view_2=Remove the the current working as a filter for this view
-LaunchConfigurationSelectWorkingSetAction.Select_working_set_..._1=Select working set ...
+LaunchConfigurationSelectWorkingSetAction.Select_working_set_..._1=Select Working Set ...
LaunchConfigurationSelectWorkingSetAction.Choose_a_working_set_and_set_it_as_the_filter_for_this_viewer_2=Choose a working set and set it as the filter for this viewer
LaunchConfigurationWorkingSetPage.Launch_Configuration_Working_Set_1=Launch Configuration Working Set