mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 212373 Display up to 5 configs + projects in the build project button tooltip
This commit is contained in:
parent
2bc7bae4a4
commit
f42306ff24
1 changed files with 14 additions and 12 deletions
|
@ -10,8 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.actions;
|
package org.eclipse.cdt.ui.actions;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
@ -122,19 +120,23 @@ public class BuildActiveConfigMenuAction extends ChangeBuildConfigActionBase
|
||||||
* @param action - The build configuration menu to change the tool tip on
|
* @param action - The build configuration menu to change the tool tip on
|
||||||
*/
|
*/
|
||||||
public void updateBuildConfigMenuToolTip(IAction action){
|
public void updateBuildConfigMenuToolTip(IAction action){
|
||||||
String toolTipText = ActionMessages.getString("BuildActiveConfigMenuAction_defaultTooltip"); //$NON-NLS-1$
|
String toolTipText = ""; //$NON-NLS-1$
|
||||||
if (fProjects.size() == 1) {
|
if (fProjects.size() <= 5) {
|
||||||
Iterator<IProject> projIter = fProjects.iterator();
|
StringBuilder sb = new StringBuilder();
|
||||||
IProject prj = projIter.next();
|
for (IProject prj : fProjects) {
|
||||||
if (prj != null){
|
if (prj != null){
|
||||||
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(prj, false);
|
ICProjectDescription prjd = CoreModel.getDefault().getProjectDescription(prj, false);
|
||||||
if (prjd != null) {
|
if (prjd != null) {
|
||||||
toolTipText = ActionMessages.getFormattedString(
|
sb.append(ActionMessages.getFormattedString(
|
||||||
"BuildActiveConfigMenuAction_buildConfigTooltip", //$NON-NLS-1$
|
"BuildActiveConfigMenuAction_buildConfigTooltip", //$NON-NLS-1$
|
||||||
new Object[] { prjd.getActiveConfiguration().getName(), prj.getName() });
|
new Object[] { prjd.getActiveConfiguration().getName(), prj.getName() })).append(System.getProperty("line.separator")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
toolTipText = sb.toString().trim();
|
||||||
}
|
}
|
||||||
|
if (toolTipText.length() == 0)
|
||||||
|
toolTipText = ActionMessages.getString("BuildActiveConfigMenuAction_defaultTooltip"); //$NON-NLS-1$
|
||||||
action.setToolTipText(toolTipText);
|
action.setToolTipText(toolTipText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue