Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Need help with Jface in eclipse(This is about my query about Jface and making projects in clipse)
Need help with Jface in eclipse [message #1419356] Mon, 08 September 2014 13:31 Go to next message
Krishnakant Mane is currently offline Krishnakant ManeFriend
Messages: 9
Registered: December 2013
Junior Member
hello,
I use Eclipse Lunar and wish to know where I can ask my queries about Jface.
I wish to develop an application window with a Menubar at the top and a vertical toolbar on the right side.
I managed to get the menubar and toolbar but not vertically right?
I thought, since Jface is an eclipse project, I would ask here.
I am sorry if I am asking at the wrong place, but a small snippit would do, if this is a right place for Jface beginner.
I understand the basics and am good with SWT.
For the toolbar style I did try SWT.RIGHT with vertical, but it has not worked for me.
Thanks.
Krishnakant.
Re: Need help with Jface in eclipse [message #1419918 is a reply to message #1419356] Tue, 09 September 2014 08:44 Go to previous messageGo to next message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Hi Krishnakant,

Have you create the ToolBar like this ToolBar bar = new ToolBar(shell, SWT.RIGHT|SWT.VERTICAL); ?

Here is a working example :

public class VerticalToolBar {

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		ToolBar bar = new ToolBar(shell, SWT.RIGHT | SWT.VERTICAL);
		for (int i = 0; i < 5; i++) {
			ToolItem item = new ToolItem(bar, SWT.PUSH);
			item.setText("Item " + i);
		}
		bar.pack();
		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		display.dispose();
	}
}


Regards,

Hussein


ALL4TEC
Re: Need help with Jface in eclipse [message #1420030 is a reply to message #1419918] Tue, 09 September 2014 12:07 Go to previous messageGo to next message
Krishnakant Mane is currently offline Krishnakant ManeFriend
Messages: 9
Registered: December 2013
Junior Member
No Message Body
Re: Need help with Jface in eclipse [message #1420036 is a reply to message #1419356] Tue, 09 September 2014 12:15 Go to previous messageGo to next message
Krishnakant Mane is currently offline Krishnakant ManeFriend
Messages: 9
Registered: December 2013
Junior Member
Dear Husan, I use Linux with gnome shell 3.12. And this code has not worked. Is the code you specified specifically for Windows?
Re: Need help with Jface in eclipse [message #1420070 is a reply to message #1420036] Tue, 09 September 2014 13:10 Go to previous message
Hussein MHANNA is currently offline Hussein MHANNAFriend
Messages: 45
Registered: February 2014
Location: LAVAL
Member
Dear Krishnakant,

I have not tested this code on Linux. But I think this code is compatible with linux because in the javadoc of ToolBar there is nothing special about the platform dependency(WIndows, Linux, ...) concerning the style SWT.RIGHT | SWT.VERTICAL.

Hussein


ALL4TEC
Previous Topic:ComboViewer Horizontal Layout
Next Topic:form layout based interfaces look inconsistent on different screensf
Goto Forum:
  


Current Time: Tue Apr 16 09:38:18 GMT 2024

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

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

Back to the top