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

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


        /**
         * Create a new GPSDemoScreen object
         */
        GPSDemoScreen() {
            // Initialize UI
            _statusTextField = new TextField(Field.NON_FOCUSABLE);
            _statusTextField.setLabel("GPS Status: ");
            add(_statusTextField);
            final RichTextField instructions =
                    new RichTextField("Waiting for location update...",
                            Field.NON_FOCUSABLE);
View Full Code Here


    /**
     * Initializes the screen's UI elements and defines the button actions
     */
    private void initializeUiComponents() {
        _frequencyTextField = new TextField("Frequency [MHz]: ", "");

        _setFrequencyButton = new ButtonField("Set Frequency");
        _seekUpButton = new ButtonField("Seek >");
        _seekDownButton = new ButtonField("< Seek");
        _increaseRSSIButton = new ButtonField("RSSI +");
        _decreaseRSSIButton = new ButtonField("- RSSI");
        _playButton = new ButtonField("Play");

        _rssiLabel = new LabelField(_fmRadioDemoPlayer.getRSSI());

        _rdsTextField = new TextField(Field.NON_FOCUSABLE);
        _rdsTextField.setLabel("RDS: ");

        _logTextField = new TextField(Field.NON_FOCUSABLE);
        _logTextField.setLabel("Log: ");

        _playButton.setCommand(new Command(new CommandHandler() {
            public void execute(final ReadOnlyCommandMetadata data,
                    final Object context) {
View Full Code Here

        _numberValidUpdatesField = new EditField("Valid Updates: ", "0");
        _numberInvalidUpdatesField = new EditField("Invalid Updates: ", "0");
        _currentLocationField = new EditField("Location: ", "-");
        _lastValidFixField = new EditField("Last Valid Fix: ", "-");
        _lastResetField = new EditField("Last Reset: ", "-");
        _log = new TextField();
        _log.setLabel("Log: ");
    }
View Full Code Here

            topScrollingManager.add(new CustomField(color, i + 1
                    + " - This field is in the scrolling region"));
        }

        // Create edit field for input
        final TextField bottomInputField =
                new BasicEditField("Enter text: ", "");

        // Add the VerticalFieldManager and input field to a
        // JustifiedVerticalFieldManager
        final JustifiedVerticalFieldManager jvfm =
View Full Code Here

        // Cache if the device is a simulator or not
        final boolean isSim = DeviceInfo.isSimulator();

        // Add fields for displaying real time data
        _streamingManager = new VerticalFieldManager();
        _headingField = new TextField("Heading: ", "");
        _strengthField = new TextField("Field strength: ", "");
        _angleField = new TextField("Angle: ", "");
        _quaternionField = new TextField("Quaternion: ", "");
        _calibrationQualityField = new TextField("Calibration quality: ", "");
        _streamingManager.add(_headingField);
        _streamingManager.add(_angleField);
        _streamingManager.add(_quaternionField);
        _streamingManager.add(_strengthField);
        _streamingManager.add(_calibrationQualityField);
        _streamingManager.setPadding(4, 4, 4, 4);
        add(_streamingManager);

        // Add HorizontalFieldManager for buttons
        final HorizontalFieldManager buttonManager =
                new HorizontalFieldManager(FIELD_HCENTER);
        _snapshotButton = new ButtonField("Snapshot");
        _calibrateButton = new ButtonField("Calibrate");
        _snapshotButton.setChangeListener(this);
        _calibrateButton.setChangeListener(this);
        buttonManager.add(_snapshotButton);
        buttonManager.add(_calibrateButton);
        add(buttonManager);

        add(new SeparatorField());

        // Add fields for displaying snapshot data
        _snapshotManager = new VerticalFieldManager();
        _snapshotHeadingField = new TextField("Snapshot heading: ", "");
        _snapshotAngleField = new TextField("Snapshot angle: ", "");
        _snapshotStrengthField = new TextField("Snapshot field strength: ", "");
        _snapshotQualityField =
                new TextField("Snapshot calibration quality: ", "");
        _snapshotQuaternionField = new TextField("Snapshot quaternion: ", "");
        _snapshotManager.add(_snapshotHeadingField);
        _snapshotManager.add(_snapshotAngleField);
        _snapshotManager.add(_snapshotQuaternionField);
        _snapshotManager.add(_snapshotStrengthField);
        _snapshotManager.add(_snapshotQualityField);
        _snapshotManager.setPadding(4, 4, 4, 4);
        add(_snapshotManager);

        add(new SeparatorField());

        // The magnetometer channel will be opened with a sampling
        // frequency of 10 hertz and will be active only when the app
        // is in the foreground. This is the default configuration
        // that would be set automatically if the no arg constructor
        // for MagnetometerChannelConfig was used.
        final MagnetometerChannelConfig mcc =
                new MagnetometerChannelConfig(10, true, false);

        // Open up the magnetometer channel for reading data and
        // set this class as a MagnetometerListener.
        _magnetometerChannel = MagnetometerSensor.openChannel(app, mcc);
        _magnetometerChannel.addMagnetometerListener(this);

        // Cache the application for use later
        _app = app;

        // Start looking for the device's location and initialize
        // the GeomagneticField if on a real device.
        if (!isSim) {
            // Add the declination fields only if on a real device
            _declinationField = new TextField("Declination: ", "");
            _streamingManager.add(_declinationField);

            _snapshotDeclinationField =
                    new TextField("Snapshot declination: ", "");
            _snapshotManager.add(_snapshotDeclinationField);

            // Add field for displaying location status
            _locationInfo = new TextField("Location status: ", "");
            add(_locationInfo);

            // Add HorizontalFieldManager for the location information
            _locationManager = new HorizontalFieldManager(FIELD_HCENTER);
            add(_locationManager);

            _latitude = new TextField("Latitude : ", "");
            _longitude = new TextField("Longitude : ", "");
            _altitude = new TextField("Altitude : ", "");

            // Initialize the GeomagneticField in a non-event thread
            final Thread initializer = new Thread(new Runnable() {
                public void run() {
                    getLocation();
View Full Code Here

    /**
     * Initializes the UI fields
     */
    private void initFields() {
        _log = new TextField();
        _log.setLabel("Log: ");
        _primaryModeField =
                new ObjectChoiceField("Mode: ", new String[] {
                        "Stand Alone(s)", "Stand Alone(m)", "Data Optimal(m)",
                        "Speed Optimal(m)", "MS-Based(m)",
View Full Code Here

            if (fieldsByType != null) {
                // Build a vector of all the addresses
                final Vector addressVector = new Vector();
                final int size = fieldsByType.size();
                for (int fieldNo = 0; fieldNo < size; fieldNo++) {
                    final TextField addressField =
                            (TextField) fieldsByType.elementAt(fieldNo);

                    // Try to create a new address object wrapping the email
                    // address and add it to the address vector.
                    try {
                        addressVector.addElement(new Address(addressField
                                .getText(), ""));
                    } catch (final AddressException e) // Invalid address
                    {
                        BlackBerryMailDemo
                                .errorDialog("Address(String, String) threw "
                                        + e.toString());
                    }
                }

                // Dump the vector of addresses into an array to send the
                // message
                final Address[] addresses = new Address[addressVector.size()];
                addressVector.copyInto(addresses);

                // Try to add the addresses to the message's list of recipients
                try {
                    message.addRecipients(HEADER_KEYS[keyNo], addresses);
                } catch (final MessagingException e) {
                    BlackBerryMailDemo
                            .errorDialog("Message#addRecipients(int, Address[]) threw "
                                    + e.toString());
                }
            }
        }

        // Add the subject
        final Vector subjectFields = (Vector) _fieldTable.get(SUBJECT);
        final TextField subjectField =
                (TextField) subjectFields.elementAt(FIRST);

        if (subjectFields != null && subjectFields.size() > 0) {
            message.setSubject(subjectField.getText());
        }

        // Add the body by adding all the body fields into one multipart
        final Vector bodyFields = (Vector) _fieldTable.get(BODY);
        if (bodyFields != null) {
            final int size = bodyFields.size();
            final Multipart content = new Multipart();
            for (int fieldNo = 0; fieldNo < size; fieldNo++) {
                final TextField body =
                        (TextField) bodyFields.elementAt(fieldNo);
                content.addBodyPart(new TextBodyPart(content, body.getText()));
            }
            try {
                message.setContent(content);
            } catch (final MessagingException e) {
                BlackBerryMailDemo
View Full Code Here

TOP

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

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.