Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 200801 - [templates] Allow 'var' resolver to resolve to set of types
Summary: [templates] Allow 'var' resolver to resolve to set of types
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Benno Baumgartner CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-22 07:15 EDT by Benno Baumgartner CLA
Modified: 2007-08-23 11:45 EDT (History)
1 user (show)

See Also:
daniel_megert: documentation+


Attachments
proposed fix (19.95 KB, patch)
2007-08-22 12:43 EDT, Benno Baumgartner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2007-08-22 07:15:52 EDT
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
Comment 1 Benno Baumgartner CLA 2007-08-22 12:43:22 EDT
Created attachment 76669 [details]
proposed fix
Comment 2 Benno Baumgartner CLA 2007-08-23 06:25:43 EDT
fixed > I20070821-0800
Comment 3 Dani Megert CLA 2007-08-23 11:23:02 EDT
Code review still pending.

F1 help update is missing. Please fix.
Comment 4 Dani Megert CLA 2007-08-23 11:45:45 EDT
OK, doc has been updated but not as part of the attached patch. Also, the commit comment doesn't reflect this.

Code is good, especially the introduction of the abstract super class.