Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » IBM Redbook NetworkEditor
IBM Redbook NetworkEditor [message #214137] Thu, 13 April 2006 03:30 Go to next message
Paul Allen is currently offline Paul AllenFriend
Messages: 10
Registered: July 2009
Junior Member
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
at org.eclipse.gef.palette.PaletteContainer.add(PaletteContaine r.java:77)
at org.eclipse.gef.palette.PaletteContainer.add(PaletteContaine r.java:67)
at
com.ibm.itso.sal330r.network.editor.NetworkPaletteRoot.<init >(NetworkPaletteRoot.java:65)
at
com.ibm.itso.sal330r.network.editor.NetworkEditor.getPalette Root(NetworkEditor.java:659)
at
com.ibm.itso.sal330r.network.editor.AbstractEditorPage.getPa letteRoot(AbstractEditorPage.java:130)
at
com.ibm.itso.sal330r.network.editor.AbstractEditorPage.creat ePaletteViewer(AbstractEditorPage.java:286)
at
com.ibm.itso.sal330r.network.editor.NetworkPage.createPageCo ntrol(NetworkPage.java:61)
at
com.ibm.itso.sal330r.network.editor.AbstractEditorPage.creat ePartControl(AbstractEditorPage.java:188)
at
org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEdi torPart.java:155)
at
org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEdi torPart.java:132)
at
com.ibm.itso.sal330r.network.editor.NetworkEditor.createPage s(NetworkEditor.java:420)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:241)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:609)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:384)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:552)
at
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:258)
at
org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1221)
at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.ja va:949)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at
org.eclipse.ui.internal.EditorManager.restoreState(EditorMan ager.java:944)
at
org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2576)
at
org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:1819)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2566)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1503)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 491)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1374 )
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1318)
at
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigurer.java:183)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:700)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1636)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

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 #214225 is a reply to message #214137] Thu, 13 April 2006 20:56 Go to previous messageGo to next message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
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


"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
> at org.eclipse.gef.palette.PaletteContainer.add(PaletteContaine r.java:77)
> at org.eclipse.gef.palette.PaletteContainer.add(PaletteContaine r.java:67)
> at
>
com.ibm.itso.sal330r.network.editor.NetworkPaletteRoot.<init >(NetworkPalette
Root.java:65)
> at
>
com.ibm.itso.sal330r.network.editor.NetworkEditor.getPalette Root(NetworkEdit
or.java:659)
> at
>
com.ibm.itso.sal330r.network.editor.AbstractEditorPage.getPa letteRoot(Abstra
ctEditorPage.java:130)
> at
>
com.ibm.itso.sal330r.network.editor.AbstractEditorPage.creat ePaletteViewer(A
bstractEditorPage.java:286)
> at
>
com.ibm.itso.sal330r.network.editor.NetworkPage.createPageCo ntrol(NetworkPag
e.java:61)
> at
>
com.ibm.itso.sal330r.network.editor.AbstractEditorPage.creat ePartControl(Abs
tractEditorPage.java:188)
> at
>
org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEdi torPart.java:155
)
> at
>
org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEdi torPart.java:132
)
> at
>
com.ibm.itso.sal330r.network.editor.NetworkEditor.createPage s(NetworkEditor.
java:420)
> at
>
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPar
t.java:241)
> at
>
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.jav
a:609)
> at
>
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:384)
> at
>
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReferenc
e.java:552)
> at
>
org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.j
ava:258)
> at
>
org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:12
21)
> at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.ja va:949)
> at
>
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:1044)
> at org.eclipse.core.runtime.Platform.run(Platform.java:783)
> at
> org.eclipse.ui.internal.EditorManager.restoreState(EditorMan ager.java:944)
> at
>
org.eclipse.ui.internal.WorkbenchPage.restoreState(Workbench Page.java:2576)
> at
>
org.eclipse.ui.internal.WorkbenchWindow.restoreState(Workben chWindow.java:18
19)
> at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.j ava:2566)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1503)
> at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1 491)
> at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1374 )
> at
>
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java
:1044)
> at org.eclipse.core.runtime.Platform.run(Platform.java:783)
> at org.eclipse.ui.internal.Workbench.restoreState(Workbench.jav a:1318)
> at
>
org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(Wor kbenchConfigurer
..java:183)
> at
>
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.jav
a:700)
> at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1636)
> at
>
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
> at
>
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.
java:226)
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
> at
>
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39
)
> at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl
..java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
> at org.eclipse.core.launcher.Main.run(Main.java:973)
> at org.eclipse.core.launcher.Main.main(Main.java:948)
>
> 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 #214232 is a reply to message #214225] Fri, 14 April 2006 02:42 Go to previous messageGo to next message
Paul Allen is currently offline Paul AllenFriend
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 Go to previous message
Paul Allen is currently offline Paul AllenFriend
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
Previous Topic:Invalid figure bounds.
Next Topic:AbstractTreeEditPart and AbstractConnectionEditPart
Goto Forum:
  


Current Time: Fri Mar 29 06:07:16 GMT 2024

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

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

Back to the top