History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-13145
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Maxim Mossienko
Reporter: Johan Lund
Votes: 5
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Detect Bindows specific declarations

Created: 07 Nov 06 17:17   Updated: 16 Mar 07 17:26
Component/s: Editor. Code Completion, Editor. Intention Actions, Code Analysis. Inspection, Find, Replace, Find Usages, Code Navigation, Project View, JavaScript, Refactoring
Fix Version/s: Selena 6755

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Any

Build: 5,784
Fixed in build: 6,752

Sub-Tasks  All   Open   
 Sub-Task Progress: 

 Description  « Hide
In Bindows getter and setter methods can be declared as normal, e.g.:
_p.getX = function(){return this._x};
_p.setX = function(x){this._x = x};

But we also use this this special method to declare them like this:
ClassName.addProperty("x", Function.READ_WRITE);
This creates a public variable x along with both a getter and a setter in the class.
Currently Intellij doesn't understand these constructs...

There are ways of creating a read-only variable and a write-only variable.
Here follows a declaration of a simple Bindows class that has three member variables:

function ClassName() {
if (_biInPrototype) return;
SuperClass.call(this);
}
_p = _biExtend(ClassName, SuperClass, "ClassName");

ClassName.addProperty("x", Function.READ_WRITE); // translates into both a getter and a setter
ClassName.addProperty("y", Function.READ); // translates into a getter only
ClassName.addProperty("z", Function.WRITE); // translates into a setter only

Please consider upgrading your support for Bindows.



 All   Comments   Work Log   Change History      Sort Order:
Johan Lund - 07 Nov 06 17:36
I forgot to explain exactly what the method names would be:
The following:

ClassName.addProperty("y", Function.READ);

would generate this:

ClassName.prototype.getX = function () {
return this._x
}

Observe the captilization on the method name.
Also observe that the member variable's name is _x which means it is private and should only be accessed through the getter method.
For an indepth description of the differentiation of private/public member variables see this post:
http://www.jetbrains.net/jira/browse/IDEADEV-8283

Best Regards
Johan Lund
Bindows Team


Johan Lund - 28 Nov 06 13:18
Correction:
ClassName.addProperty("x", Function.READ);

Johan Lund - 16 Mar 07 17:26
Fantastic!
On initial testing it seem to work perfectly.
Thanks a lot...