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

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


        _app = app;

        // Initialize UI components
        setTitle("MMS Demo");
        _addressField =
                new EditField("Destination:", "", MAX_PHONE_NUMBER_LENGTH,
                        BasicEditField.FILTER_PHONE);
        add(_addressField);
        add(new SeparatorField());
        _subjectField = new EditField("Subject:", "");
        add(_subjectField);
        _messageField = new EditField("Message:", "");
        add(_messageField);
        add(new SeparatorField());
        final LabelField attachmentText = new LabelField("Attachments");
        add(attachmentText);

        // Create table components
        _view = new TableView(_app.getMessageParts());
        final TableController controller =
                new TableController(_app.getMessageParts(), _view);
        controller.setFocusPolicy(TableController.ROW_FOCUS);
        _view.setController(controller);

        // Set the highlight style for the view
        _view.setDataTemplateFocus(BackgroundFactory
                .createLinearGradientBackground(Color.LIGHTBLUE,
                        Color.LIGHTBLUE, Color.BLUE, Color.BLUE));

        // Create a data template that will format the model data as an array of
        // LabelFields
        final DataTemplate dataTemplate = new DataTemplate(_view, 1, 1) {
            public Field[] getDataFields(final int modelRowIndex) {
                final MessagePart message =
                        (MessagePart) _app.getMessageParts().getRow(
                                modelRowIndex);
                final Field[] fields =
                        { new LabelField(message.getContentLocation(),
                                Field.NON_FOCUSABLE | DrawStyle.ELLIPSIS) };
                return fields;
            }
        };

        // Define the regions of the data template and column/row size
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1));
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(
                Display.getWidth()));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(24));

        _view.setDataTemplate(dataTemplate);
        dataTemplate.useFixedHeight(true);

        // Add the file to the screen
        add(_view);

        _status = new EditField();
        add(_status);

        // Menu item to attach a picture to the MMS
        final MenuItem attachPicture =
                new MenuItem(new StringProvider("Attach Picture"), 0x230010, 0);
View Full Code Here


        // This manager will contain the search result list field
        final VerticalFieldManager vfm =
                new VerticalFieldManager(VERTICAL_SCROLL);

        _searchInput = new EditField("Search:", "", 30, TextField.NO_NEWLINE);
        _searchInput.setChangeListener(this);

        _listField = new DemoListField();
        _listField.setCallback(this);
View Full Code Here

                    final VerticalFieldManager vfm = new VerticalFieldManager();
                    _popUp = new PopupScreen(vfm);
                    final LabelField popUpLabel =
                            new LabelField("Correction for "
                                    + _testField.getText() + ":");
                    _correction = new EditField();
                    _popUp.add(popUpLabel);
                    _popUp.add(_correction);
                    final HorizontalFieldManager hfm =
                            new HorizontalFieldManager(Field.FIELD_HCENTER);
                    hfm.add(new OkButton());
View Full Code Here

                // Create a Dialog instance which will allow a user to add a new
                // country to the keyword list.
                final String[] selections = { "Add", "Cancel" };
                final Dialog addDialog =
                        new Dialog("Add Country", selections, null, 0, null);
                final EditField inputField = new EditField("Country: ", "");
                addDialog.add(inputField);

                // Display the dialog and add a new element to the list
                // of countries.
                if (addDialog.doModal() == 0) // User selected "Add"
                {
                    _app.addElementToList(new Country(inputField.getText(), "",
                            ""));
                }
            }
        }));
View Full Code Here

        _index = index;

        // Cache a reference to the application
        _uiApp = (BlackBerryBalanceDemo) UiApplication.getUiApplication();

        _nameField = new EditField("Title: ", _memo.getField(Memo.MEMO_NAME));
        add(_nameField);

        add(new SeparatorField());

        _contentField = new EditField("", _memo.getField(Memo.MEMO_CONTENT));
        add(_contentField);

        // Menu item to save the displayed memo
        final MenuItem saveItem =
                new MenuItem(new StringProvider("Save"), 0x230020, 0);
View Full Code Here

                Contact contact;
                // Get selected contact from contact list.
                if ((contact = _contactListScreen.getSelectedContact()) != null) {
                    final String name = PIMDemo.getDisplayName(contact);

                    final EditField newField =
                            new EditField("Invite: ", name,
                                    TextField.DEFAULT_MAXCHARS, Field.READONLY);

                    if (_invitees.isEmpty()) // Add a separator to screen.
                    {
                        insert(new SeparatorField(), getFieldCount());
                    }

                    // Store contact for email retrieval.
                    _invitees.addElement(contact);
                    insert(newField, getFieldCount());
                }
            }
        }));
        setTitle("PIM Demo");

        _subject = new EditField("Subject: ", "");
        add(_subject);

        _location = new EditField("Location: ", "");
        add(_location);

        final long currentTime = System.currentTimeMillis();
        _startTime =
                new DateField("Start: ", currentTime + 3600000,
                        DateField.DATE_TIME);
        _endTime =
                new DateField("End: ", currentTime + 7200000,
                        DateField.DATE_TIME);

        add(new SeparatorField());

        add(_startTime);
        add(_endTime);

        add(new SeparatorField());

        _desc = new EditField("Description: ", "");
        add(_desc);

        add(new SeparatorField());
        final String choices[] =
                { "None", "Daily", "Weekly", "Monthly", "Yearly" };
View Full Code Here

            }
        }));

        setTitle("Create 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);

        _home =
                new EditField("Home: ", "", TextField.DEFAULT_MAXCHARS,
                        BasicEditField.FILTER_PHONE);
        add(_home);

        _home2 =
                new EditField("Home2: ", "", TextField.DEFAULT_MAXCHARS,
                        BasicEditField.FILTER_PHONE);
        add(_home2);

        addMenuItem(saveMenuItem);
    }
View Full Code Here

    private BluetoothSerialPortDemo() {
        final BluetoothDemoScreen mainScreen = new BluetoothDemoScreen();
        mainScreen.setTitle(new LabelField("Bluetooth Serial Port Demo",
                Field.USE_ALL_WIDTH));

        _infoField = new EditField(Field.READONLY);
        mainScreen.add(_infoField);

        pushScreen(mainScreen);

        invokeLater(new Runnable() {
View Full Code Here

                                    + "TEXT");
                }
            }
        });

        _pathField = new EditField("Path:", PATH_STRING, 140, 0);
        _pathField.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
             */
            public void fieldChanged(final Field field, final int context) {
                updateSenderField();
            }
        });

        _uriSenderField = new EditField("Sender URI:", "", 140, 0);

        final FullWidthButton backButton = new FullWidthButton("Back");
        backButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
View Full Code Here

        setTitle("JSON");

        _callback = new SendNonBlockJsonScreenCallback(this);

        _uriSenderField =
                new EditField("URI:", CommunicationController.ECHO_SERVER_URI
                        + "JSON", 140, 0);
        final FullWidthButton postButton = new FullWidthButton("Get Data");
        postButton.setChangeListener(new FieldChangeListener() {
            /**
             * @see FieldChangeListener#fieldChanged(Field, int)
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.