|
Re: custom JSdoc: indexable Object [message #629944 is a reply to message #552966] |
Thu, 30 September 2010 05:19 |
|
On 8/15/2010 7:25 AM, cgoetz@gmx.de wrote:
> Hello there,
> I'm trying to make a custom library for Adobe Illustrator.
> here is a short sample test-lib:
>
> /** * app
> */
> var app = new Application();
> /**
> * Illustrator
> */
> function Application(){}
> Application.prototype = new Object();
> Application.prototype.activeDocument = new Document();
> /**
> * Doc
> */
> function Document(){}
> Document.prototype = new Object();
> Document.prototype.pathItems = new PathItems();
> /**
> * collection of path's
> * indexable object
> */
> function PathItems(){} //?????
> PathItems.prototype = new Object(); //???????;
> PathItems.prototype.add= function(){return new PathItem()};
> /**
> * pageitem: paths,bitmaps etc.
> */
> function PageItem(){}
> PageItem.prototype = new Object();
> PageItem.prototype.width = 1 ;
> /**
> * single path
> */
> function PathItem(){}
> PathItem.prototype = new PageItem();
> PathItem.prototype.area = 1 ;
>
>
> this is a short script:
>
> var ad = app.activeDocument;
> var pfade = ad.pathItems;
> var pfad1 = pfade.add();
> pfad1.area = true; // type mismatch as expected
> var breite = pfad1.width ; //inherited as expected
> pfad1.width = "ten"; // type mismatch as expected
>
> var fail = pfade[0]. // no default proposals ;
>
>
>
> I'm sorry if this is a common question, but i can't find any samples for
> that.
> How can i make PathItems a indexable Object with content PathItem in the
> JSdoc?
> everything works fine except the last line.
> thanks for your time
> Chris
If I understand your source properly, the array-style reference is
confusing the editor, but I'm not sure where PathItem is made the
content of PathItems, unless you meant the @memberof tag:
http://code.google.com/p/jsdoc-toolkit/wiki/TagMemberOf
--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.23642 seconds