Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Help needed: How to host GEF editor inside any composite?
Help needed: How to host GEF editor inside any composite? [message #215868] Thu, 11 May 2006 03:45
Eclipse UserFriend
Originally posted by: erickingus.hotmail.com

I need to create a process editor using GEF framework. If I extend
existing EditorPart or even better extend it from
GraphicalEditorWithFlyoutPalette, and open editor using this approach:

IEditorInput input = new ProcessEditorInput(new Path(path));
IWorkbenchPage page = window.getActivePage();
try {
page.openEditor(input,ProcessEditor.ID,true);
} catch (PartInitException e) {
// handle error
}

Then everything works fine.

But what I really want is to create this editor inside composite. For
instance, in the View.createPartControl(Composite parent), if I do this:
public class View extends ViewPart {
// other code...
public void createPartControl(Composite parent) {
// createSamplePart(parent);
SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
sashForm.setWeights(new int[]{30,70});
paletteViewer = createPaletteViewer(sashForm);
graphicalViewer = createGraphicalViewer(sashForm);
}
// other code ...
}

and try to attach various pieces to GraphicalViewer and PaletteViewer, it
throws the following exception:
java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:3358)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.swt.custom.SashForm.setWeights(SashForm.java:366 )
at com.agile.rcp.View.createPartControl(View.java:53)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:332)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:197)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:29 0)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:52 5)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:140)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:268)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:394)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:13 11)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:601)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:532)
at
org.eclipse.ui.internal.PartSashContainer.createControl(Part SashContainer.java:562)
at
org.eclipse.ui.internal.PerspectiveHelper.activate(Perspecti veHelper.java:244)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.j ava:832)
at
org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPa ge.java:2378)
at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindo w.java:2616)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchWindow.setActivePage(Workbe nchWindow.java:2597)
at
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:658)
at
org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Wo rkbench.java:795)
at
org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Work bench.java:1437)
at
org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbe nch.java:1388)
at
org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWin dow(WorkbenchConfigurer.java:190)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:708)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at com.agile.rcp.Application.run(Application.java:18)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)


Can someone please let me know what is the problem?

Thanks,
Eric
Previous Topic:Extending ManhattanConnectionRouter
Next Topic:Exception when Edge created
Goto Forum:
  


Current Time: Thu Dec 08 16:44:35 GMT 2022

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

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

Back to the top