troubleshooting Question

Eclipse SWT - Sample code needed - add widgets to a View toolbar

Avatar of alwillms
alwillms asked on
Editors IDEs
2 Comments1 Solution1291 ViewsLast Modified:
Hello,
I am spinning my wheels trying to get over this learning curve and the examples I've found so far aren't helping.  I need to add a set of radio buttons to a View toolbar and I need to add a dynamic drop-down to a view toolbar.  The attached code doesn't create the radio buttons and is obviously wrong.

IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
//	    tbm.update(true);        
//	    ToolBar toolBar = ((ToolBarManager) tbm).getControl();
//	    ToolItem item = new ToolItem(toolBar, SWT.RADIO);
//	    item.setText("Text");
//	    item.addSelectionListener( new SelectionListener() {
//	    	public void widgetDefaultSelected(SelectionEvent e) {
//			}
//			public void widgetSelected(SelectionEvent e) {
//			}
//	    });
//	    ToolItem item2 = new ToolItem(toolBar, SWT.RADIO);
//	    item2.setText("Images");
//	    item2.addSelectionListener( new SelectionListener() {
//	    	public void widgetDefaultSelected(SelectionEvent e) {
//			}
//			public void widgetSelected(SelectionEvent e) {
//			}
//	    });
//	    new ToolItem(toolBar, SWT.SEPARATOR);
	    tbm.add(searchAction);
	    tbm.add(iMDbLookupAction);
	    tbm.add(addToBoxSetAction);
	    tbm.add(addMovieAction);
	    tbm.add(deleteMovieAction);
//	    toolBar.pack(true);
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros