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

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


    }

    private void indicateReceiver() {
        icon = new BitmapField(rcv_icon);
        icon_row.add(icon);
        icon_row.add(new LabelField(" - LLCP receiver"));
        add(icon_row);
    }
View Full Code Here


   * @param title
   * @since 1.2
   */
  public void addTitle(String title) {
    if (this.title instanceof LabelField) {
      LabelField titleLabel = (LabelField) this.title;
      titleLabel.setText(title);
    } else {
      if (this.title != null) {
        this.delete(this.title);
      }
      this.title = new Title(title, Title.ELLIPSIS);
View Full Code Here

     */
    public TravelTimeDemoScreen() {
        setTitle("Travel Time Demo");

        // Initialize status field
        _statusField = new LabelField("");
        setStatus(_statusField);

        // Free form address entry field
        _addressField =
                new BasicEditField("Destination: ", "", 500,
                        TextField.NO_NEWLINE);
        add(_addressField);

        // 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();
            }
        });

        // Add labels to display travel time results
        _startLabel = new LabelField();
        add(_startLabel);
        _endLabel = new LabelField();
        add(_endLabel);
        _elapsedLabel = new LabelField();
        add(_elapsedLabel);
        _distanceLabel = new LabelField();
        add(_distanceLabel);
    }
View Full Code Here

     * Creates a new InvokeMapViewScreen object
     */
    InvokeMapViewScreen() {
        setTitle("Invoke Map View");

        final LabelField instructions =
                new LabelField(
                        "Select 'View Map' from the menu.  The MapView object is set to Zoom Level 3. Location is Ottawa, ON, Canada at Latitude 45.42349, Longitude -75.69792");
        add(instructions);

        // Invokes BlackBerry Maps application using a MapView object
        final MenuItem viewMapItem =
View Full Code Here

                        Field.FIELD_HCENTER);
        add(_views[1]);
        add(new SeparatorField());

        // Add a centered ActivityIndicatorView between two focusable fields
        add(new LabelField("focusable field", Field.FOCUSABLE));
        bitmap = Bitmap.getBitmapResource("spinner2.png");
        _views[2] =
                ActivityIndicatorFactory.createActivityIndicator(
                        Field.FIELD_HCENTER, bitmap, 6, Field.FIELD_HCENTER,
                        "centered between focusable fields",
                        Field.FIELD_HCENTER);
        add(_views[2]);
        add(new LabelField("focusable field", Field.FOCUSABLE));
        add(new SeparatorField());

        // Add a right justified ActivityIndicatorView
        bitmap = Bitmap.getBitmapResource("spinner.png");
        _views[3] =
                ActivityIndicatorFactory.createActivityIndicator(
                        Field.USE_ALL_WIDTH, bitmap, 5, Field.FIELD_RIGHT,
                        "right justified layout", Field.FIELD_VCENTER);
        add(_views[3]);
        add(new SeparatorField());

        Background background; // Reuse this reference

        // Add an ActivityIndicatorView featuring a solid black background
        bitmap = Bitmap.getBitmapResource("orchid.png");
        background = BackgroundFactory.createSolidBackground(Color.BLACK);
        _views[4] =
                ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 6,
                        0);
        _views[4].setBackground(background);
        add(_views[4]);
        add(new LabelField("solid background"));
        add(new SeparatorField());

        // Add an ActivityIndicatorView to another ActivityIndicatorView
        bitmap = Bitmap.getBitmapResource("progress.png");
        background = BackgroundFactory.createSolidBackground(Color.DARKGRAY);
View Full Code Here

            displayTitle(_currentCampus);
            add(_map);

            // Create label fields to display address of highlighted site.
            _addressBar1 =
                    new LabelField("", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH);
            _addressBar2 =
                    new LabelField("", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH);

            // Add the address label fields to the screen's status section.
            final VerticalFieldManager statusVFM = new VerticalFieldManager();
            statusVFM.add(_addressBar1);
            statusVFM.add(_addressBar2);
View Full Code Here

         * Creates a new ScreenTransitionsDemoScreen object
         */
        ScreenTransitionsDemoScreen() {
            setTitle("Screen Transitions Demo");

            add(new LabelField(
                    "Click trackpad or screen to start and stop animation",
                    Field.NON_FOCUSABLE));
        }
View Full Code Here

    public RichListScreen(final DemoStringTokenizer deviceData) {
        super(Manager.NO_VERTICAL_SCROLL);

        setTitle("Rich List Screen");

        add(new LabelField("BlackBerry Devices", Field.FIELD_HCENTER));
        add(new SeparatorField());

        // Get this screen's main manager (VerticalFieldManager)
        final Manager mainManager = getMainManager();
View Full Code Here

        _searchButton.setChangeListener(this);
        add(_searchButton);

        add(new SeparatorField());

        _resultsField = new LabelField();
        add(_resultsField);
    }
View Full Code Here

        final VerticalFieldManager fieldManager = new VerticalFieldManager();

        final Background background =
                BackgroundFactory.createSolidBackground(Color.LIGHTBLUE);

        final LabelField dateLabel =
                new LabelField("Date Field", Field.FIELD_HCENTER);
        dateLabel.setBackground(background);
        fieldManager.add(dateLabel);

        // Add a typical date field to the VerticalFieldManager
        _dateField =
                new DateField("Date/time: ", System.currentTimeMillis(),
                        DateField.DATE_TIME);
        fieldManager.add(_dateField);

        fieldManager.add(new SeparatorField());

        // Add UI elements to the VerticalFieldManager, including fields
        // which will allow a user to make selections from date/time and
        // custom spinners.
        final LabelField dateTimeLabel =
                new LabelField("Date Time Picker", Field.FIELD_HCENTER);
        dateTimeLabel.setBackground(background);
        fieldManager.add(dateTimeLabel);

        _editFieldDefault = new SelectionField("Default: ");
        fieldManager.add(_editFieldDefault);

        _editFieldDate = new SelectionField("Date only: ");
        fieldManager.add(_editFieldDate);

        _editFieldTime = new SelectionField("Time only: ");
        fieldManager.add(_editFieldTime);

        _editFieldLong = new SelectionField("Long date: ");
        fieldManager.add(_editFieldLong);

        _editFieldExpiry = new SelectionField("Expiry date: ");
        fieldManager.add(_editFieldExpiry);

        fieldManager.add(new SeparatorField());

        final LabelField textSpinLabel =
                new LabelField("Text Spin Box Field", Field.FIELD_HCENTER);
        textSpinLabel.setBackground(background);
        fieldManager.add(textSpinLabel);

        _editFieldSpinbox = new SelectionField("City: ");
        fieldManager.add(_editFieldSpinbox);
View Full Code Here

TOP

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

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.