pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sdf <adarsh...@gmail.com>
Subject Re: keyboard short-cuts for buttons
Date Wed, 05 Oct 2011 06:34:42 GMT
hi
this my java file for a simple bxml page for setting destination folder
during installation.
can someone show a sample to add a key pressed listener(for next button like
ALT+N..). how to do it??

public class DestinationFolderScreen {

	@BXML
	org.apache.pivot.wtk.Label InstallLocation;
	@BXML
	org.apache.pivot.wtk.PushButton next;
	@BXML
	org.apache.pivot.wtk.TextInput destinationFolder;
	@BXML
	org.apache.pivot.wtk.BoxPane StackLayer4;
	@BXML
	org.apache.pivot.wtk.ImageView InstallerBackground;
	@BXML
	org.apache.pivot.wtk.PushButton browse;
	@BXML
	org.apache.pivot.wtk.PushButton cancel;
	@BXML
	org.apache.pivot.wtk.BoxPane StackLayer2;
	@BXML
	org.apache.pivot.wtk.PushButton back;
	@BXML
	org.apache.pivot.wtk.BoxPane StackLayer1;
	@BXML
	org.apache.pivot.wtk.Label DestinationFolder;

	@Override
	public void initialize(final Map&lt;String, Object&gt; properties, URL url,
			Resources resource) {		

		next.getButtonPressListeners().add(new ButtonPressListener() {
			@Override
			public void buttonPressed(Button button) {
				if (true) {

					nextPress(properties);
				}}});

		cancel.getButtonPressListeners().add(new ButtonPressListener() {
			@Override
			public void buttonPressed(Button button) {
				
								closingWindow();
						}});

		back.getButtonPressListeners().add(new ButtonPressListener() {
			@Override
			public void buttonPressed(Button button) {
				if (true) {

					backPress();
				}}});

		browse.getButtonPressListeners().add(new ButtonPressListener() {
			@Override
			public void buttonPressed(Button button) {
				if (true){

					FileBrowserSheet.Mode fileBrowserSheetMode = FileBrowserSheet.Mode
							.valueOf("SAVE_TO");
					final FileBrowserSheet fileBrowserSheet = new FileBrowserSheet();
					fileBrowserSheet.getStyles().put("hideDisabledFiles",
							"true");
					fileBrowserSheet.setMode(fileBrowserSheetMode);
					fileBrowserSheet.open(window, new SheetCloseListener() {
						@Override
						public void sheetClosed(Sheet sheet) {
							if (sheet.getResult()) {
								File file = fileBrowserSheet.getSelectedFile();
								destinationFolder.setText(file.getPath());
							}
						}});}}});}}

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/keyboard-short-cuts-for-buttons-tp3388941p3395715.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Mime
View raw message