Package net.rim.device.api.ui

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


    public GeocodeDemoScreen() {
        setTitle("Geocode Demo");

        final FullWidthButton geocodeButton =
                new FullWidthButton("Geocode Screen");
        geocodeButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see net.rim.device.api.ui.FieldChangeListener#fieldChanged(Field,
             *      int)
             */
            public void fieldChanged(final Field field, final int context) {
                UiApplication.getUiApplication()
                        .pushScreen(new GeocodeScreen());

            }
        });

        final FullWidthButton reverseGeocodeButton =
                new FullWidthButton("Reverse Geocode Screen");
        reverseGeocodeButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see net.rim.device.api.ui.FieldChangeListener#fieldChanged(Field,
             *      int)
             */
            public void fieldChanged(final Field field, final int context) {
View Full Code Here


        // Start/end time selection
        final VerticalFieldManager vfm = new VerticalFieldManager();
        _choiceField =
                new ObjectChoiceField("When:", new Object[] { "Depart Now",
                        "Depart At", "Arrive At" }, 0);
        _choiceField.setChangeListener(new FieldChangeListener() {
            /**
             * @see net.rim.device.api.ui.FieldChangeListener#fieldChanged(Field,
             *      int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (context == ChoiceField.CONTEXT_CHANGE_OPTION) {
                    final int idx = _choiceField.getSelectedIndex();
                    if (idx == DEPART_NOW) {
                        _dateField.setEnabled(false);
                    } else {
                        _dateField.setEnabled(true);
                        _dateField.setFocus();
                    }
                }
            }
        });
        vfm.add(_choiceField);

        final DateFormat dateFormat =
                DateFormat.getInstance(DateFormat.DATETIME_DEFAULT);
        _dateField = new DateField("", System.currentTimeMillis(), dateFormat);
        _dateField.setEnabled(false);
        vfm.add(_dateField);

        add(vfm);

        // Initialize a button for intitiating a travel time query
        final HorizontalFieldManager hfm =
                new HorizontalFieldManager(Field.FIELD_HCENTER);
        final ButtonField travelButton =
                new ButtonField("Get Travel Time", ButtonField.CONSUME_CLICK
                        | ButtonField.NEVER_DIRTY);
        hfm.add(travelButton);
        add(hfm);
        travelButton.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(final Field field, final int context) {
                findTravelTime();
            }
        });

View Full Code Here

                        "TCP Wifi" };

        // Preferred transport types option
        _transportSelection =
                new CheckboxField("Preferred Transport Types [Optional]", false);
        _transportSelection.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(final Field field, final int context) {
                if (_transportSelection.getChecked()) {
                    // Transport selection check box is checked. Enable drop
                    // downs for choosing the preferred transport.
                    _order1.setEditable(true);
View Full Code Here

        // "Ok" button to close this screen
        final ButtonField okBtn =
                new ButtonField("Ok", Field.FIELD_HCENTER
                        | ButtonField.CONSUME_CLICK);
        okBtn.setChangeListener(new FieldChangeListener() {
            public void fieldChanged(final Field field, final int context) {
                // Close this screen
                close();
            }
        });
View Full Code Here

            _toggleButton =
                    new ButtonField("Default: " + defaultHandlerName,
                            ButtonField.NEVER_DIRTY | ButtonField.CONSUME_CLICK);

            _toggleButton.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(final Field field, final int context) {
                    final String newDefaultHandlerName = toggleDefaultHandler();
                    if (newDefaultHandlerName != null) {
                        _toggleButton.setLabel("default: "
                                + newDefaultHandlerName);
                    }
                }
            });

            _invokeButton =
                    new ButtonField("Invoke Handler", ButtonField.NEVER_DIRTY
                            | ButtonField.CONSUME_CLICK);

            _invokeButton.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(final Field field, final int context) {
                    doInvoke();
                }
            });
View Full Code Here

        // or as raw HTML.
        _renderBtn =
                new ButtonField("Render HTML", ButtonField.NEVER_DIRTY
                        | Field.FIELD_HCENTER | ButtonField.CONSUME_CLICK);
        _renderBtn.setEnabled(false);
        _renderBtn.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                if (_renderRaw) {
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.