score:1
this snippet shows how to create a drop down menu. to get the radio buttons, use the swt.radio style instead of swt.push for the menuitems.
final toolbar toolbar = new toolbar (shell, swt.none);
rectangle clientarea = shell.getclientarea ();
toolbar.setlocation(clientarea.x, clientarea.y);
final menu menu = new menu (shell, swt.pop_up);
for (int i=0; i<8; i++) {
menuitem item = new menuitem (menu, swt.push);
item.settext ("item " + i);
}
final toolitem item = new toolitem (toolbar, swt.drop_down);
item.addlistener (swt.selection, new listener () {
public void handleevent (event event) {
if (event.detail == swt.arrow) {
rectangle rect = item.getbounds ();
point pt = new point (rect.x, rect.y + rect.height);
pt = toolbar.todisplay (pt);
menu.setlocation (pt.x, pt.y);
menu.setvisible (true);
}
}
});
toolbar.pack ();
Source: stackoverflow.com
Related Query
- How do I create an eclipse toolbar item with SWT.RADIO style with drop-down capabilities?
- how to display a simple swt window with text fileld and a button when clicking on a menu item in eclipse plugins?
- How to create drop down menu's in eclipse rcp according to alphabets dynamically
- Eclipse SWT 3: What widget to use to get a drop down menu with tool tips on each item?
- How can Eclipse create a class with unresolved compilation problems?
- How to create the pom.xml for a Java project with Eclipse
- How to create an Intellij and Eclipse compatible code style and code formatting configuration (for java code)?
- How to create a generic list with Eclipse EMF?
- how to create an eclipse workspace with command line without actually launching eclipse?
- How to get Eclipse SWT Browser component running on Ubuntu 11.04 (Natty Narwhal) with Webkit?
- How to create a Maven project in Eclipse with AspectJ support?
- How can I remove Eclipse Mars Jboss Tools Toolbar item
- How do I create a Spring Boot Starter Project in Eclipse that is properly configured with a Run Configuration?
- how to create a not runnable/not executable jar with other external jar dependencies in Eclipse
- How to remove additional class drop down in Eclipse Project Explorer view?
- How to create new folder in Eclipse Helios CDT with symbolic link?
- How to create runnable jar with resources in Eclipse from Maven project
- How to create Eclipse project with EGit clone
- How to create a Facebook Application With java and eclipse
- Android Eclipse ADT 8.0.0 (and 8.0.1) problem - can't create views hierarchy with drag and drop in the Outline view
- How to create SWT browser for SonarLint for Eclipse rule description?
- How to get down to StringLiterals with Eclipse AST?
- How do I create an Eclipse Dynamic Web Project with a JSF Facet that specifies version 2.3?
- How to create a Java SWT table with multiple columns without giving static column width
- How to create a css file in eclipse with e(fx)clipse plug in
- How to track down JAR with corrupt JAR Index that cause InvalidJarIndexException in Tomcat in Eclipse
- How to create a DLL and use it with Eclipse for C
- How do I create a new eclipse project for jetty from a tomcat based project and versioned with svn/subclipse?
- How to create GeoTagging image / location tagging application for android with google maps using eclipse with ADT
- How to create an android Project from existing source in eclipse with ADT 20.0.X and SDK r20
More Query from same tag
- Debugging the java class in eclipse
- using the driver definiton created in eclipse
- How to run JSR269 annotaion processor in Eclipse Kepler with Java 7 & Maven
- Issue with build Android NDK project
- How to import statically all variables at the same time in eclipse when use "Add import" in eclipse?
- Debug native Android Applications
- "This compilation unit is not on the build path of a java project" -Eclipse
- Eclipse Default JRE Preference Installed JRE Not Working
- Why does my Eclipse "count objects" before pushing upstream to GIT each time
- OnClickListener is not showing output of my function
- Mobile to Mobile Remote Access using Android
- How to find all occurrences of a certain variable/method in Eclipse? i.e the equivalent of "cmd + b" of Android Studio
- google test coverage for c++ in eclipse?
- Eclipse create CompilationUnit handle from String
- eclipse on ubuntu: what is missing from my configuration?
- "R cannot be resolved to a variable" android error
- Eclipse CDT extend AdapterFactory
- Add XML extension on project build path in Eclipse not working
- Bootstrap content assist in html files in Eclipse
- "duplicate class" on boilerplate generation (GWTP) with maven
- Check, if all classes in project have a specific annotation
- facebook SDK doesn't work in android
- Launch Google Maps from app
- Tools for developing JAX-RPC WebService for WebSphere 7.0
- Setting up CEF development in Eclipse for Java?
- log4j:WARN Please initialize the log4j system properly
- "Online" debuging on external php server
- When I start my apk file following error is given
- Google Maps v2 my location with Google Play
- How to reference a file from Mylyn's Jenkins-View?