Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Menu on the right side?

Is possible to add MenuItem (or second Menu) on the right side of the application window (as on image below)?

enter image description here

like image 256
marioosh Avatar asked Dec 12 '12 08:12

marioosh


1 Answers

A partial answer to your questions is that a second menu bar cannot be added. Reference here.

Every shell can optionally display a single menu bar using the setMenuBar(Menu menuBar) method of Shell. It's possible to create many menu bars in a shell, but only one can be visible in a shell at a time.

Perhaps you can try creating a second shell window that hovers over the location where you want your second (right-aligned) menu. You will need to ensure that this shell always remains attached to that particular corner of the window. You might have problems if the size of the main shell is reduced, which might show one menu overlapping the other. Not a nice solution though. Perhaps use a toolbar instead with a filler (SWT#SEPARATOR_FILL) item?

like image 135
Waqas Ilyas Avatar answered Sep 21 '22 15:09

Waqas Ilyas