Project: JDT
Bug 200801 [templates] Allow 'var' resolver to resolve to set of types
Reported: 2007-08-22 07:15:52 | Status: resolved fixed

I20070821-0800 The template variable 'var' does only allow to have one parameter. 'var' resolves to all fields and variables of type specified in parameter. The request is to allow to specify a set of types as parameters. 'var' then resolves to all fields and variables of any type specified in parameters. Reason: TreeItem has overloaded constructors: public TreeItem(Tree, int); public TreeItem(TreeItem, int); Tree and TreeItem share only Object and Widget as common ancestor (what a shame). I want to write a 'New TreeItem' pattern as: new TreeItem(${parent:var(Tree, TreeItem)}, SWT.NONE); At the moment I have to write either: new TreeItem(${parent:var(Widget)}, SWT.NONE); or new TreeItem(${parent}, SWT.NONE); or provide two patterns

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/AbstractVariableResolver.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/FieldResolver.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/LocalVarResolver.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/VarResolver.java