Package net.rim.device.api.ui.component

Examples of net.rim.device.api.ui.component.ButtonField


    manager.add(mKeyEntryField);
    manager.add(mStatusText);
    manager.add(mType);

    HorizontalFieldManager buttons = new HorizontalFieldManager(FIELD_HCENTER);
    mSubmitButton = new ButtonField(sResources.getString(SUBMIT),
        ButtonField.CONSUME_CLICK);
    mClearButton = new ButtonField(sResources.getString(CLEAR),
        ButtonField.CONSUME_CLICK);
    mCancelButton = new ButtonField(sResources.getString(CANCEL),
        ButtonField.CONSUME_CLICK);
    mSubmitButton.setChangeListener(this);
    mClearButton.setChangeListener(this);
    mCancelButton.setChangeListener(this);
    buttons.add(mSubmitButton);
View Full Code Here


        _previewField = new ColorPreviewField( initialColor );
        _previewField.setPadding( PADDING, PADDING, PADDING + PADDING_BOTTOM, PADDING );
        previewPane.add( _previewField );

        _okButton = new ButtonField( OK );
        _okButton.setChangeListener( this );
        previewPane.add( _okButton );

        add( previewPane );
    }
View Full Code Here

        _vfm = new VerticalFieldManager( NO_HORIZONTAL_SCROLL | NO_HORIZONTAL_SCROLLBAR | VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
        _vfm.add( _list );
        add( _vfm );

        if( _allowMultiple ) {
            _doneButton = new ButtonField( "Done", Field.FIELD_HCENTER );
            _doneButton.setChangeListener( this );

            add( new SeparatorField() );
            add( _doneButton );
        }
View Full Code Here

    return fieldManager;
  }

  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);
    VerticalFieldManager vfmLeft = new VerticalFieldManager();
    VerticalFieldManager vfmRight = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
    vfmLeft.add(labelField);
    vfmRight.add(buttonField);
    HorizontalFieldManager hfm = new HorizontalFieldManager();
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);
        HorizontalFieldManager hfm1 = new HorizontalFieldManager(HorizontalFieldManager.FIELD_RIGHT);
        hfm1.add(buttonField1);
        hfm1.add(buttonField2);
        VerticalFieldManager vfmLeft = new VerticalFieldManager();
        VerticalFieldManager vfmRight = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH);
View Full Code Here

    }

    private void initialize() {
        HorizontalFieldManager mgr = new HorizontalFieldManager( Field.FIELD_HCENTER );
        add( mgr );
        _ok = new ButtonField( "OK", Field.FIELD_HCENTER );
        _ok.setChangeListener( this );
        mgr.add( _ok );
        setEscapeEnabled( true );
    }
View Full Code Here

    geoTimeoutField.setChangeListener(this);   
   
    maxRetryDelayField = new NumericChoiceField("Maximum Retry Delay: ", 300, 43200, 300, 23);
    maxRetryDelayField.setChangeListener(this);   
   
    getSingleLocationField = new ButtonField("Get Single Location");
    getSingleLocationField.setChangeListener(this);
    getLastLocationField = new ButtonField("Get Last Location");
    getLastLocationField.setChangeListener(this);
    startTrackingField = new ButtonField("Start Tracking", Field.FIELD_RIGHT);
    startTrackingField.setChangeListener(this);
    stopTrackingField =  new ButtonField("Stop Tracking", Field.FIELD_RIGHT);
    stopTrackingField.setChangeListener(this);
    restartField = new ButtonField("Restart Tracking", Field.FIELD_RIGHT);
    restartField.setChangeListener(this);
    satellitesField = new ButtonField("Satellites");
    satellitesField.setChangeListener(this);
   
    locationField = new EditField("Location: ", "-");   
    locationTypeField = new EditField("Location Type: ", "-");   
    fixCountField = new EditField("Fix Count: ", "-");   
View Full Code Here

   */
  public SocialScreen() {
    setBorder(BorderFactory.createBitmapBorder(new XYEdges(9, 9, 9, 9), Bitmap.getBitmapResource("border.png")));
    setTitle(new LabelField("(: The Social App :)", DrawStyle.HCENTER|Field.FIELD_HCENTER))

    filePickButton = new ButtonField("Photo Share", Field.FIELD_HCENTER) {
      protected boolean navigationClick(int status, int time) {
        FilePicker picker = FilePicker.getInstance();
        picker.setFilter(".jpg:.png");
        picker.setView(FilePicker.VIEW_PICTURES);
        String path = picker.show();

        if (path != null) {
          // Creating the data context as a JSONObject
          JSONObject context = new JSONObject();
          try {
            context.put(SendCommandContextKeys.PATH, path);
            /**
             * Since we are sharing a file path, you CANNOT add a
             * SUBJECT or TEXT type data. Only PATH seems to be
             * allowed.
             */
          } catch (JSONException e) {

          }

          /**
           * Getting the available SendCommand(s) for our SendCommand
           * type TYPE_TEXT by providing our data context. The 3rd
           * parameter is a boolean that indicates whether you want
           * all results or just the results that are possible based on the context.
           * Ideally this boolean param would be set to false,
           * but there seems to be a bug with BBM as it throws an
           * exception during the query. As a workaround, I am getting
           * all first and then filtering out the ones I dont need.
           */
          commandsAll = SendCommandRepository.getInstance().get(SendCommand.TYPE_PATH, context, true);
          commands = new SendCommand[2];
                   
          for (int i = 0; i < commandsAll.length; i++) {           
            if (commandsAll[i].getId().equals(TWITTER_PATH_ID)) {
              commands[0] = commandsAll[i];
            }
            if (commandsAll[i].getId().equals(FACEBOOK_PATH_ID)) {
              commands[1] = commandsAll[i];
            }
          }
          // Displays our SendCommands to the user.
          displayCommands();
        }

        return true;
      }

      public int getPreferredWidth() {
        return Display.getWidth()/2;
      }
    };

    add(filePickButton);

    add(new SeparatorField());
    add(new SeparatorField());
    add(new SeparatorField());

    // An EditField to let the user type in the text to share.
    textField = new EditField("", "Share this please.");
    textField.setBorder(BorderFactory.createRoundedBorder(new XYEdges(3, 3, 3, 3)));
   
    // A button that initiates the Text Share
    shareTextButton = new ButtonField("Text Share", Field.FIELD_HCENTER) {
      protected boolean navigationClick(int arg0, int arg1) {
        // Creating the data context as a JSONObject
        JSONObject context = new JSONObject();
        try {
          context.put(SendCommandContextKeys.TEXT, textField.getText());
View Full Code Here

   */
  private void displayCommands() {
    SendDialog dialog = new SendDialog(Dialog.D_OK, "Lets be social!", Dialog.OK, null);
   
    if(commands[0]!=null){
      dialog.add(new ButtonField("Twitter") {
        protected boolean navigationClick(int status, int time) {
          try {
            commands[0].run();
          } catch (SendCommandException e) {
            SendDialog.inform(Dialog.D_OK, e.toString(), Dialog.OK, null);
          }
          UiApplication.getUiApplication().popScreen(getScreen());
          return true;
        }
 
        public int getPreferredWidth() {
          return Display.getWidth();
       
      });
    }
   
    if(commands[1]!=null){
      dialog.add(new ButtonField("Facebook") { 
        protected boolean navigationClick(int status, int time) {
          try {
            commands[1].run();
          } catch (SendCommandException e) {
            SendDialog.inform(Dialog.D_OK, e.toString(), Dialog.OK, null);
View Full Code Here

        add(_bearingEditField);

        _choiceField = new ObjectChoiceField("Admin Level:", choices, 0);
        add(_choiceField);

        _searchButton = new ButtonField("Search");
        _searchButton.setChangeListener(this);
        add(_searchButton);

        add(new SeparatorField());
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.component.ButtonField

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.