|
|
Re: IBM Redbook NetworkEditor [message #214232 is a reply to message #214225] |
Fri, 14 April 2006 02:42 |
Paul Allen Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Steven Shaw wrote:
> If you're interested in seeing a GEF editor working with EMF, you really
> should evaluate the GMF project. www.eclipse.org/gmf. There a number of
> examples already operational based on an EMF domain model. Also, you could
> generate a GEF editor with the GMF tooling based on this EMF NetworkModel.
> -Steve
Well, I have a GEF editor based on EMF. It compiles fine, but when
it runs the Eclipse platform says it's the wrong type of child. I'd
just like to patch this last little glitch and have running code that
can be examined. How does the workbench know what types of editors
can occupy the "editor" slot in the GUI, for example?
GMF is too new. It requires a version of Eclipse that not all
of my team can migrate to. It's not an option, yet.
Thanks for the response.
Paul Allen
> "Paul Allen" <paul.l.allen@boeing.com> wrote in message
> news:368562e698b1d65e59d94ca3b7479e85$1@www.eclipse.org...
>> I've imported the NetworkModel and NetworkEditor projects that go with
>> the IBM Redbook on GEF and EMF. The hope was to see a GEF editor based
>> on an EMF model actually run, and have source code to poke at. I'm using
>> Eclipse 3.1.1, EMF 2.1.1, and GEF 3.1.1. The platform is SuSE 10 with
>> its bundled 1.5 JDK.
>>
>> The code is a bit old, so it took a bit of shoving to get it all to
>> compile. When I launch the NetworkEditor plugin, I get a new workspace
>> with this message where the editor view would be:
>>
>> java.lang.IllegalArgumentException: This container can not contain this
>> type of child: $Palette Tool
>> [...]
>>
>> I'm at sea here. Is the NetworkEditor broken? Do I need to modify
>> something in the workbench to allow it to run the NetworkEditor? Has
>> anybody
>> been here before?
>>
>> Thanks!
>>
>> Paul Allen
>>
|
|
|
Re: IBM Redbook NetworkEditor [message #215021 is a reply to message #214137] |
Tue, 25 April 2006 19:01 |
Paul Allen Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Paul Allen wrote:
> I've imported the NetworkModel and NetworkEditor projects that go with
> the IBM Redbook on GEF and EMF. The hope was to see a GEF editor based
> on an EMF model actually run, and have source code to poke at. I'm using
> Eclipse 3.1.1, EMF 2.1.1, and GEF 3.1.1. The platform is SuSE 10 with
> its bundled 1.5 JDK.
> The code is a bit old, so it took a bit of shoving to get it all to
> compile. When I launch the NetworkEditor plugin, I get a new workspace
> with this message where the editor view would be:
> java.lang.IllegalArgumentException: This container can not contain this
> type of child: $Palette Tool
> [... long traceback omitted ...]
> I'm at sea here. Is the NetworkEditor broken? Do I need to modify
> something in the workbench to allow it to run the NetworkEditor? Has
> anybody
> been here before?
OK, I fixed all the warnings about deprecated stuff and the runtime error
persisted. So I tracked down the code that was generating the error. In
com.ibm.itso.sal330r.network.editor.NetworkPaletteRoot, a CreationToolEntry
is built with a type of ToolEntry.PALETTE_TYPE_TOOL. This type is
explicitly
disallowed by PaletteRoot.acceptsType(). Hence, the error message. I
thought,
"Damn the torpedoes!", and overrode acceptsType in NetworkPaletteRoot like
this:
public boolean acceptsType (Object type) {
if (type.equals(ToolEntry.PALETTE_TYPE_TOOL)) {
return true;
} else {
return super.acceptsType(type);
}
}
The network editor now runs fine, with no apparent adverse effects from
forcing a disallowed child type onto the palette.
Anybody have a clue why PaletteRoot doesn't accept entries of type
ToolEntry.PALETTE_TYPE_TOOL?
Paul Allen
|
|
|
Powered by
FUDForum. Page generated in 0.02503 seconds