Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Adding another GraphicalViewer in GraphicalEditorWithFlyoutPalette(FlyoutPaletteComposite.setGraphicalControl() throws AssertionFailedException)
Adding another GraphicalViewer in GraphicalEditorWithFlyoutPalette [message #1720795] Thu, 21 January 2016 06:06 Go to next message
Akash Srivastava is currently offline Akash SrivastavaFriend
Messages: 1
Registered: January 2016
Junior Member
My goal is to create an editor with some portion on top of the editor to be fixed(unscrollable) and the remaining part to be scrollable.
Reading some solution on this forum, I got the idea of adding another graphicalviewer for this.
I am extending GraphicalEditorWithFlyoutPalette class to create an editor.
(This editor is again on top of MultiPageEditorPart.)
I am overriding the method "createPartControl(Composite parent)"
@Override
public void createPartControl(Composite parent)
{

super.createPartControl(parent);

getSite().getPage().addSelectionListener(this);
}

and also "createGraphicaViewer()" method
@Override
protected void createGraphicalViewer(Composite parent)
{
// TODO Auto-generated method stub
SashForm sashform = new SashForm(parent, SWT.NONE);

GraphicalViewer gv1 = new GraphicalViewerImpl();
gv1.createControl(sashform);
getEditDomain().addViewer(gv1);
gv1.getControl().setBackground(ColorConstants.listBackground);
gv1.setEditPartFactory(new MyEditPartFactory());
this.parent.getSelectionSynchronizer().addViewer(gv1);
gv1.setContents(new PageModel());
getSelectionSynchronizer().addViewer(gv1);

GraphicalViewer gv2 = new ScrollingGraphicalViewer();
gv2.createControl(sashform);
setGraphicalViewer(gv2);
configureGraphicalViewer();
hookGraphicalViewer();
initializeGraphicalViewer();

sashform.setWeights(new int[] {30,70});
}

The Exception I am getting is as follows :
org.eclipse.core.runtime.AssertionFailedException: assertion failed:
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
at org.eclipse.gef.ui.palette.FlyoutPaletteComposite.setGraphicalControl(FlyoutPaletteComposite.java:529)
at org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette.createPartControl(GraphicalEditorWithFlyoutPalette.java:76)
at com.ibm.rational.rpe.studio.editor.TemplateGraphicalEditor.createPartControl(TemplateGraphicalEditor.java:239)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:243)
at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:213)
at com.ibm.rational.rpe.studio.editor.editors.StudioEditor.createPages(StudioEditor.java:377)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:362)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:141)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:327)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:888)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:869)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:120)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:337)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:104)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:55)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:127)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:983)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:766)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:737)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:731)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)


I get the reason behind the exception , which is that the parent of the graphicalviewer gv2 changes from Flyoutpalettecomposite to SashForm

But isn't there another way through which I can achieve my goal??
Re: Adding another GraphicalViewer in GraphicalEditorWithFlyoutPalette [message #1720867 is a reply to message #1720795] Thu, 21 January 2016 14:30 Go to previous message
Krisztian Koncz is currently offline Krisztian KonczFriend
Messages: 31
Registered: September 2014
Location: Budapest
Member

I'm not sure, but maybe you should override the getGraphicalControl method.
@override
protected Control getGraphicalControl() {
   return sashForm;
}
Previous Topic:[GEF4] Problem implementing ClickableAreaBehavior
Next Topic:[Zest] Is it possible to use the LayoutAlgorithms without using SWT?
Goto Forum:
  


Current Time: Fri Apr 26 04:29:55 GMT 2024

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

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

Back to the top