Package net.rim.device.api.ui

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


 
  protected void onUiEngineAttached(boolean attached) {
    super.onUiEngineAttached(attached);
   
    ObjectChoiceField categoryChoiceField = new ObjectChoiceField("", categories, 0, Field.FIELD_LEFT);
    categoryChoiceField.setChangeListener(new FieldChangeListener() {     
      public void fieldChanged(Field field, int context) {
        if (context == ChoiceField.CONTEXT_CHANGE_OPTION) {
          ChoiceField choiceField = (ChoiceField) field;
          int index = choiceField.getSelectedIndex();
          if (index >= 0) {
View Full Code Here


  }

  protected Field createCheckBoxAndTextField(String label, boolean checked, final Execution exec, String text) {
    HorizontalFieldManager fieldManager = new HorizontalFieldManager();
    final CheckboxField checkBoxField = new CheckboxField(label, checked, NO_USE_ALL_WIDTH);
    FieldChangeListener changeListener = new FieldChangeListener() {
      public void fieldChanged(Field field, int context) {
        boolean checked = checkBoxField.getChecked();
        if (!exec.execute(new Boolean(checked))) {
          checkBoxField.setChecked(!checked);
        }
View Full Code Here

  }

  protected Field createLabelAndButtonField(String label, String buttonText, final Execution execution) {
    LabelField labelField = new LabelField(label, Field.FIELD_LEFT);
    ButtonField buttonField = new ButtonField(buttonText, Field.FIELD_RIGHT | ButtonField.CONSUME_CLICK);
    FieldChangeListener changeListener = new FieldChangeListener() {
      public void fieldChanged(Field field, int context) {
        execution.execute(null);
      }
    };
    buttonField.setChangeListener(changeListener);
View Full Code Here

  protected Field createLabelAndTwoButtonsField(String label, String buttonText1, final Execution execution1, String buttonText2, final Execution execution2) {
    LabelField labelField = new LabelField(label, Field.FIELD_LEFT);
    labelField.setPadding(5, 0, 5, 0);
    ButtonField buttonField1 = new ButtonField(buttonText1, Field.FIELD_RIGHT | ButtonField.CONSUME_CLICK);
    FieldChangeListener changeListener1 = new FieldChangeListener() {
      public void fieldChanged(Field field, int context) {
        execution1.execute(null);
      }
    };
    buttonField1.setChangeListener(changeListener1);
    ButtonField buttonField2 = new ButtonField(buttonText2, Field.FIELD_RIGHT | ButtonField.CONSUME_CLICK);
    FieldChangeListener changeListener2 = new FieldChangeListener() {
      public void fieldChanged(Field field, int context) {
        execution2.execute(null);
      }
    };
    buttonField2.setChangeListener(changeListener2);
View Full Code Here

  protected Field createLabelAndChoiceField(String label, Object[] choices, final Object initialChoice, final Execution execution) {
    final ObjectChoiceField choiceField = new ObjectChoiceField(label, choices);
    if (initialChoice != null) {
      choiceField.setSelectedIndex(initialChoice);
      FieldChangeListener changeListener = new FieldChangeListener() {
        public void fieldChanged(Field field, int context) {
          if (context == ChoiceField.CONTEXT_CHANGE_OPTION) {
            Object selection = choiceField.getChoice(choiceField.getSelectedIndex());
            if (selection != null) {
              if (!execution.execute(selection)) {
View Full Code Here

            // Create a third pane
            vfm = new VerticalFieldManager();
            final ButtonField button =
                    new ButtonField("Button", ButtonField.CONSUME_CLICK
                            | ButtonField.NEVER_DIRTY);
            button.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(final Field field, final int context) {
                    Dialog.inform("Button activated.");
                }
            });
            vfm.add(button);
View Full Code Here

            _filePicker.setTitle("Choose file");

            // Initialize a check box for toggling the file filter
            final CheckboxField checkBox =
                    new CheckboxField("Filter", false, Field.FIELD_HCENTER);
            checkBox.setChangeListener(new FieldChangeListener() {
                /**
                 * @see FieldChangeListener#fieldChanged(Field, int)
                 */
                public void fieldChanged(final Field field, final int context) {
                    if (checkBox.getChecked()) {
                        // Set the FilePicker to filter by extension
                        FilePickerDemoScreen.this.setFilter(true);
                        _filterTextChoiceField.setEditable(true);
                        _viewChoiceField.setSelectedIndex(0);
                        _viewChoiceField.setEditable(false);
                    } else {
                        // Disable the filter
                        FilePickerDemoScreen.this.setFilter(false);
                        _filterTextChoiceField.setEditable(false);
                        _viewChoiceField.setEditable(true);
                    }
                }
            });
            add(checkBox);

            // Add a choice field for specifying file filter type
            String[] choices = new String[] { "All", "MP3", "JPG", "MPG" };
            _filterTextChoiceField =
                    new ObjectChoiceField("Filter extension: ", choices, 0);
            add(_filterTextChoiceField);
            _filterTextChoiceField.setChangeListener(new FieldChangeListener() {
                /**
                 * @see FieldChangeListener#fieldChanged(Field, int)
                 */
                public void fieldChanged(final Field field, final int context) {
                    FilePickerDemoScreen.this.setFilter(true);
                }
            });
            _filterTextChoiceField.setEditable(false);

            // Initialize a choice field for highlight style selection
            choices =
                    new String[] { "Default", "Pictures", "Ring Tones",
                            "Music", "Videos", "Voice Notes" };
            _viewChoiceField =
                    new ObjectChoiceField("View: ", choices,
                            FilePicker.VIEW_ALL);
            _viewChoiceField.setChangeListener(new FieldChangeListener() {
                /**
                 * @see FieldChangeListener#fieldChanged(Field, int)
                 */
                public void fieldChanged(final Field field, final int context) {
                    // Change the view type for the FilePicker
                    final int index = _viewChoiceField.getSelectedIndex();
                    switch (index) {
                    case FilePicker.VIEW_ALL:
                        _filePicker.setTitle("Choose file");
                        _filePicker.setView(FilePicker.VIEW_ALL);
                        break;
                    case FilePicker.VIEW_PICTURES:
                        _filePicker.setTitle("Choose picture");
                        _filePicker.setView(FilePicker.VIEW_PICTURES);
                        break;
                    case FilePicker.VIEW_RINGTONES:
                        _filePicker.setTitle("Choose ringtone");
                        _filePicker.setView(FilePicker.VIEW_RINGTONES);
                        break;
                    case 3:
                        _filePicker.setTitle("Choose music");
                        _filePicker.setView(FilePicker.VIEW_MUSIC);
                        break;
                    case 4:
                        _filePicker.setTitle("Choose video");
                        _filePicker.setView(FilePicker.VIEW_VIDEOS);
                        break;
                    case 5:
                        _filePicker.setTitle("Choose voice note");
                        _filePicker.setView(FilePicker.VIEW_VOICE_NOTES);
                        break;
                    }
                }
            });
            add(_viewChoiceField);

            add(new SeparatorField());

            // Add a button to display the FilePicker
            _buttonField =
                    new ButtonField("Choose File", Field.FIELD_HCENTER
                            | ButtonField.CONSUME_CLICK);
            _buttonField.setChangeListener(new FieldChangeListener() {
                /**
                 * @see FieldChangeListener#fieldChanged(Field, int)
                 */
                public void fieldChanged(final Field field, final int context) {
                    _filePicker.show();
View Full Code Here

        final FullWidthButton jsonBtn = new FullWidthButton("JSON");
        final FullWidthButton rssBtn = new FullWidthButton("RSS");
        final FullWidthButton soapBtn = new FullWidthButton("SOAP");
        final FullWidthButton xmlBtn = new FullWidthButton("XML");

        atomBtn.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendNonBlockAtomScreen();
            }
        });

        jsonBtn.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendNonBlockJsonScreen();
            }
        });

        rssBtn.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendNonBlockRssScreen();
            }
        });

        soapBtn.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendNonBlockSoapScreen();
            }
        });

        xmlBtn.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                menuManager.showSendNonBlockXmlScreen();
View Full Code Here

        _uriSenderField =
                new EditField("URI:", CommunicationController.ECHO_SERVER_URI
                        + "SOAP", 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

        _uriSenderField =
                new EditField("URI:", CommunicationController.ECHO_SERVER_URI
                        + "ATOM", 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

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.