Package net.rim.device.api.util

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


    private final class SelectContactAction extends MenuItem {
        /**
         * Creates a new SelectContactAction object
         */
        private SelectContactAction() {
            super(new StringProvider("Select Contact"), 0x230010, 0);
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
 
View Full Code Here


        if (filePath == null) {
            throw new NullPointerException("File path can not be null");
        }

        _commit =
                new MenuItem(new StringProvider("Commit recording"), 0x230010,
                        0);
        _commit.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                commitRecording();
            }
        }));

        _playRecording =
                new MenuItem(new StringProvider("Play recording"), 0x230020, 0);
        _playRecording.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Create the playback screen from the chosen video source
                VideoPlaybackScreen playbackScreen;

                if (_recordToStream) {
                    playbackScreen =
                            new VideoPlaybackScreen(new ByteArrayInputStream(
                                    _outStream.toByteArray()));
                } else {
                    playbackScreen = new VideoPlaybackScreen(_videoFile);
                }

                // Hide the video feed since we cannot display video from the
                // camera
                // and video from a file at the same time.
                _videoControl.setVisible(false);
                _displayVisible = false;

                UiApplication.getUiApplication().pushScreen(playbackScreen);

            }
        }));

        _reset =
                new MenuItem(new StringProvider("Reset recording"), 0x230030, 0);
        _reset.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                try {
                    _recordControl.reset();
                } catch (final Exception e) {
                    VideoRecordingDemo.errorDialog("RecordControl#reset threw "
                            + e.toString());
                }
            }
        }));

        _showDisplay =
                new MenuItem(new StringProvider("Show display"), 0x230040, 0);
        _showDisplay.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                _videoControl.setVisible(true);
                _displayVisible = true;
            }
        }));

        _hideDisplay =
                new MenuItem(new StringProvider("Hide display"), 0x230050, 0);
        _hideDisplay.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                _videoControl.setVisible(false);
                _displayVisible = false;
            }
        }));

        _startRecord =
                new MenuItem(new StringProvider("Start recording"), 0x230060, 0);
        _startRecord.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                startRecord();
            }
        }));

        _stopRecord =
                new MenuItem(new StringProvider("Stop recording"), 0x230070, 0);
        _stopRecord.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                stopRecord();
            }
        }));

        _toggleFlash =
                new MenuItem(new StringProvider("Toggle flash"), 0x230080, 0);
        _toggleFlash.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                int newMode;
                switch (_flashControl.getMode()) {
                case FlashControl.OFF:
                    newMode = FlashControl.FORCE;
                    break;
                default:
                    newMode = FlashControl.OFF;
                }

                try {
                    _flashControl.setMode(newMode);
                } catch (final Exception e) {
                }
            }
        }));

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

        /**
         * Creates a new AddContactAction object
         */
        private AddContactAction() {
            super(new StringProvider("Add New Contact"), 0x230020, 1);
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
 
View Full Code Here

            add(_view);

            // Menu item that deletes all the phone number records.
            _deleteAllItem =
                    new MenuItem(new StringProvider("Delete All"), 0x230010, 0);
            _deleteAllItem.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
 
View Full Code Here

    private final class AddItem extends MenuItem {
        /**
         * Creates a new AddItem object
         */
        private AddItem() {
            super(new StringProvider("Add Memo"), 0x230010, 100);
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
 
View Full Code Here

         *
         * @param memo
         *            The memo to copy
         */
        private CopyItem(final BlackBerryMemo memo) {
            super(new StringProvider("Add Copy of Memo"), 0x230020, 200);
            _memo = memo;
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

         *
         * @param memo
         *            The memo to view
         */
        private ViewItem(final BlackBerryMemo memo) {
            super(new StringProvider("View Memo"), 0x230030, 50);
            _memo = memo;
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

         *
         * @param memo
         *            The memo to edit
         */
        private EditItem(final BlackBerryMemo memo) {
            super(new StringProvider("Edit Memo"), 0x230040, 400);
            _memo = memo;
            this.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

             *
             * @param record
             *            The record to view
             */
            private View(final PhoneNumberRecord record) {
                super(new StringProvider("View"), 0x230020, 100);
                _record = record;
                this.setCommand(new Command(new CommandHandler() {
                    /**
                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                     *      Object)
View Full Code Here

         *
         * @param memo
         *            The memo to delete
         */
        private DeleteItem(final BlackBerryMemo memo) {
            super(new StringProvider("Delete Memo"), 0x230050, 500);
            this.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.