Custom Action Documentation

0 views
Skip to first unread message

amro

unread,
Feb 12, 2008, 12:22:01 PM2/12/08
to Appcelerator Platform SDK
I think the widgets should self-document actions like they self-
document attributes..

getActions: function()
{
return ['openAll','closeAll', 'selectItem','open','close'];
},

..so the doc tool could document actions as well.

Mark Luffel

unread,
Feb 12, 2008, 2:05:22 PM2/12/08
to Appcelerator Platform SDK
Yeah, actions should have more documentation.

How about something like:

getActions: function() {
return [
{
name: 'openAll',
description: 'Open all the subfolders of the ....',
},
{
name: 'selectItem',
description: 'Select an item, creates a visual change and
triggers the openaction',
arguments: [{name: 'itemId', type:
Appcelerator.Types.identifier}]
}
/* ... other actions */
];
}

Is that overkill?
What other info would a widget writer want to provide?

A person might also have a look at the "getChildNodes" abomination
that I started (in app:http, app:if, app:folder, app:statemachine). It
would obviously be nice to know what sort of subtags a widget expects,
but I'd rather not reinvent a broken version of xml schema. If the
app:folder widget was extended to allow nested folders to any depth,
my getChildNodes wouldn't be able to express that anymore, and we'd
have to add another hack to handle it.

--Mark

amro

unread,
Feb 12, 2008, 3:57:50 PM2/12/08
to Appcelerator Platform SDK
I'm not sure what the correct answer to the nesting issue is but I
think the name, description syntax is fine.
Reply all
Reply to author
Forward
0 new messages