Package net.rim.device.api.util

Examples of net.rim.device.api.util.StringProvider


             *
             * @param record
             *            The phone record to delete
             */
            private Delete(final PhoneNumberRecord record) {
                super(new StringProvider("Delete"), 0x230030, 110);
                this.setCommand(new Command(new CommandHandler() {
                    /**
                     * Deletes the phone record
                     *
                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
View Full Code Here


        _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);
        saveItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

    /**
     * Creates a new EventScreen object
     */
    public EventScreen() {
        final MenuItem saveMenuItem =
                new MenuItem(new StringProvider("Save Event"), 0x230020, 1);
        saveMenuItem.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 successful display message and close screen.
                if (onSave()) {
                    Dialog.alert("Event was saved successfully");
                    UiApplication.getUiApplication().pushScreen(
                            new EventScreen());
                    onClose();
                }
            }
        }));
        ;

        _invitees = new Vector();
        // MenuItem for adding an invite field to the create screen
        final MenuItem inviteContactMenuItem =
                new MenuItem(new StringProvider("Invite Contact"), 0x230010, 0);
        inviteContactMenuItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

    /**
     * Creates a new ContactScreen object
     */
    public ContactScreen() {
        final MenuItem saveMenuItem =
                new MenuItem(new StringProvider("Save Contact"), 0x230010, 5);
        saveMenuItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

            add(fields[i]);
        }

        // Menu item to edit this screen's memo.
        final MenuItem editItem =
                new MenuItem(new StringProvider("Edit Memo"), 100, 100);
        editItem.setCommand(new Command(new CommandHandler() {

            /**
             * Pushes an edit screen to the display stack, passing it the memo
             * to edit. Upon returning from the edit screen, the view screen is
View Full Code Here

            add(fields[i]);
        }

        // Represents a menu item for saving the screen's memo.
        final MenuItem saveMenuItem =
                new MenuItem(new StringProvider("Save Memo"), 0x230010, 100);
        saveMenuItem.setCommand(new Command(new CommandHandler() {

            /**
             * Attempts to save the screen's data to its associated memo. If
             * successful, the edit screen is popped from the display stack.
View Full Code Here

                        getActiveChoice());
        add(_choiceField);

        // Menu item to initiate outgoing call with the selected line
        final MenuItem _callWithSelectedLineMenuItem =
                new MenuItem(new StringProvider("Call With Selected Line"),
                        0x230010, 0);
        _callWithSelectedLineMenuItem.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 String text = _basicEditField.getText();
                        if (text == null || text.trim().length() == 0) {
                            Dialog.alert("Please enter phone number");
                        } else {
                            final Choice choice =
                                    (Choice) _choiceField
                                            .getChoice(_choiceField
                                                    .getSelectedIndex());
                            try {
                                // If the selected line is not currently active,
                                // the
                                // following method call will set it as active
                                // as
                                // well as place the call.
                                Phone.initiateCall(choice.getLineId(), text);
                            } catch (final RadioException re) {
                                PhoneMultiLineDemo
                                        .messageDialog("Phone.initiateCall(int, String) threw "
                                                + re.toString());
                            }
                        }
                    }
                }));
        addMenuItem(_callWithSelectedLineMenuItem);

        final MenuItem _switchLineMenuItem =
                new MenuItem(new StringProvider("Switch To The Selected Line"),
                        0x230020, 1);
        _switchLineMenuItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
View Full Code Here

        add(_view);

        // Menu item to create a new memo
        final MenuItem newMemoItem =
                new MenuItem(new StringProvider("New memo"), 0x230010, 0);
        newMemoItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // New memos are in UNDECIDED mode by default
                final Memo memo =
                        new Memo(MultiServicePlatformManager
                                .getDefaultUndecidedServiceUid());

                _uiApp.pushScreen(new MemoScreen(memo, -1));
            }
        }));

        _deleteItem = new MenuItem(new StringProvider("Delete"), 0x230040, 3);
        _deleteItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

        _uuid = uuid;
        _statusField = new RichTextField(Field.NON_FOCUSABLE);
        add(_statusField);

        final MenuItem infoScreen =
                new MenuItem(new StringProvider("Info Screen"), 0x230010, 0);
        infoScreen.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

         * @see net.rim.device.api.ui.container.MainScreen#makeMenu(Menu,int)
         */
        protected void makeMenu(final Menu menu, final int instance) {
            if (_infoField.getTextLength() > 0) {
                final MenuItem copyContents =
                        new MenuItem(new StringProvider("Copy Contents"),
                                0x230010, 0);
                copyContents.setCommand(new Command(new CommandHandler() {
                    /**
                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                     *      Object)
View Full Code Here

TOP

Related Classes of net.rim.device.api.util.StringProvider

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.