Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Changing Palette
Changing Palette [message #893926] Fri, 06 July 2012 01:57 Go to next message
Jason Lin is currently offline Jason Lin
Messages: 12
Registered: July 2012
Junior Member
Hello,

I want to make a little change to the palette to show two tabs on the top. And each tab
shows different palette. I just can get the paletteViewer in my diagram editor.

getEditDomain().getPaletteViewer();


I also find PaletteDrawer, GraphicalEditorWithFlyoutPalette and so on,
but I still can't find out what is the right way to change the control or layout of the palette.

Any idea?

Thank you in advance.

Best Regards,
Jason
Re: Changing Palette [message #893929 is a reply to message #893926] Fri, 06 July 2012 02:10 Go to previous messageGo to next message
Jason Lin is currently offline Jason Lin
Messages: 12
Registered: July 2012
Junior Member
I'm now looking at DiagramEditorInternal and hope that the method createpaletteRoot can help me.
Re: Changing Palette [message #893944 is a reply to message #893929] Fri, 06 July 2012 03:08 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1590
Registered: July 2009
Location: Walldorf, Germany
Senior Member
The editor API is not really in shape for doing things like that in Graphiti
0.8.2. We reworked it for our current release 0.9.0 as part of Juno, so you
should really have a look into that Graphiti version

Otherwise you are on the right track with that method, but as I said this
could get somewhat difficult in 0.8...

Michael
Re: Changing Palette [message #893970 is a reply to message #893944] Fri, 06 July 2012 05:10 Go to previous messageGo to next message
Jason Lin is currently offline Jason Lin
Messages: 12
Registered: July 2012
Junior Member
Thanks for your quick response.
I have tracked the codes hours and still can't find a excellent extend point to meet my requirement... I am considering whether change to another UI design which also can be accepted.
But because of cooperation with other components, I can't change to new release. Such a pity.

PS:You are always so nice and I have read lots of your replies and they help me so much. Best wishes.

Jason Lin.
Re: Changing Palette [message #894387 is a reply to message #893944] Sun, 08 July 2012 23:22 Go to previous message
Jason Lin is currently offline Jason Lin
Messages: 12
Registered: July 2012
Junior Member
I give up the tab UI. And try to add two buttons or components that can be selected.
Finially I add two dummy tool entries Sad
1. CreateProcedureDiagramEditor extends DiagramEditor implements ISelectionChangedListener
@Override
	protected PaletteRoot createPaletteRoot() {
		// TODO Auto-generated method stub
		platetteRoot = new MyGFPaletteRoot(getConfigurationProvider());
		return  platetteRoot;
	}

2. MyGFPaletteRoot extends PaletteRoot
add two dummy tool entry on the top when updatePaletteEntries

3. Add selection listener
PaletteViewer paletteViewer = getEditDomain().getPaletteViewer();
paletteViewer.addSelectionChangedListener(this);

Through the above codes, I can dynamically udpate the palette when selection change.
But it tastes bad and I have to deal with the original tool entry handling process.... Thus I am considering other solutions.

Any idea?

Best Regards,
Lin, Qinhe
Previous Topic:Errormessage while load diagram after restart
Next Topic:Set Text to the right position
Goto Forum:
  


Current Time: Fri Aug 29 20:28:14 EDT 2014

Powered by FUDForum. Page generated in 0.01663 seconds