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

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


        _uiApp = (PersistentStoreDemo) UiApplication.getUiApplication();
        _screen = this;

        // Initialize UI components
        _nameField =
                new EditField("Meeting Name: ", _meeting
                        .getField(Meeting.MEETING_NAME));
        _descField =
                new EditField("Description: ", _meeting.getField(Meeting.DESC));
        _dateField = new EditField("Date: ", _meeting.getField(Meeting.DATE));
        _timeField = new EditField("Time: ", _meeting.getField(Meeting.TIME));
        _notesField =
                new EditField("Notes: ", _meeting.getField(Meeting.NOTES));
        add(_nameField);
        add(_descField);
        add(_dateField);
        add(_timeField);
        add(_notesField);

        // Menu item to save the displayed meeting
        final MenuItem saveItem =
                new MenuItem(new StringProvider("Save"), 0x230020, 11);
        saveItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                if (onSave()) {
                    close();
                }
            }
        }));

        // Menu item to add an attendee to meeting
        final MenuItem addAttendeeItem =
                new MenuItem(new StringProvider("Add Attendee"), 0x230010, 10);
        addAttendeeItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                final VerticalFieldManager vfm = new VerticalFieldManager();
                _popUp = new PopupScreen(vfm);
                _addAttendeeField = new EditField("Enter Name: ", "");
                _popUp.add(_addAttendeeField);
                final HorizontalFieldManager hfm =
                        new HorizontalFieldManager(Field.FIELD_HCENTER);
                hfm.add(new AddButton());
                hfm.add(new CancelButton());
View Full Code Here


                        "Enter a destination URI and send a request message to it. "
                                + "The response will displayed in a pop-up screen.",
                        Field.NON_FOCUSABLE);

        _uriSenderField =
                new EditField("Sender URI:",
                        CommunicationController.ECHO_SERVER_URI + "TEXT", 140,
                        0);

        _gfProgress =
                new GaugeField("Timeout:", 0, CommunicationController.TIMEOUT,
View Full Code Here

    public OTAContactScreen() {
        _saveMenuItem = new SaveMenuItem();

        setTitle("Contact");

        _first = new EditField("First: ", "");
        add(_first);

        _last = new EditField("Last: ", "");
        add(_last);

        _email =
                new EditField("Email: ", "", TextField.DEFAULT_MAXCHARS,
                        BasicEditField.FILTER_EMAIL);
        add(_email);
    }
View Full Code Here

        _pdePortField = new BasicEditField("PDE Port: ", "");
        _supportedSourcesField = new BasicEditField("Supported Sources: ", "-");
        _availableSourcesField = new BasicEditField("Available Sources: ", "-");
        _currentModeField = new BasicEditField("Current Mode: ", "-");
        _currentSatellitesCountField = new BasicEditField("Satellites: ", "-");
        _currentLocationField = new EditField("Location: ", "-");
        _currentAverageSatelliteSignalField =
                new EditField("Satellite Signal: ", "-");
        _currentDataSourceField = new EditField("Data Source: ", "-");
        _currentErrorField = new EditField("Error: ", "-");
        _currentStatusField = new EditField("Status: ", "-");
        _numberUpdatesField = new EditField("Total Updates: ", "0");
        _numberAssistedUpdatesField = new EditField("Assisted: ", "0");
        _numberUnassistedUpdatesField = new EditField("Unassisted: ", "0");
        _numberValidUpdatesField = new EditField("Valid Updates: ", "0");
        _numberInvalidUpdatesField = new EditField("Invalid Updates: ", "0");
    }
View Full Code Here

     */
    protected void displayMessageInformation() {
        // Add a field describing the source service
        final ServiceConfiguration sc =
                _message.getFolder().getStore().getServiceConfiguration();
        final EditField service =
                new EditField("Service: ", sc.getName(), MAX_CHARS,
                        Field.READONLY | Field.NON_FOCUSABLE);
        addTextFieldToTableAndScreen(service, INFO);

        // Add the folder field
        final EditField folder =
                new EditField("Folder: ", _message.getFolder().getName(),
                        MAX_CHARS, Field.READONLY | Field.NON_FOCUSABLE);
        addTextFieldToTableAndScreen(folder, INFO);

        // Add the status of the message
        final String statusString = getStatusString(_message);
        final EditField status =
                new EditField("Status: ", statusString, MAX_CHARS,
                        Field.READONLY | Field.NON_FOCUSABLE);
        addTextFieldToTableAndScreen(status, INFO);
    }
View Full Code Here

                        name = addresses[index].getAddr();
                    }

                    // Create the edit field, associate the address to the field
                    // and add it to the screen and collection of fields.
                    final EditField headerField =
                            new EditField(HEADER_NAMES[key], name,
                                    TextField.DEFAULT_MAXCHARS, editableStyle);
                    headerField.setCookie(addresses[index]);

                    addTextFieldToTableAndScreen(headerField, HEADER_KEYS[key]);
                }
            } catch (final MessagingException e) {
                BlackBerryMailDemo
                        .errorDialog("Error: could not retrieve message header.");
                close();
            }
        }

        // Display the 'Sent' date if it is available
        final Date sent = _message.getSentDate();
        if (sent != null) {
            final EditField sentDate =
                    new EditField("Sent: ", Util.getDateAsString(sent),
                            TextField.DEFAULT_MAXCHARS, Field.READONLY
                                    | Field.NON_FOCUSABLE);

            // Change the label to "Saved: " if the message hasn't been sent yet
            if (_message.getStatus() == Message.Status.TX_COMPOSING) {
                sentDate.setLabel("Saved: ");
            }

            add(sentDate);
        }

        // Display the 'Received' date if the message was an inbound message
        final Date recieved = _message.getSentDate();
        if (_message.isInbound() && recieved != null) {
            final EditField sentDate =
                    new EditField("Recieved: ", Util.getDateAsString(recieved),
                            TextField.DEFAULT_MAXCHARS, Field.READONLY
                                    | Field.NON_FOCUSABLE);
            add(sentDate);
        }

        // If the message was received, retrieve and display who sent the
        // message
        if (_message.isInbound()) {
            try {
                final Address from = _message.getFrom();
                String name = from.getName();
                if (name == null || name.length() == 0) {
                    name = from.getAddr();
                }

                final EditField fromField =
                        new EditField("From: ", name,
                                TextField.DEFAULT_MAXCHARS, editableStyle);
                fromField.setCookie(from);
                add(fromField);
            } catch (final MessagingException e) {
                BlackBerryMailDemo
                        .errorDialog("Error: could not retrieve message sender.");
                close();
            }
        }

        // Display the subject field
        String subject = _message.getSubject();
        if (subject == null) {
            subject = NO_SUBJECT;
        }

        final EditField subjectField =
                new EditField("Subject: ", subject, TextField.DEFAULT_MAXCHARS,
                        editableStyle);
        addTextFieldToTableAndScreen(subjectField, SUBJECT);
    }
View Full Code Here

        // Ensure there is at least one body field if nothing was displayed
        final Vector bodyVector = (Vector) _fieldTable.get(BODY);
        if (bodyVector == null || bodyVector.size() == 0) {
            if (_editable) {
                addTextFieldToTableAndScreen(new EditField("", ""), BODY);
            } else {
                addTextFieldToTableAndScreen(new RichTextField(""), BODY);
            }
        }
    }
View Full Code Here

                // Display the plain text, using an EditField if the message is
                // editable or a RichTextField if it is not editable. Note: this
                // does not add any empty fields.
                if (plainText.length() != 0) {
                    if (_editable) {
                        addTextFieldToTableAndScreen(new EditField("",
                                plainText), BODY);
                    } else {
                        addTextFieldToTableAndScreen(new RichTextField(
                                plainText), BODY);
                    }
View Full Code Here

        // Initialize UI components
        setTitle("UDP Demo");

        final UdpDemoVFM verticalManager = new UdpDemoVFM();
        _messageField =
                new EditField("Type a message to send: \n", "", 256,
                        Field.USE_ALL_HEIGHT);
        verticalManager.add(_messageField);
        add(verticalManager);

        final HorizontalFieldManager hfm =
View Full Code Here

        _saveMenuItem = new SaveMenuItem();

        setTitle(new LabelField("Contact", DrawStyle.ELLIPSIS
                | Field.USE_ALL_WIDTH));

        _first = new EditField("First: ", "");
        add(_first);

        _last = new EditField("Last: ", "");
        add(_last);

        _email =
                new EditField("Email: ", "", TextField.DEFAULT_MAXCHARS,
                        BasicEditField.FILTER_EMAIL);
        add(_email);

        addMenuItem(_saveMenuItem);
    }
View Full Code Here

TOP

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

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.