Examples of StringProvider


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

            paneManagerView.setController(controller);

            add(paneManagerView);

            final MenuItem myItem =
                    new MenuItem(new StringProvider("Switch View"), 0x230010, 0);
            myItem.setCommand(new Command(new SwitchViewCommandHandler(
                    paneManagerView, leftArrow, rightArrow, edgesFour)));
            addMenuItem(myItem);
        }
View Full Code Here

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

        initFields();
        _isVerizonField.setChangeListener(this);

        // A MenuItem to start the diagnostic test
        final MenuItem startTestItem =
                new MenuItem(new StringProvider("Start Test"), 0x300010, 0);
        ;
        startTestItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Format the UI for output
                showOutputFields();

                // Begin test
                if (_locThread != null) {
                    if (!_locThread.isStopped()) {
                        _locThread.stop();
                    }
                }

                _log.setText("");
                log("Extended GPS API test starting");
                log("Device: " + DeviceInfo.getDeviceName());
                log("Device Software: " + DeviceInfo.getSoftwareVersion());
                log("Carrier: " + RadioInfo.getCurrentNetworkName());

                _locThread = new LocationThread();
                _locThread.start();
            }
        }));
        addMenuItem(startTestItem);
        _stopTestItem =
                new MenuItem(new StringProvider("Stop Test"), 0x300020, 1);
        _stopTestItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                // Stop the thread
                log("Stopping test");
                _locThread.stop();
                _locThread = null;
            }
        }));
        addMenuItem(_stopTestItem);

        // A MenuItem to display the help dialog
        final MenuItem helpItem =
                new MenuItem(new StringProvider("Help"), 0x300030, 2);
        helpItem.setCommand(new Command(new CommandHandler() {
            /**
             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
 
View Full Code Here

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

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

        }

        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

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

    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

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

                            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

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

                "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

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

        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

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

        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

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

         * 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
TOP
Copyright © 2018 www.massapi.com. 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.