mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 01:45:33 +02:00
Cosmetics.
This commit is contained in:
parent
3cf5ec86ee
commit
340b507e38
1 changed files with 10 additions and 13 deletions
|
@ -12,7 +12,6 @@
|
||||||
package org.eclipse.cdt.internal.ui.actions;
|
package org.eclipse.cdt.internal.ui.actions;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.Assert;
|
import org.eclipse.core.runtime.Assert;
|
||||||
|
@ -152,9 +151,10 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
menu.add(NONE_APPLICABLE_ACTION);
|
menu.add(NONE_APPLICABLE_ACTION);
|
||||||
} else {
|
} else {
|
||||||
menu.add(new Separator(TEMPLATE_GROUP));
|
menu.add(new Separator(TEMPLATE_GROUP));
|
||||||
for (int i= 0; i < actions.length; i++)
|
for (int i= 0; i < actions.length; i++) {
|
||||||
menu.add(actions[i]);
|
menu.add(actions[i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
menu.add(new Separator(CONFIG_GROUP));
|
menu.add(new Separator(CONFIG_GROUP));
|
||||||
menu.add(new ConfigureTemplatesAction());
|
menu.add(new ConfigureTemplatesAction());
|
||||||
|
@ -236,7 +236,6 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
|
|
||||||
ActionContributionItem configAction= new ActionContributionItem(new ConfigureTemplatesAction());
|
ActionContributionItem configAction= new ActionContributionItem(new ConfigureTemplatesAction());
|
||||||
configAction.fill(menu, -1);
|
configAction.fill(menu, -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initMenu() {
|
protected void initMenu() {
|
||||||
|
@ -262,7 +261,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
|
|
||||||
private static IAction[] getTemplateActions(CEditor editor) {
|
private static IAction[] getTemplateActions(CEditor editor) {
|
||||||
ITextSelection textSelection= getTextSelection(editor);
|
ITextSelection textSelection= getTextSelection(editor);
|
||||||
if (textSelection == null || textSelection.getLength() == 0)
|
if (textSelection == null || textSelection.isEmpty())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
ITranslationUnit tu= CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editor.getEditorInput());
|
ITranslationUnit tu= CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(editor.getEditorInput());
|
||||||
|
@ -295,13 +294,11 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
return (ITextSelection)selection;
|
return (ITextSelection)selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IAction[] getActionsFromProposals(List<ICompletionProposal> proposals, final int offset,
|
private static IAction[] getActionsFromProposals(List<ICompletionProposal> proposals,
|
||||||
final ITextViewer viewer) {
|
final int offset, final ITextViewer viewer) {
|
||||||
List<Action> result= new ArrayList<>();
|
List<Action> result= new ArrayList<>();
|
||||||
int j = 1;
|
int j = 1;
|
||||||
for (Iterator<ICompletionProposal> it= proposals.iterator(); it.hasNext();) {
|
for (final ICompletionProposal proposal : proposals) {
|
||||||
final ICompletionProposal proposal= it.next();
|
|
||||||
|
|
||||||
StringBuilder actionName= new StringBuilder();
|
StringBuilder actionName= new StringBuilder();
|
||||||
if (j < 10) {
|
if (j < 10) {
|
||||||
actionName.append('&').append(j).append(' ');
|
actionName.append('&').append(j).append(' ');
|
||||||
|
|
Loading…
Add table
Reference in a new issue