Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » palette question
palette question [message #149120] Tue, 31 August 2004 05:28 Go to next message
Eclipse UserFriend
Originally posted by: myoracle.hotmail.com

I have got a palette with a PaletteDrawer which has ten children .
Each child is an object of MyToolEntry which is defined as follows:
class MyToolEntry extends ToolEntry {
public MyToolEntry(
String label,
String shortDesc,
ImageDescriptor iconSmall,
ImageDescriptor iconLarge) {

super(label, shortDesc, iconSmall, iconLarge);

}
public Tool createTool() {
// TODO Auto-generated method stub
return new MyTool();
}
}
and the "MyTool" class is extened from TargetingTool.
All is fine but...where is my action?
I want to make an action which is defined myself(e.g.
System.out.println("welcome");) when i press a MyToolEntry object in the
palette,but nothing happend,and it seems that the method
"mouseDown(MouseEvent e, EditPartViewer viewer)" defined in TargetingTool
does not work.
How and where could i make my action?
Re: palette question [message #149775 is a reply to message #149120] Thu, 02 September 2004 19:21 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
When you click on your tool in the palette, the edit domain unloads the
current tool and loads the selected tool. Then, when you go over to the
editor and click somewhere, that's when your tool's mouseDown() will be
invoked.

If you want your tool to perform some action when clicked, instead of
allowing the user to create something on the diagram interactively, you
could probably do it in the activate() method. You don't need a
TargetingTool for that either.

"spool" <myoracle@hotmail.com> wrote in message
news:ch12ae$o32$1@eclipse.org...
> I have got a palette with a PaletteDrawer which has ten children .
> Each child is an object of MyToolEntry which is defined as follows:
> class MyToolEntry extends ToolEntry {
> public MyToolEntry(
> String label,
> String shortDesc,
> ImageDescriptor iconSmall,
> ImageDescriptor iconLarge) {
>
> super(label, shortDesc, iconSmall, iconLarge);
>
> }
> public Tool createTool() {
> // TODO Auto-generated method stub
> return new MyTool();
> }
> }
> and the "MyTool" class is extened from TargetingTool.
> All is fine but...where is my action?
> I want to make an action which is defined myself(e.g.
> System.out.println("welcome");) when i press a MyToolEntry object in the
> palette,but nothing happend,and it seems that the method
> "mouseDown(MouseEvent e, EditPartViewer viewer)" defined in TargetingTool
> does not work.
> How and where could i make my action?
>
>
Previous Topic:paint optimization
Next Topic:configuring palette views
Goto Forum:
  


Current Time: Mon Jan 13 15:03:26 GMT 2025

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

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

Back to the top