This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Expansion for method , file and class variables does not work for java files | ||
---|---|---|---|
Product: | usersguide | Reporter: | Karthikeyan Rajeswaran <krajeswaran> |
Component: | Code | Assignee: | AlyonaStashkova |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | hmichel, johnjullion, kganfield, markiewb, misterm |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | Sun | ||
OS: | All | ||
URL: | http://www.netbeans.org/servlets/BrowseList?list=nbusers&by=thread&from=824455 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Karthikeyan Rajeswaran
2007-12-21 18:04:57 UTC
Same behaviour also happens with ${file} , ${class} , $path} , ${methodfqn} and ${classfqn} variables. I believe these work with Ruby, but they should work in the Java editor as well. *** Issue 75929 has been marked as a duplicate of this issue. *** The problem here is misleading documentation of the code template syntax that describes the syntax more or less Ruby only specific. Mentioned reserved parameter names (method, class, file, etc.) are not valid for Java code templates now (possible future enhancement?). The correct documentation should contain something like: Any code template parameter can be specified by its name and a set of optional hints. Hints serve as a guidance on computing the values assigned by the infrastructure to the parameters on template expansion. Syntax for parameter definition is: ${param_name hint=value hint=value ...} with the exception of boolean hints that can be written without the value part: ${param_name hint} translates to ${param_name hint=true}. Some of the parameter names are reserved by the code template infrastructure: ${cursor} defines a position where the caret will be located after the editing of the code template values finishes. ${selection} defines a position for pasting a content of the editor selection. Used by so called 'selection templates' that appear as hints whenever user selects some text in the editor. Similarly, some of the hint names are reserved by the code template infrastructure: General: ${param_name default="value"} defines the parameter's default value. ${param_name editable=false} can be used to disable user's editing of the parameter. Java specific: ${param_name instanceof="java.util.Collection"} requires the parameter value to be an instance of the given type. ${param_name array} requires the parameter value to be of an array type (including arrays of primitive data types). ${param_name iterable} requires the parameter value to be of an array type or an instance of "java.lang.Iterable". Can be used in 'for-each' cycles. ${param type="java.util.Iterator"} requires the parameter value to be the given type. The infrastructure will try to use short name Iterator and import java.util.Iterator if possible. ${param_name iterableElementType} requires the parameter value to be the type of the iterable element. Can be used in 'for-each' cycles. ${param_name leftSideType} requires the parameter value to be the type of the expression on the assignment's left side. ${param_name rightSideType} requires the parameter value to be the type of the expression on the assignment's right side. ${param_name cast} defines that the parameter value would be a type cast if necessary. ${param_name newVarName} defines that the parameter value should be a 'fresh' unused variable name in the given context. Ruby specific: ... Reassigning. I think it should be implemented to Java too. Dusane, thanks for explanation. Obviously we would like to have all those Ruby specific parameters in Java too, but it might take some time and in the meantime I think we should correct the documentation so that it doesn't give false impression that these parameters work everywhere. Made several changes to this topic based on the comments in this issue, but need to do more work on it. moving opened issues from TM <= 6.1 to TM=Dev switching to usersguide since this is a docs bug alyona, can you take a look at this old issue Java specific code template syntax provided by Dusan Balek is incorporated into the Code Template Syntax help topic by Geertjan Wielenga. Verified on NetBeans IDE 7.3 Beta 2 (Build 201211052012). Closing the issue as resolved fixed since support for Ruby is removed from the standard distribution of the IDE (http://wiki.netbeans.org/NetBeansArchivedFeatures#Ruby). |