Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » custom JSdoc: indexable Object
icon5.gif  custom JSdoc: indexable Object [message #552966] Sun, 15 August 2010 11:24 Go to next message
Chris G is currently offline Chris GFriend
Messages: 2
Registered: August 2010
Junior Member
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
Re: custom JSdoc: indexable Object [message #629944 is a reply to message #552966] Thu, 30 September 2010 05:19 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2342
Registered: July 2009
Senior Member
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 WTP, IBM
Previous Topic:[Eclipse Helios, apache2, php5 and xdebug]
Next Topic:JS Library stubs, JSDoc, and libraries
Goto Forum:
  


Current Time: Sun Dec 21 12:12:55 GMT 2014

Powered by FUDForum. Page generated in 0.02207 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software