Package net.rim.device.api.ui

Examples of net.rim.device.api.ui.UiApplication


             * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
             *      Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                final UiApplication app = UiApplication.getUiApplication();
                app.pushModalScreen(new EditMemoScreen(_controller.getMemo(),
                        false)); // Blocks until edit screen is popped.
                app.popScreen(ViewMemoScreen.this); // Now that edit screen is
                                                    // popped, pop this view
                                                    // screen as well.
            }
        }));
        // Add the menu item to the screen.
View Full Code Here


     *
     * @param linkableContact
     *            The contact for which to fire an event
     */
    public static void fireEvent(final LinkableContact linkableContact) {
        final UiApplication app = UiApplication.getUiApplication();
        app.invokeLater(new Runnable() {
            public void run() {
                app.pushGlobalScreen(
                        new EventScreen(linkableContact, getTime()), 0,
                        UiEngine.GLOBAL_MODAL);
            }
        });
    }
View Full Code Here

     */
    public MediaPlayerDemo() {
        _volume = 40;
        _mediaActions = new MediaPlayerActions(this);

        final UiApplication app = UiApplication.getUiApplication();
        _applicationRef = new WeakReference(app);

        _screen = new MediaPlayerDemoScreen(this);
        _screen.setOnCloseRunnable(new Runnable() {
            public void run() {
View Full Code Here

        _volume = newVolume;

        // Update the user interface
        final MediaPlayerDemoScreen screen = _screen;
        if (screen != null) {
            final UiApplication app = getApplication();
            if (app != null) {
                app.invokeLater(new Runnable() {
                    public void run() {
                        screen.setVolume(newVolume);
                    }
                });
            }
View Full Code Here

    /**
     * Releases all resources held by this object
     */
    private void close() {
        final UiApplication app = getApplication();
        if (app != null) {
            app.removeMediaActionHandler(this);
        }

        _currentAction = null;
        _mediaActions = null;
        _screen = null;
View Full Code Here

    /**
     * Executes the demo
     */
    public void run() {
        final UiApplication app = getApplication();
        if (app == null) {
            return;
        }

        // Register the MediaActionHandler and MediaKeyListener
        app.addMediaActionHandler(this);
        app.addKeyListener(new MyMediaKeyListener());

        // Push the main screen onto the display stack
        final MediaPlayerDemoScreen screen = _screen;
        if (screen != null) {
            app.invokeLater(new Runnable() {
                public void run() {
                    app.pushScreen(screen);
                }
            });
        }

        // Load the playlist, copying the files into the filesystem if they do
        // not exist
        final StatusScreen statusScreen =
                new StatusScreen("Initializing media");
        app.invokeLater(new Runnable() {
            public void run() {
                app.pushScreen(statusScreen);
            }
        });

        PlaylistEntry[] playlist;
        try {
            playlist = PlayList.getPlaylistEntries();
        } catch (final IOException e) {
            MediaPlayerDemo.errorDialog("ERROR: " + e.getMessage());
            playlist = null;
        } finally {
            app.invokeLater(new Runnable() {
                public void run() {
                    app.popScreen(statusScreen);
                }
            });
        }

        // Update the screen to show the playlist
        this._playlist = playlist;
        if (playlist != null && screen != null) {
            app.invokeAndWait(new Runnable() {
                public void run() {
                    screen.setPlaylist(_playlist);
                }
            });
        }
View Full Code Here

                    + "mute audio: " + e);
        }

        final MediaPlayerDemoScreen screen = _handler.getScreen();
        if (screen != null) {
            final UiApplication app = UiApplication.getUiApplication();
            app.invokeLater(new Runnable() {
                public void run() {
                    screen.setMuted(mute);
                }
            });
        }
View Full Code Here

     *            Command line arguments (not used)
     */
    public static void main(final String[] args) {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        final UiApplication app = new TableAndListDemo();
        app.enterEventDispatcher();
    }
View Full Code Here

                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {

                    // If successful, return to contact list.
                    if (onSave()) {
                        final UiApplication uiapp =
                                UiApplication.getUiApplication();
                        uiapp.popScreen(uiapp.getActiveScreen());
                    }
                }
            }));
        }
View Full Code Here

                 */
                public void execute(final ReadOnlyCommandMetadata metadata,
                        final Object context) {
                    // If successful, return to contact list.
                    if (onSave()) {
                        final UiApplication uiapp =
                                UiApplication.getUiApplication();
                        uiapp.popScreen(uiapp.getActiveScreen());
                    }
                }
            }));
        }
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.UiApplication

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.