Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2007-02-27 12:39:15 +0000
committerOleg Krasilnikov2007-02-27 12:39:15 +0000
commitd9c7b670d1d8ad05e4e5df091fa217750565d495 (patch)
treeca3f404840c1609dd63bb12d66843e08bda06492
parent975547bcca5fd29c67942e501ec2634d5799331d (diff)
downloadorg.eclipse.cdt-d9c7b670d1d8ad05e4e5df091fa217750565d495.tar.gz
org.eclipse.cdt-d9c7b670d1d8ad05e4e5df091fa217750565d495.tar.xz
org.eclipse.cdt-d9c7b670d1d8ad05e4e5df091fa217750565d495.zip
Bug #175660: Build configuration toolbar button should do something
-rw-r--r--core/org.eclipse.cdt.ui/plugin.properties3
-rw-r--r--core/org.eclipse.cdt.ui/plugin.xml194
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigMenuAction.java16
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java21
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java14
6 files changed, 130 insertions, 121 deletions
diff --git a/core/org.eclipse.cdt.ui/plugin.properties b/core/org.eclipse.cdt.ui/plugin.properties
index 17b646055b7..70269ae4c6c 100644
--- a/core/org.eclipse.cdt.ui/plugin.properties
+++ b/core/org.eclipse.cdt.ui/plugin.properties
@@ -159,7 +159,8 @@ BuildConfigActionSet.label=Build Configuration
BuildConfigToolbarAction.label=Active Build Configuration
BuildConfigMenuAction.label=Active Buil&d Configuration
BuildConfigContextAction.label=Active Bui&ld Configuration
-BuildConfigAction.tooltip=Change active build configuration for the current project
+BuildConfigAction.tooltip=Change active build configuration for project(s)
+BuildConfigAction.tooltip2=Manage configurations for the current project
ManageConfigAction.label=Manage configurations
DeleteRcConfigAction.label=Delete resource configs...
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index ab377bd0748..3ed26cfeb54 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -889,6 +889,97 @@
</extension>
<extension
point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="%CSearchActionSet.label"
+ description="%CSearchActionSet.description"
+ visible="false"
+ id="org.eclipse.cdt.ui.SearchActionSet">
+ <action
+ label="%openCSearchPageAction.label"
+ icon="icons/obj16/csearch_obj.gif"
+ class="org.eclipse.cdt.internal.ui.search.OpenCSearchPageAction"
+ menubarPath="org.eclipse.search.menu/dialogGroup"
+ id="org.eclipse.cdt.ui.actions.OpenCSearchPage">
+ </action>
+ <action
+ id="org.eclipse.cdt.ui.actions.OpenType"
+ toolbarPath="org.eclipse.search.searchActionSet/Search"
+ class="org.eclipse.cdt.internal.ui.browser.opentype.OpenTypeAction"
+ definitionId="org.eclipse.cdt.ui.navigate.opentype"
+ icon="icons/etool16/opentype.gif"
+ helpContextId="org.eclipse.cdt.ui.open_type_action"
+ label="%OpenTypeAction.label"
+ menubarPath="navigate/open.ext2"
+ tooltip="%OpenTypeAction.tooltip">
+ </action>
+ <action
+ definitionId="org.eclipse.cdt.ui.edit.open.call.hierarchy"
+ id="org.eclipse.cdt.ui.actions.OpenCallHierarchy"
+ label="%OpenCallHierarchy.label"
+ menubarPath="navigate/open.ext"
+ retarget="true"
+ tooltip="%OpenCallHierarchy.tooltip">
+ </action>
+ <action
+ definitionId="org.eclipse.cdt.ui.edit.open.type.hierarchy"
+ label="%OpenTypeHierarchyAction.label"
+ retarget="true"
+ menubarPath="navigate/open.ext"
+ id="org.eclipse.cdt.ui.actions.OpenTypeHierarchy">
+ </action>
+ <!--action
+ id="org.eclipse.cdt.ui.actions.openTypeInHierarchy"
+ class="org.eclipse.cdt.internal.ui.browser.typehierarchy.OpenTypeInHierarchyAction"
+ definitionId="org.eclipse.cdt.ui.navigate.open.type.in.hierarchy"
+ label="%OpenTypeInHierarchyAction.label"
+ helpContextId="org.eclipse.cdt.ui.open_type_in_hierarchy_action"
+ menubarPath="navigate/open.ext2"
+ tooltip="%OpenTypeInHierarchyAction.tooltip">
+ </action-->
+ <menu
+ label="%searchMenu.label"
+ id="org.eclipse.search.menu">
+ </menu>
+ </actionSet>
+ <actionSet
+ description="%BuildConfigurationActionSet.descr"
+ id="org.eclipse.cdt.ui.buildConfigActionSet"
+ label="%BuildConfigActionSet.label"
+ visible="false">
+ <action
+ class="org.eclipse.cdt.ui.actions.ChangeBuildConfigMenuAction"
+ disabledIcon="icons/dlcl16/config-tool.gif"
+ enablesFor="+"
+ icon="icons/elcl16/config-tool.gif"
+ id="org.eclipse.cdt.ui.buildConfigToolbarAction"
+ label="%BuildConfigToolbarAction.label"
+ style="pulldown"
+ toolbarPath="buildConfig"
+ tooltip="%BuildConfigAction.tooltip2"/>
+ <action
+ class="org.eclipse.cdt.ui.actions.ChangeBuildConfigMenuAction"
+ enablesFor="+"
+ id="org.eclipse.cdt.ui.buildConfigMenuAction"
+ label="%BuildConfigMenuAction.label"
+ menubarPath="project/build"
+ style="pulldown"
+ tooltip="%BuildConfigAction.tooltip"/>
+
+ <action
+ class="org.eclipse.cdt.ui.actions.ManageConfigsAction"
+ enablesFor="+"
+ id="org.eclipse.cdt.ui.manageConfigsAction2"
+ label="%ManageConfigAction.label"
+ menubarPath="project/build"
+ />
+ <action
+ class="org.eclipse.cdt.ui.actions.DeleteResConfigsAction"
+ enablesFor="+"
+ id="org.eclipse.cdt.ui.deleteConfigsAction2"
+ label="%DeleteRcConfigAction.label"
+ menubarPath="project/build"
+ />
+ </actionSet>
<actionSet
label="%CElementCreationActionSet.label"
description="%CElementCreationActionSet.description"
@@ -1255,110 +1346,7 @@
showScopeSection="true"
sizeHint="460, 160"/>
</extension>
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="%CSearchActionSet.label"
- description="%CSearchActionSet.description"
- visible="false"
- id="org.eclipse.cdt.ui.SearchActionSet">
- <action
- label="%openCSearchPageAction.label"
- icon="icons/obj16/csearch_obj.gif"
- class="org.eclipse.cdt.internal.ui.search.OpenCSearchPageAction"
- menubarPath="org.eclipse.search.menu/dialogGroup"
- id="org.eclipse.cdt.ui.actions.OpenCSearchPage">
- </action>
- <action
- id="org.eclipse.cdt.ui.actions.OpenType"
- toolbarPath="org.eclipse.search.searchActionSet/Search"
- class="org.eclipse.cdt.internal.ui.browser.opentype.OpenTypeAction"
- definitionId="org.eclipse.cdt.ui.navigate.opentype"
- icon="icons/etool16/opentype.gif"
- helpContextId="org.eclipse.cdt.ui.open_type_action"
- label="%OpenTypeAction.label"
- menubarPath="navigate/open.ext2"
- tooltip="%OpenTypeAction.tooltip">
- </action>
- <action
- definitionId="org.eclipse.cdt.ui.edit.open.call.hierarchy"
- id="org.eclipse.cdt.ui.actions.OpenCallHierarchy"
- label="%OpenCallHierarchy.label"
- menubarPath="navigate/open.ext"
- retarget="true"
- tooltip="%OpenCallHierarchy.tooltip">
- </action>
- <action
- definitionId="org.eclipse.cdt.ui.edit.open.type.hierarchy"
- label="%OpenTypeHierarchyAction.label"
- retarget="true"
- menubarPath="navigate/open.ext"
- id="org.eclipse.cdt.ui.actions.OpenTypeHierarchy">
- </action>
- <!--action
- id="org.eclipse.cdt.ui.actions.openTypeInHierarchy"
- class="org.eclipse.cdt.internal.ui.browser.typehierarchy.OpenTypeInHierarchyAction"
- definitionId="org.eclipse.cdt.ui.navigate.open.type.in.hierarchy"
- label="%OpenTypeInHierarchyAction.label"
- helpContextId="org.eclipse.cdt.ui.open_type_in_hierarchy_action"
- menubarPath="navigate/open.ext2"
- tooltip="%OpenTypeInHierarchyAction.tooltip">
- </action-->
- <menu
- label="%searchMenu.label"
- id="org.eclipse.search.menu">
- </menu>
- </actionSet>
- <actionSet
- description="%BuildConfigurationActionSet.descr"
- id="org.eclipse.cdt.ui.buildConfigActionSet"
- label="%BuildConfigActionSet.label"
- visible="false">
- <action
- class="org.eclipse.cdt.ui.actions.ChangeBuildConfigMenuAction"
- disabledIcon="icons/dlcl16/config-tool.gif"
- enablesFor="+"
- icon="icons/elcl16/config-tool.gif"
- id="org.eclipse.cdt.ui.buildConfigToolbarAction"
- label="%BuildConfigToolbarAction.label"
- style="pulldown"
- toolbarPath="buildConfig"
- tooltip="%BuildConfigAction.tooltip"/>
- <action
- class="org.eclipse.cdt.ui.actions.ChangeBuildConfigMenuAction"
- enablesFor="+"
- id="org.eclipse.cdt.ui.buildConfigMenuAction"
- label="%BuildConfigMenuAction.label"
- menubarPath="project/build"
- style="pulldown"
- tooltip="%BuildConfigAction.tooltip"/>
- <action
- class="org.eclipse.cdt.ui.actions.ManageConfigsAction"
- disabledIcon="icons/dlcl16/action-editconfig.gif"
- enablesFor="+"
- icon="icons/elcl16/action-editconfig.gif"
- id="org.eclipse.cdt.ui.manageConfigsAction1"
- label="%ManageConfigAction.label"
- toolbarPath="buildConfig"
- />
- <action
- class="org.eclipse.cdt.ui.actions.ManageConfigsAction"
- enablesFor="+"
- id="org.eclipse.cdt.ui.manageConfigsAction2"
- label="%ManageConfigAction.label"
- menubarPath="project/build"
- />
- <action
- class="org.eclipse.cdt.ui.actions.DeleteResConfigsAction"
- enablesFor="+"
- id="org.eclipse.cdt.ui.deleteConfigsAction2"
- label="%DeleteRcConfigAction.label"
- menubarPath="project/build"
- />
- </actionSet>
- </extension>
-
<extension
point="org.eclipse.ui.actionSetPartAssociations">
<actionSetPartAssociation
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties
index 35ef4c70c4c..9316e9447cc 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/actions/ActionMessages.properties
@@ -113,3 +113,6 @@ IncludesGroupingAction.description=Group includes statements
COutlineInformationControl.viewMenu.remember.label=Remember size and position
COutlineInformationControl.viewMenu.move.label=Move outline
COutlineInformationControl.viewMenu.sort.label=Sort
+
+ChangeBuildConfigMenuAction.title=Sorry
+ChangeBuildConfigMenuAction.text=Only one project should be selected to manage configurations. \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigMenuAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigMenuAction.java
index 20f4de2e550..93903594ba4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigMenuAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/ChangeBuildConfigMenuAction.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.ui.actions;
+import org.eclipse.core.resources.IProject;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.events.MenuAdapter;
import org.eclipse.swt.events.MenuEvent;
@@ -19,6 +21,11 @@ import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.newui.ManageConfigDialog;
+
+import org.eclipse.cdt.internal.ui.actions.ActionMessages;
+
/**
* Action which changes active build configuration of the current project
*/
@@ -61,7 +68,14 @@ public class ChangeBuildConfigMenuAction extends ChangeBuildConfigActionBase imp
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
public void run(IAction action) {
- // do nothing
+ if (fProjects.size() == 1) {
+ IProject project = (IProject)fProjects.toArray(new IProject[1])[0];
+ ManageConfigDialog.manage(project);
+ } else {
+ MessageDialog.openInformation(CUIPlugin.getActiveWorkbenchShell(),
+ ActionMessages.getString("ChangeBuildConfigMenuAction.title"), //$NON-NLS-1$
+ ActionMessages.getString("ChangeBuildConfigMenuAction.text")); //$NON-NLS-1$
+ }
}
/**
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java
index c4171e753c3..5398741c814 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/actions/DeleteResConfigsAction.java
@@ -14,14 +14,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICContainer;
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICResourceDescription;
-import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -40,7 +32,16 @@ import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.internal.WorkbenchPlugin;
+
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICContainer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.newui.AbstractPage;
/**
* Action which changes active build configuration of the current project to
@@ -114,7 +115,7 @@ implements IWorkbenchWindowPulldownDelegate2, IObjectActionDelegate {
for (int i = 0; i < selected.length; i++) {
((ResCfgData)selected[i]).delete();
}
- WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
+ AbstractPage.updateViews();
}
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java
index 6268651d057..3e4b5fd2c9c 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractPage.java
@@ -406,9 +406,8 @@ implements
doneOK = true; // further pages need not to do anything
try {
CoreModel.getDefault().setProjectDescription(getProject(), prjd);
- } catch (CoreException e) { }
- // update views (in particular, display resource configurations)
- WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
+ } catch (CoreException e) { }
+ updateViews();
return true;
}
@@ -431,8 +430,7 @@ implements
} catch (CoreException e) {
System.out.println("setProjectDescription: " + e.getLocalizedMessage()); //$NON-NLS-1$
}
- // update views (in particular, display resource configurations)
- WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
+ updateViews();
}
};
IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable);
@@ -844,5 +842,9 @@ implements
else
return true; // Projects and folders are always applicable
}
-
+
+ // update views (in particular, display resource configurations)
+ public static void updateViews() {
+ WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
+ }
}

Back to the top