Skip to main content



      Home
Home » Modeling » Graphiti » FlyoutPalette in DiagramComposite
FlyoutPalette in DiagramComposite [message #1731717] Mon, 09 May 2016 09:39 Go to next message
Eclipse UserFriend
Hi,

I'm trying to create a DiagramComposite with an FlyoutPaletteComposite (I basically want the same behavior as in the DiagramEditor but I can't use the editor since I need to pass my own TransactionalEditingDomain.)

I finally managed to display the diagram next to the palette and have the flyout behavior by overriding createGraphicalViewer in DiagramBehavior, s. below. However, the palette is initially in the wrong position (WEST instead of expected EAST). Only after I click on the expand button does it go to the other side (EAST). Any ideas on how to get it working?

Cheers,

Kristine

	@Override
	protected void createGraphicalViewer(Composite parent) {
		FlyoutPaletteComposite flyoutPaletteComposite = new FlyoutPaletteComposite(parent, SWT.NONE,
				swisslabEditor.getActivePageInstance().getSite().getPage(), createPaletteViewerProvider(),
				getPalettePreferences());
		flyoutPaletteComposite.setLayout(new FillLayout());
		getEditDomain().setPaletteRoot(getPaletteRoot());

		super.createGraphicalViewer(flyoutPaletteComposite);
		flyoutPaletteComposite.setGraphicalControl(getDiagramContainer().getGraphicalViewer().getControl());	
	}
Re: FlyoutPalette in DiagramComposite [message #1732031 is a reply to message #1731717] Thu, 12 May 2016 02:55 Go to previous messageGo to next message
Eclipse UserFriend
Kristine,

I have not tried that myself, but it sounds as if only a refresh on the composite may be missing.

Another thing: the editing domain is initialized in the setInput method of the composite. You may overwrite that method, get your own editing domain there and continue with tghe standard implementation. Have you tried that?

HTH,
Michael
Re: FlyoutPalette in DiagramComposite [message #1732037 is a reply to message #1732031] Thu, 12 May 2016 03:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi Michael,

thanks for the reply.

Quote:

I have not tried that myself, but it sounds as if only a refresh on the composite may be missing.


I already tried calling layout but it didn't do anything.

Quote:

Another thing: the editing domain is initialized in the setInput method of the composite. You may overwrite that method, get your own editing domain there and continue with tghe standard implementation. Have you tried that?


What do you mean with the standard implemetation? It doesn't have the palette...

Cheers,

Kristine
Re: FlyoutPalette in DiagramComposite [message #1732837 is a reply to message #1732037] Fri, 20 May 2016 11:21 Go to previous messageGo to next message
Eclipse UserFriend
Kristine,

sorry, forget about the comment with the standard implementation.

About the refresh: you should not call layout but teh method refresh on the DiagramBehoavior class, that should do it.

Michael
Re: FlyoutPalette in DiagramComposite [message #1732926 is a reply to message #1732837] Mon, 23 May 2016 03:15 Go to previous message
Eclipse UserFriend
Michael Wenz wrote on Fri, 20 May 2016 15:21

About the refresh: you should not call layout but teh method refresh on the DiagramBehoavior class, that should do it.


I tried it, but it didn't help Sad I will just use a regular palette viewer, without th flyout behavior.
Previous Topic:Scrollable figures
Next Topic:Eclispse Neon Graphiti v0.13 Line Width
Goto Forum:
  


Current Time: Mon Mar 10 19:31:16 EDT 2025

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

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

Back to the top