Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF 3.0.1 Create Pallete Error
GEF 3.0.1 Create Pallete Error [message #150016] Tue, 07 September 2004 21:17 Go to next message
Eclipse UserFriend
Originally posted by: jsk_lam.hotmail.com

Hi,

I just installed the Cascade drop 3 and try to run the redbook GEF example
NetworkModel ( chapter 5), I got the error of Unable to create part. It
works fine on the GEF 3.0.0 (05-13-2004 build or Cascade 3.0 drop 2 build.)

The problem is in lines are:
CreationToolEntry entry;
entry = new CreationToolEntry("Node", "Create a node", new
ModelCreationFactory(Node.class), null, null);
add(entry); // This line causes the exception !!!!!


The exception is in the org.eclipse.gef.palette.PaletteContainer.java:
add (int index, PaletteEntry enty) {
if (!acceptsType(entry.getType()))
throw new IllegalArgumentException(
"This container can not contain this type of child: " +
entry.getType());
List oldChildren = new ArrayList(getChildren());
...
}

I debug the same code with Cascade I2, the same add() method in I2 didn't
have the acceptsType() test, and it is simply:

add (int index, PaletteEntry enty) {
List oldChildren = new ArrayList(getChildren());
...
}

How to fix and make the code work in I3?

Best Regards,
SL
Re: GEF 3.0.1 Create Pallete Error [message #150036 is a reply to message #150016] Wed, 08 September 2004 03:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

GEF 3.0.0 was released on 06-25-2004. You should have the same behavior on
both 3.0.0 and 3.0.1

The solution is to create either a group or a drawer to contain the entry.

"SL" <jsk_lam@hotmail.com> wrote in message news:chl8hk$jd9$1@eclipse.org...
> Hi,
>
> I just installed the Cascade drop 3 and try to run the redbook GEF example
> NetworkModel ( chapter 5), I got the error of Unable to create part. It
> works fine on the GEF 3.0.0 (05-13-2004 build or Cascade 3.0 drop 2
build.)
>
> The problem is in lines are:
> CreationToolEntry entry;
> entry = new CreationToolEntry("Node", "Create a node", new
> ModelCreationFactory(Node.class), null, null);
> add(entry); // This line causes the exception !!!!!
>
>
> The exception is in the org.eclipse.gef.palette.PaletteContainer.java:
> add (int index, PaletteEntry enty) {
> if (!acceptsType(entry.getType()))
> throw new IllegalArgumentException(
> "This container can not contain this type of child: " +
> entry.getType());
> List oldChildren = new ArrayList(getChildren());
> ...
> }
>
> I debug the same code with Cascade I2, the same add() method in I2 didn't
> have the acceptsType() test, and it is simply:
>
> add (int index, PaletteEntry enty) {
> List oldChildren = new ArrayList(getChildren());
> ...
> }
>
> How to fix and make the code work in I3?
>
> Best Regards,
> SL
>
>
Re: GEF 3.0.1 Create Pallete Error [message #150075 is a reply to message #150036] Wed, 08 September 2004 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jsk_lam.hotmail.com

I actually have 2 version of GEF 3.0.0 and the earlier one works but the
later one has exactly the same behavior as you mentioned. Is there a
simple example on how to create either a group or a drawer for the
pallete? Thanks.
SL

Randy Hudson wrote:

> GEF 3.0.0 was released on 06-25-2004. You should have the same behavior on
> both 3.0.0 and 3.0.1

> The solution is to create either a group or a drawer to contain the entry.

> "SL" <jsk_lam@hotmail.com> wrote in message news:chl8hk$jd9$1@eclipse.org...
> > Hi,
> >
> > I just installed the Cascade drop 3 and try to run the redbook GEF example
> > NetworkModel ( chapter 5), I got the error of Unable to create part. It
> > works fine on the GEF 3.0.0 (05-13-2004 build or Cascade 3.0 drop 2
> build.)
> >
> > The problem is in lines are:
> > CreationToolEntry entry;
> > entry = new CreationToolEntry("Node", "Create a node", new
> > ModelCreationFactory(Node.class), null, null);
> > add(entry); // This line causes the exception !!!!!
> >
> >
> > The exception is in the org.eclipse.gef.palette.PaletteContainer.java:
> > add (int index, PaletteEntry enty) {
> > if (!acceptsType(entry.getType()))
> > throw new IllegalArgumentException(
> > "This container can not contain this type of child: " +
> > entry.getType());
> > List oldChildren = new ArrayList(getChildren());
> > ...
> > }
> >
> > I debug the same code with Cascade I2, the same add() method in I2 didn't
> > have the acceptsType() test, and it is simply:
> >
> > add (int index, PaletteEntry enty) {
> > List oldChildren = new ArrayList(getChildren());
> > ...
> > }
> >
> > How to fix and make the code work in I3?
> >
> > Best Regards,
> > SL
> >
> >
Re: GEF 3.0.1 Create Pallete Error [message #150093 is a reply to message #150075] Wed, 08 September 2004 19:37 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
From my reply to your previous post:

So, to fix this problem, create a group or drawer and put the tools inside
that. Look at LogicPlugin#createPalette() if you are not sure how to do
that.

"SL" <jsk_lam@hotmail.com> wrote in message news:chnd31$uqj$1@eclipse.org...
> I actually have 2 version of GEF 3.0.0 and the earlier one works but the
> later one has exactly the same behavior as you mentioned. Is there a
> simple example on how to create either a group or a drawer for the
> pallete? Thanks.
> SL
>
> Randy Hudson wrote:
>
> > GEF 3.0.0 was released on 06-25-2004. You should have the same behavior
on
> > both 3.0.0 and 3.0.1
>
> > The solution is to create either a group or a drawer to contain the
entry.
>
> > "SL" <jsk_lam@hotmail.com> wrote in message
news:chl8hk$jd9$1@eclipse.org...
> > > Hi,
> > >
> > > I just installed the Cascade drop 3 and try to run the redbook GEF
example
> > > NetworkModel ( chapter 5), I got the error of Unable to create part.
It
> > > works fine on the GEF 3.0.0 (05-13-2004 build or Cascade 3.0 drop 2
> > build.)
> > >
> > > The problem is in lines are:
> > > CreationToolEntry entry;
> > > entry = new CreationToolEntry("Node", "Create a node", new
> > > ModelCreationFactory(Node.class), null, null);
> > > add(entry); // This line causes the exception !!!!!
> > >
> > >
> > > The exception is in the org.eclipse.gef.palette.PaletteContainer.java:
> > > add (int index, PaletteEntry enty) {
> > > if (!acceptsType(entry.getType()))
> > > throw new IllegalArgumentException(
> > > "This container can not contain this type of child: " +
> > > entry.getType());
> > > List oldChildren = new ArrayList(getChildren());
> > > ...
> > > }
> > >
> > > I debug the same code with Cascade I2, the same add() method in I2
didn't
> > > have the acceptsType() test, and it is simply:
> > >
> > > add (int index, PaletteEntry enty) {
> > > List oldChildren = new ArrayList(getChildren());
> > > ...
> > > }
> > >
> > > How to fix and make the code work in I3?
> > >
> > > Best Regards,
> > > SL
> > >
> > >
>
>
Previous Topic:Dropdown toolbar button
Next Topic:CommandStacks in GEF
Goto Forum:
  


Current Time: Fri Apr 26 16:56:51 GMT 2024

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

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

Back to the top