Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Genric Automation Tool
Genric Automation Tool [message #224459] Mon, 16 October 2006 14:06
Eclipse UserFriend
Originally posted by:

Hi all,

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

Uncharted waters:
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...

Definite pitfalls:
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

Final word:
Thanks for reading this long mail, and please give your suggestions.
Previous Topic:rotate Figure & MouseListener
Next Topic:Questions regarding Evaluation (Multiple Pages / PDF Export / Grid Layout )
Goto Forum:

Current Time: Mon Oct 18 23:17:19 GMT 2021

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

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

Back to the top