Package net.rim.device.api.util

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


    private class SaveMenuItem extends MenuItem {
        /**
         * Creates a new SaveMenuItem object
         */
        private SaveMenuItem() {
            super(new StringProvider("Save"), 0x230010, 5);
            this.setCommand(new Command(new CommandHandler() {

                /**
                 * Saves the contact and closes this screen
                 *
 
View Full Code Here


        }

        buffer.append("Allow Zooming");

        final MenuItem zoomItem =
                new MenuItem(new StringProvider(buffer.toString()), 0x230010, 0);
        zoomItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                _restrictedMapAction.toggleZooming();
            }

        }));
        menu.add(zoomItem);

        // Reset buffer
        buffer.setLength(0);

        if (_restrictedMapAction.isPanningAllowed()) {
            buffer.append(Characters.CHECK_MARK).append(' ');
        }

        buffer.append("Allow Panning");

        final MenuItem setCenterItem =
                new MenuItem(new StringProvider(buffer.toString()), 0x230020, 1);
        setCenterItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

    private static class BackMenuItem extends MenuItem {
        /**
         * Creates a new BackMenuItem object
         */
        private BackMenuItem() {
            super(new StringProvider("Back"), 0x230020, 5);
            this.setCommand(new Command(new CommandHandler() {

                /**
                 * Closes this screen
                 *
 
View Full Code Here

                            Field.NON_FOCUSABLE);
            add(instructions);

            // Menu Item to add the current location to the list of WayPoints
            final MenuItem markWayPoint =
                    new MenuItem(new StringProvider("Mark waypoint"), 0x230010,
                            0);
            markWayPoint.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
                    GPSDemo.this.markPoint();
                }
            }));

            // Menu Item to view the marked WayPoints
            final MenuItem viewWayPoints =
                    new MenuItem(new StringProvider("View waypoints"),
                            0x230020, 1);
            viewWayPoints.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

                "Edit latitude, longitude and zoom level settings and select View Map from the menu.",
                Field.NON_FOCUSABLE));

        // Displays a map of a specified locaton.
        final MenuItem viewMapItem =
                new MenuItem(new StringProvider("View Map"), 0x230020, 0);
        viewMapItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

        vfm.add(_view);
        add(vfm);

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

        _deletePointAction =
                new MenuItem(new StringProvider("Delete"), 0x230020, 1);
        _deletePointAction.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 meeting
        final MenuItem newMeetingItem =
                new MenuItem(new StringProvider("New Meeting"), 0x230010, 0);
        newMeetingItem.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 Meeting meeting = new Meeting();
                _uiApp.pushScreen(new MeetingScreen(meeting, -1, true));
            }
        }));

        viewItem = new MenuItem(new StringProvider("View"), 0x230020, 1);
        viewItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                displayMeeting(false);
            }
        }));

        editItem = new MenuItem(new StringProvider("Edit"), 0x230030, 2);
        editItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                displayMeeting(true);
            }
        }));

        deleteItem = new MenuItem(new StringProvider("Delete"), 0x230040, 3);
        deleteItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Retrieve the highlighted Meeting object and remove it from
                // the
                // vector, then update the list field to reflect the change.
                final int i = _view.getRowNumberWithFocus();
                final String meetingName =
                        ((Meeting) _uiApp.getMeetings().elementAt(i))
                                .getField(Meeting.MEETING_NAME);
                final int result =
                        Dialog.ask(Dialog.DELETE, "Delete " + meetingName + "?");
                if (result == Dialog.YES) {
                    _model.removeRowAt(i);
                }
            }
        }));

        // Menu item to gain access to the controlled object
        final MenuItem retrieveItem =
                new MenuItem(new StringProvider("Access controlled object"),
                        0x230050, 0);
        retrieveItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
View Full Code Here

         * Creates a new USBScreen object
         */
        private USBScreen() {
            // Connects through a GCF USB connection
            final MenuItem connectGCF =
                    new MenuItem(new StringProvider("Connect (GCF)"), 0x230010,
                            0);
            connectGCF.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
                    // Cleanup the old thread if present
                    onExit();

                    _usbThread = new GCFUsbThread();
                    connect();
                }
            }));
            /*
             * Connects through a low level USB connection.
             */
            final MenuItem connectLowLevel =
                    new MenuItem(new StringProvider("Connect (low level)"),
                            0x230020, 1);
            connectLowLevel.setCommand(new Command(new CommandHandler() {
                /**
                 * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                 *      Object)
View Full Code Here

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

        _message = new StringBuffer();

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

            // Initialize the camera features menus
            buildFocusModeMenuItems();
            buildSceneModeMenuItems();

            _turnOffAutoFocusMenuItem =
                    new MenuItem(new StringProvider("Turn Off Auto-Focus"),
                            0x230020, 0);
            _turnOffAutoFocusMenuItem.setCommand(new Command(
                    new CommandHandler() {
                        /**
                         * @see CommandHandler#execute(ReadOnlyCommandMetadata,
                         *      Object)
                         */
                        public void execute(
                                final ReadOnlyCommandMetadata metadata,
                                final Object context) {
                            try {
                                if (_efc != null) {
                                    _efc.stopAutoFocus();
                                } else {
                                    CameraDemo
                                            .errorDialog("ERROR: Focus control not initialized.");
                                }
                            } catch (final Exception e) {
                                CameraDemo.errorDialog("ERROR " + e.getClass()
                                        + ":  " + e.getMessage());
                            }
                        }
                    }));

            _turnOnAutoFocusMenuItem =
                    new MenuItem(new StringProvider("Turn on Auto-Focus"),
                            0x230020, 0);
            _turnOnAutoFocusMenuItem.setCommand(new Command(
                    new CommandHandler() {
                        /**
                         * @see CommandHandler#execute(ReadOnlyCommandMetadata,
                         *      Object)
                         */
                        public void execute(
                                final ReadOnlyCommandMetadata metadata,
                                final Object context) {
                            try {
                                if (_efc != null) {
                                    _efc.startAutoFocus();
                                } else {
                                    CameraDemo
                                            .errorDialog("ERROR: Focus control not initialized.");
                                }
                            } catch (final Exception e) {
                                CameraDemo.errorDialog("ERROR " + e.getClass()
                                        + ":  " + e.getMessage());
                            }
                        }
                    }));

            final MenuItem encodingMenuItem =
                    new MenuItem(new StringProvider("Encoding Settings"),
                            0x230010, 0);
            encodingMenuItem.setCommand(new Command(new CommandHandler() {
                /**
                 * @see 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.