mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 18:25:40 +02:00
Bug #175660: Build configuration toolbar button should do something
This commit is contained in:
parent
975547bcca
commit
d9c7b670d1
6 changed files with 130 additions and 121 deletions
|
@ -159,7 +159,8 @@ BuildConfigActionSet.label=Build Configuration
|
||||||
BuildConfigToolbarAction.label=Active Build Configuration
|
BuildConfigToolbarAction.label=Active Build Configuration
|
||||||
BuildConfigMenuAction.label=Active Buil&d Configuration
|
BuildConfigMenuAction.label=Active Buil&d Configuration
|
||||||
BuildConfigContextAction.label=Active Bui&ld 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
|
ManageConfigAction.label=Manage configurations
|
||||||
DeleteRcConfigAction.label=Delete resource configs...
|
DeleteRcConfigAction.label=Delete resource configs...
|
||||||
|
|
|
@ -889,6 +889,97 @@
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.actionSets">
|
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
|
<actionSet
|
||||||
label="%CElementCreationActionSet.label"
|
label="%CElementCreationActionSet.label"
|
||||||
description="%CElementCreationActionSet.description"
|
description="%CElementCreationActionSet.description"
|
||||||
|
@ -1255,109 +1346,6 @@
|
||||||
showScopeSection="true"
|
showScopeSection="true"
|
||||||
sizeHint="460, 160"/>
|
sizeHint="460, 160"/>
|
||||||
</extension>
|
</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
|
<extension
|
||||||
point="org.eclipse.ui.actionSetPartAssociations">
|
point="org.eclipse.ui.actionSetPartAssociations">
|
||||||
|
|
|
@ -113,3 +113,6 @@ IncludesGroupingAction.description=Group includes statements
|
||||||
COutlineInformationControl.viewMenu.remember.label=Remember size and position
|
COutlineInformationControl.viewMenu.remember.label=Remember size and position
|
||||||
COutlineInformationControl.viewMenu.move.label=Move outline
|
COutlineInformationControl.viewMenu.move.label=Move outline
|
||||||
COutlineInformationControl.viewMenu.sort.label=Sort
|
COutlineInformationControl.viewMenu.sort.label=Sort
|
||||||
|
|
||||||
|
ChangeBuildConfigMenuAction.title=Sorry
|
||||||
|
ChangeBuildConfigMenuAction.text=Only one project should be selected to manage configurations.
|
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.actions;
|
package org.eclipse.cdt.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
import org.eclipse.jface.dialogs.MessageDialog;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.swt.events.MenuAdapter;
|
import org.eclipse.swt.events.MenuAdapter;
|
||||||
import org.eclipse.swt.events.MenuEvent;
|
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.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
|
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
|
* 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)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run(IAction action) {
|
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$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,14 +14,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
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.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -40,7 +32,16 @@ import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
|
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
|
||||||
import org.eclipse.ui.dialogs.ListSelectionDialog;
|
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
|
* 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++) {
|
for (int i = 0; i < selected.length; i++) {
|
||||||
((ResCfgData)selected[i]).delete();
|
((ResCfgData)selected[i]).delete();
|
||||||
}
|
}
|
||||||
WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
|
AbstractPage.updateViews();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,8 +407,7 @@ implements
|
||||||
try {
|
try {
|
||||||
CoreModel.getDefault().setProjectDescription(getProject(), prjd);
|
CoreModel.getDefault().setProjectDescription(getProject(), prjd);
|
||||||
} catch (CoreException e) { }
|
} catch (CoreException e) { }
|
||||||
// update views (in particular, display resource configurations)
|
updateViews();
|
||||||
WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,8 +430,7 @@ implements
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
System.out.println("setProjectDescription: " + e.getLocalizedMessage()); //$NON-NLS-1$
|
System.out.println("setProjectDescription: " + e.getLocalizedMessage()); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
// update views (in particular, display resource configurations)
|
updateViews();
|
||||||
WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable);
|
IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable);
|
||||||
|
@ -845,4 +843,8 @@ implements
|
||||||
return true; // Projects and folders are always applicable
|
return true; // Projects and folders are always applicable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update views (in particular, display resource configurations)
|
||||||
|
public static void updateViews() {
|
||||||
|
WorkbenchPlugin.getDefault().getDecoratorManager().updateForEnablementChange();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue