Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.FieldChangeListener


        // Initialize UI components
        _instructions = new LabelField("", Field.NON_FOCUSABLE);

        final FullWidthButton fireForgetSendButton =
                new FullWidthButton("Fire-And-Forget");
        fireForgetSendButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendFireForgetScreen();
            }
        });

        fireForgetSendButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Send messages using fire and forget destination.");

            }
        });

        final FullWidthButton nonBlockSendButton =
                new FullWidthButton("Non-Blocking");
        nonBlockSendButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showMenuSendNonBlockScreen();
            }
        });

        nonBlockSendButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Send messages using non-blocking destination. Message parsing examples are also included.");
            }
        });

        final FullWidthButton blockSendButton = new FullWidthButton("Blocking");
        blockSendButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendBlockScreen();
View Full Code Here


        _uriSenderField =
                new EditField("URI:", CommunicationController.ECHO_SERVER_URI
                        + "RSS", 140, 0);
        final FullWidthButton postButton = new FullWidthButton("Get Data");
        postButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (!_pending) {
View Full Code Here

        // Initialize UI components
        _instructions = new LabelField("", Field.NON_FOCUSABLE);

        final FullWidthButton testButton = new FullWidthButton("BES Push");
        testButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showReceivePushScreen();
            }
        });

        testButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Receive messages sent from external push server through BES.");

            }
        });

        final FullWidthButton ipcButton =
                new FullWidthButton("IPC/Local Receiver");
        ipcButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showReceiveIPCScreen();
            }
        });

        ipcButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Receive messages sent from other BlackBerry Smartphone device applications using IPC(Inter-Process Communication).");
            }
        });

        final FullWidthButton bpsButton = new FullWidthButton("BPS Push");
        bpsButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showReceiveBPSScreen();
View Full Code Here

        _uriReceiverField =
                new EditField("Receiver URI:", "local://" + PATH_STRING, 140, 0);

        _isBlocking = new CheckboxField("Blocking", false);
        _isBlocking.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                // Avoid conflict blocking and non-blocking destinations with
                // the same name
                if (_isBlocking.getChecked()) {
                    _uriReceiverField.setText("local://" + PATH_STRING + "9");
                } else {
                    _uriReceiverField.setText("local://" + PATH_STRING);
                }

            }
        });

        _autoStartEnabled =
                new CheckboxField("Auto-start when message arrives", true);

        final FullWidthButton backButton = new FullWidthButton("Back");
        backButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                ((UiApplication) ReceiveIPCScreen.this.getApplication())
                        .popScreen(ReceiveIPCScreen.this);
            }
        });

        final FullWidthButton startButton =
                new FullWidthButton("Start Receiver");
        startButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (_isBlocking.getChecked()) {
                    // Blocking receiver
                    controller.startBlockingReceiverIPC(_uriReceiverField
                            .getText(), _autoStartEnabled.getChecked(),
                            CommunicationController.TIMEOUT);
                } else {
                    // Non blocking receiver
                    controller.startNonBlockingReceiverIPC(_uriReceiverField
                            .getText(), _autoStartEnabled.getChecked());
                }
            }
        });

        final FullWidthButton pauseButton =
                new FullWidthButton("Pause Receiver");
        pauseButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.pauseReceiver(_uriReceiverField.getText());
            }
        });

        final FullWidthButton resumeButton =
                new FullWidthButton("Resume Receiver");
        resumeButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.resumeReceiver(_uriReceiverField.getText());
            }
        });

        final FullWidthButton releaseButton =
                new FullWidthButton("Release Receiver");
        releaseButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.releaseReceiver(_uriReceiverField.getText());
            }
        });

        final FullWidthButton destroyButton =
                new FullWidthButton("Destroy Receiver");
        destroyButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.destroyReceiver(_uriReceiverField.getText());
View Full Code Here

        // Initialize UI components
        _instructions = new LabelField("", Field.NON_FOCUSABLE);
        final FullWidthButton sendMessagesButton =
                new FullWidthButton("Send Messages");
        sendMessagesButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManger.showMenuSendScreen();
            }
        });

        sendMessagesButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Test communication and message processing for various data protocols.");
            }
        });

        final FullWidthButton receiveMessagesButton =
                new FullWidthButton("Receive Messages");
        receiveMessagesButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManger.showMenuReceiveScreen();
            }
        });

        receiveMessagesButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Test push messaging using an external push server, BPDS pushes and IPC communication. ");
            }
        });

        final FullWidthButton cancelMessagesButton =
                new FullWidthButton("Cancel Messages");
        cancelMessagesButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManger.showCancellationScreen();
            }
        });

        cancelMessagesButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Test message cancellation with different types of settings. ");
            }
        });

        final FullWidthButton authButton =
                new FullWidthButton("Basic Authentication");
        authButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManger.showAuthenticationScreen();
            }
        });

        authButton.setFocusListener(new FocusChangeListener() {
            /**
             * @see FocusChangeListener#focusChanged(Field, int)
             */
            public void focusChanged(final Field field, final int eventType) {
                setInstructions("Test basic authentication. ");
            }
        });

        final FullWidthButton streamButton =
                new FullWidthButton("Stream Data Upload");
        streamButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int eventType) {
                menuManger.showStreamDataScreen();
View Full Code Here

    public MessageCancellationScreen(final CommunicationController controller) {
        setTitle("Cancel Messages");

        // Initialize UI components
        final FullWidthButton backButton = new FullWidthButton("Back");
        backButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                ((UiApplication) MessageCancellationScreen.this
                        .getApplication())
                        .popScreen(MessageCancellationScreen.this);
            }
        });

        // Set the destination to which messages will be to be sent:
        _uriSenderField =
                new EditField("Destination:",
                        CommunicationController.ECHO_SERVER_URI + "TEXT");

        final FullWidthButton destinationButton =
                new FullWidthButton("Set Destination");
        destinationButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.setNonBlockingSenderDestination(_uriSenderField
                        .getText());
            }
        });

        // First Message
        _contentField1 = new EditField("Message:", "Message One");
        final FullWidthButton postButton1 =
                new FullWidthButton("Send and Cancel (ALL)");
        postButton1.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.testMessageCancellable(_contentField1.getText(),
                        true); // cancellable = true

            }
        });

        // Second Message
        _contentField2 = new EditField("Message:", "Message Two");
        final FullWidthButton postButton2 =
                new FullWidthButton("Send and Cancel (NEVER)");
        postButton2.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.testMessageCancellable(_contentField2.getText(),
                        false); // Cancellable = false
            }
        });

        // Cancel all cancellable
        final FullWidthButton cancelButton =
                new FullWidthButton("Cancel All Cancellable");
        cancelButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.testCancelAllCancellable();
View Full Code Here

    public SendBlockScreen(final CommunicationController controller) {
        setTitle("Blocking");

        // Initialize UI components
        final FullWidthButton backButton = new FullWidthButton("Back");
        backButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                ((UiApplication) SendBlockScreen.this.getApplication())
                        .popScreen(SendBlockScreen.this);
            }
        });

        final LabelField instructions =
                new LabelField(
                        "Enter a destination URI and send a request message to it. "
                                + "The response will displayed in a pop-up screen.",
                        Field.NON_FOCUSABLE);

        _uriSenderField =
                new EditField("Sender URI:",
                        CommunicationController.ECHO_SERVER_URI + "TEXT", 140,
                        0);

        _gfProgress =
                new GaugeField("Timeout:", 0, CommunicationController.TIMEOUT,
                        0, GaugeField.PERCENT);
        _gfProgress.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1,
                1, 1, 1)));

        final FullWidthButton postButton =
                new FullWidthButton("Send message and receive response");
        postButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {

View Full Code Here

        // Initialize UI components

        _uriReceiverField = new EditField("Receiver URI:", PATH_STRING, 140, 0);

        _isBlocking = new CheckboxField("Blocking", false);
        _isBlocking.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                // Avoid conflict blocking and non-blocking destinations with
                // the same name
                if (_isBlocking.getChecked()) {
                    _uriReceiverField.setText(PATH_STRING + "9");
                } else {
                    _uriReceiverField.setText(PATH_STRING);
                }
            }
        });

        _autoStartEnabled =
                new CheckboxField("Auto-start when message arrives", true);

        final FullWidthButton backButton = new FullWidthButton("Back");
        backButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                ((UiApplication) ReceivePushScreen.this.getApplication())
                        .popScreen(ReceivePushScreen.this);
            }
        });

        final FullWidthButton startButton =
                new FullWidthButton("Start Receiver");
        startButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (_isBlocking.getChecked()) {
                    // Blocking receiver
                    controller.startBlockingReceiverBES(_uriReceiverField
                            .getText(), _autoStartEnabled.getChecked(),
                            CommunicationController.TIMEOUT);
                } else {
                    // Non blocking receiver
                    controller.startNonBlockingReceiverBES(_uriReceiverField
                            .getText(), _autoStartEnabled.getChecked());
                }

            }
        });

        final FullWidthButton pauseButton =
                new FullWidthButton("Pause Receiver");
        pauseButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.pauseReceiver(_uriReceiverField.getText());
            }
        });

        final FullWidthButton resumeButton =
                new FullWidthButton("Resume Receiver");
        resumeButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.resumeReceiver(_uriReceiverField.getText());
            }
        });

        final FullWidthButton releaseButton =
                new FullWidthButton("Release Receiver");
        releaseButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.releaseReceiver(_uriReceiverField.getText());

            }
        });

        final FullWidthButton destroyButton =
                new FullWidthButton("Destroy Receiver");
        destroyButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.destroyReceiver(_uriReceiverField.getText());
View Full Code Here

                new CommunicationController();

        // Initialize UI components
        final FullWidthButton sendFireForgetButton =
                new FullWidthButton("Send IPC Messages (Fire-and-Forget)");
        sendFireForgetButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                UiApplication.getUiApplication().pushScreen(
View Full Code Here

    public SendFireForgetScreen(final CommunicationController controller) {
        setTitle("Send IPC Messages (Fire-and-Forget)");

        // Initialize UI components
        _isLocal = new CheckboxField("Local Address ", true);
        _isLocal.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (_isLocal.getChecked()) {
                    // Local
                    _pathField.setText(PATH_STRING);
                    updateSenderField();
                } else {
                    // Http
                    _pathField.setText("--NOT USED--");
                    _uriSenderField
                            .setText(CommunicationController.ECHO_SERVER_URI
                                    + "TEXT");
                }

            }
        });

        _pathField = new EditField("Path:", PATH_STRING, 140, 0);
        _pathField.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                updateSenderField();
            }
        });

        _uriSenderField = new EditField("Sender URI:", "", 140, 0);

        final FullWidthButton backButton = new FullWidthButton("Back");
        backButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                ((UiApplication) SendFireForgetScreen.this.getApplication())
                        .popScreen(SendFireForgetScreen.this);
            }
        });

        final FullWidthButton postButton = new FullWidthButton("Send message");
        postButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                controller.sendFireForget(_uriSenderField.getText());
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.FieldChangeListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.