Package net.rim.device.api.ui.container

Examples of net.rim.device.api.ui.container.GridFieldManager


  // ResponseListener Implementation
  public void searchResponse(Vector results) {
    if (results != null && results.size() > 0) {
      // Create the list of videos
      GridFieldManager resultsList = new GridFieldManager(results.size() * 2, 2, GridFieldManager.USE_ALL_WIDTH
          | GridFieldManager.USE_ALL_HEIGHT);
      resultsList.setColumnProperty(0, GridFieldManager.PREFERRED_SIZE, 0);
      resultsList.setColumnProperty(1, GridFieldManager.AUTO_SIZE, 0);
      resultsList.setColumnPadding(1);
      resultsList.setCellPadding(0);
      for (int i = 0; i < results.size(); i++) {
        VideoData data = (VideoData) results.elementAt(i);
        // Thumbnail
        BitmapFieldButton image = new BitmapFieldButton(_clock, BitmapField.FOCUSABLE);
        image.setSpace(2, 2);
        image.setCommandAction(new ThumbnailClick(data));
        data.setBitmapField(image);
        resultsList.add(image);
        // Text column
        VerticalFieldManager vfm = new VerticalFieldManager();
        vfm.add(new LabelField(data.getTitle(), LabelField.NON_FOCUSABLE));
        vfm.add(new LabelField(data.getDescription(), LabelField.USE_ALL_HEIGHT | LabelField.NON_FOCUSABLE
            | LabelField.ELLIPSIS));
        resultsList.add(vfm);
        // Break
        resultsList.add(new NullField(NullField.NON_FOCUSABLE));
        resultsList.add(new SeparatorField());
      }

      UiApplication.getUiApplication().invokeLater(new ResultsUpdater(resultsList));
    }

View Full Code Here


        // Define rows and columns
        final int rows = 4;
        final int cols = 3;

        // Instantiate a GridFieldManager with 4 rows and 3 columns
        final GridFieldManager gridFieldManager =
                new GridFieldManager(rows, cols, Field.FIELD_HCENTER);

        // Add a field to the screen to display a phone number
        _phoneNumberField =
                new BasicEditField("Phone number: ", "", 15,
                        Field.NON_FOCUSABLE);
        add(_phoneNumberField);

        add(new SeparatorField());

        // Instantiate button fields
        _buttonFieldOne =
                new ButtonField("1", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldTwo =
                new ButtonField("2", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldThree =
                new ButtonField("3", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldFour =
                new ButtonField("4", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldFive =
                new ButtonField("5", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldSix =
                new ButtonField("6", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldSeven =
                new ButtonField("7", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldEight =
                new ButtonField("8", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldNine =
                new ButtonField("9", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldStar =
                new ButtonField("*", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldZero =
                new ButtonField("0", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);
        _buttonFieldPound =
                new ButtonField("#", ButtonField.NEVER_DIRTY
                        | ButtonField.CONSUME_CLICK);

        // Add button fields to the GridFieldManager
        gridFieldManager.add(_buttonFieldOne);
        gridFieldManager.add(_buttonFieldTwo);
        gridFieldManager.add(_buttonFieldThree);
        gridFieldManager.add(_buttonFieldFour);
        gridFieldManager.add(_buttonFieldFive);
        gridFieldManager.add(_buttonFieldSix);
        gridFieldManager.add(_buttonFieldSeven);
        gridFieldManager.add(_buttonFieldEight);
        gridFieldManager.add(_buttonFieldNine);
        gridFieldManager.add(_buttonFieldStar);
        gridFieldManager.add(_buttonFieldZero);
        gridFieldManager.add(_buttonFieldPound);

        // Add the GridFieldManager to a VerticalFieldManager
        final VerticalFieldManager vfm =
                new VerticalFieldManager(USE_ALL_WIDTH);
        vfm.add(gridFieldManager);
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.container.GridFieldManager

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.