pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adarsh Y.V" <adarsh...@gmail.com>
Subject keyboard short-cuts for buttons
Date Wed, 05 Oct 2011 07:37:53 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());
                                                        }
                                                }});}}});}}

Mime
View raw message