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.
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