|Genric Automation Tool [message #224459]
||Mon, 16 October 2006 14:06
Originally posted by: kanthi.swaroop.gmail.com|
Just putting some thoughts I had this weekend. May be too early.
My Goal: Have a action capture and replay provision
What I know:
If I have correctly understood, The "tool" is responisible for creating
requests, which are passed to editors. These editors inturn return a
command to the tool. Which is executed on a command stack.
What I opted to do:
All I have to do is create a new "Generic tool", which take(wrap) other
tools/palette entries. Interpret the requests and Commands that are
generated by these tools for various user-actions, persist them, and later
recreate them to create an "illusion" of user actions. Then go out in
evenings and play football
What are the issues:
I am unable to delegate the requests to the "tools" in question, as their
APIs (visibility) are/is restricted. The "protected" provision, prevents
me from dynamically composing a "Generic tool". AbstractTool class also
has a certain
"void placeMouseInViewer(Point p)", (very tempting and invisible with
java's "default" visibility).
I havent' checked if GEF source makes a "instanceof" check (sounds bad) to
distinguish the tools. This will definitely prevent me from going ahead
with my implemention.
I therefore ask the design team to consider the chances of opening the API
for us, anxious GEF denizens. I can understand the reason for having
protected specifier, but still...
Generic tool is not a silver bullet solution for automation. Most GEF UI's
comprise an equivalent SWT component. But why not have a go with GEF
Under which category should i group my "Generic tool"? Abstract Tool?
definitely, TargetingTool was my first choice; but what about piggy
backing wide variety of other tools. Can we have some sort of "Adapter"
Please give me some pointers, else no football :-(
some methods which should be definitely opened to others include
protected Request createTargetRequest();
protected Command getCommand();
protected EditPart getTargetEditPart();
protected Request getTargetRequest();
protected void setTargetEditPart(EditPart editpart);
protected void setTargetRequest(Request req);
protected void executeCommand(Command command);
protected void executeCurrentCommand();
Why? I feel that these are good candidates for reuse.
void placeMouseInViewer(Point p)and activate(), deactivate() (ideal place
to hook unhook listeners as per the need).
viewerEntered() and viewerExited() are already public and can be used for
detecting loss of focus
Thanks for reading this long mail, and please give your suggestions.
Powered by FUDForum
. Page generated in 0.01555 seconds