I am developing an Eclipse Plugin for working with Java source files.
When the user has his caret inside a method I would like to prompt the user for the parameters for that method. I know the types of the parameters, I just can’t figure out how best to ask for the users input here.
An example method:
public void Test(int[] numbers) {
for (int number : numbers) {
System.out.println(number);
}
}
In that example I would like to prompt the user for the int array and create it based on the input.
I hope I am asking the question clearly enough, otherwise feel free to comment on it.
You can provide a contribution to org.eclipse.jdt.ui.javaCompletionProposalComputer. This would allow your proposals to participate in content assist in the java editor. You can see examples of other contributions in the
Preferences>Java>Editor>Content Assist>Advancedpreference page. You can see an example implementation SWTTemplateCompletionProposalComputer.Another possibility is to apply templates. See the Templates view. User input is managed by those little green squares once the templates is inserted. There is some crossover between content assist and providing templates.