Package net.rim.device.api.ui.container

Examples of net.rim.device.api.ui.container.MainScreen


     * @param isMainGui
     *            True if constructor should create GUI, false otherwise
     */
    public MessageListDemo(final boolean isMainGui) {
        if (isMainGui) {
            final MainScreen mainScreen = new MainScreen();
            mainScreen.setTitle("Message List Demo");
            mainScreen
                    .add(new RichTextField(
                            "Please choose one of the menu options, then open the Messages application from the home "
                                    + "screen to manipulate Message List Demo messages. You can open, reply to, mark opened and unopened, delete and search "
                                    + "for messages in the list."));
            addMenuItems(mainScreen);
View Full Code Here


        /**
         * @see Field#layout(int, int)
         */
        protected void layout(final int width, final int height) {
            final UiApplication uiApp = UiApplication.getUiApplication();
            final MainScreen mainScreen = (MainScreen) uiApp.getActiveScreen();
            final Manager manager = mainScreen.getMainManager();
            int availableHeight = Display.getHeight();
            final int fieldCount = manager.getFieldCount();

            for (int i = fieldCount - 1; i >= 0; --i) {
                final Field field = manager.getField(i);
View Full Code Here

        CustomButtonField fullscreen;
        CustomButtonField colour;
        PictureBackgroundButtonField picture;

        // MainScreen is the basic screen or frame class of the RIM UI.
        final MainScreen mainScreen = new MainScreen();

        // Set the displayed title of the screen.
        mainScreen.setTitle("Custom Buttons Demo");

        // Add a vertical field manager containing sample custom button fields.
        final VerticalFieldManager vfm = new VerticalFieldManager();

        // Rectangular button
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        rectangle =
                new CustomButtonField("Rectangle", CustomButtonField.RECTANGLE,
                        Field.FOCUSABLE);
        rectangle.setChangeListener(this);
        vfm.add(rectangle);

        // Triangular button
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        triangle =
                new CustomButtonField("Triangle", CustomButtonField.TRIANGLE,
                        Field.FOCUSABLE);
        triangle.setChangeListener(this);
        vfm.add(triangle);

        // Octagonal button
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        octagon =
                new CustomButtonField("Octagon", CustomButtonField.OCTAGON,
                        Field.FOCUSABLE);
        octagon.setChangeListener(this);
        vfm.add(octagon);

        // The next two buttons showcase the ability to hold a fixed width
        // for a button regardless of how long the text in the button is.
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        fixedWidth1 =
                new CustomButtonField("Fixed Width",
                        CustomButtonField.FIXED_WIDTH, Field.FOCUSABLE);
        fixedWidth1.setChangeListener(this);
        vfm.add(fixedWidth1);

        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        fixedWidth2 =
                new CustomButtonField("Fixed Width: Long!",
                        CustomButtonField.FIXED_WIDTH, Field.FOCUSABLE);
        fixedWidth2.setChangeListener(this);
        vfm.add(fixedWidth2);

        // Button that will always stretch the entire width of the screen.
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        fullscreen =
                new CustomButtonField("Full Screen",
                        CustomButtonField.FULLSCREEN, Field.FOCUSABLE);
        fullscreen.setChangeListener(this);
        vfm.add(fullscreen);

        // Button with a coloured background
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        colour =
                new CustomButtonField("Colour",
                        CustomButtonField.COLOUR_BACKGROUND, Field.FOCUSABLE);
        colour.setChangeListener(this);
        vfm.add(colour);

        // Button using a picture as a background. The picture will change
        // when the button recieves focus.
        vfm.add(new RichTextField(Field.NON_FOCUSABLE));
        picture = new PictureBackgroundButtonField("Picture", Field.FOCUSABLE);
        picture.setChangeListener(this);
        vfm.add(picture);

        mainScreen.add(vfm);

        // We've completed construction of our UI objects. Push the MainScreen
        // instance onto the UI stack for rendering.
        pushScreen(mainScreen);
    }
View Full Code Here

    /**
     * Creates a new MMSDemo object
     */
    public MMSDemo() {
        _messageParts = new TableModel();
        _blankScreen = new MainScreen();
        _blankScreen.setTitle("MMS Demo");
        pushScreen(_blankScreen);
        chooseModeDialog();
    }
View Full Code Here

    public ServiceRoutingDemo() {
        // Save the current application instance for later use.
        _app = UiApplication.getUiApplication();

        // Create the MainScreen and add the appropriate UI fields.
        _screen = new MainScreen();
        _screen.setTitle("Service Routing Demo");

        final ServiceRouting sr = ServiceRouting.getInstance();
        sr.addListener(this);
        _statusField =
View Full Code Here

                     * @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
                     *      Object)
                     */
                    public void execute(final ReadOnlyCommandMetadata metadata,
                            final Object context) {
                        final MainScreen screen = new MainScreen();

                        screen.setTitle(new LabelField("View Phone Record"));

                        final PhoneNumberRecordDisplayer displayer =
                                new PhoneNumberRecordDisplayer(_record);
                        final Vector fields = displayer.getFields();
                        final int numFields = fields.size();

                        for (int i = 0; i < numFields; ++i) {
                            screen.add((Field) fields.elementAt(i));
                        }

                        screen.addKeyListener(new PhoneApiDemoKeyListener(
                                screen));

                        PhoneApiDemo.this.pushScreen(screen);
                    }
                }));
View Full Code Here

    /**
     * Constructor. Creates and displays the application's main screen.
     */
    public MemoApiDemo() {
        final MainScreen mainScreen = new MemoMainScreen();

        mainScreen.setTitle("Memo API Demo");
        pushScreen(mainScreen);
    }
View Full Code Here

     */
    public void inform(final Result result) {
        // Close the viewfinder first
        UiApplication.getUiApplication().popScreen(_vfScreen);

        final MainScreen resultsScreen = new MainScreen();

        final LabelField text =
                new LabelField("Barcode Text: " + result.getText());
        text.setPadding(4, 4, 4, 4);

        final LabelField type =
                new LabelField("Barcode Type: "
                        + result.getBarcodeFormat().toString());
        type.setPadding(4, 4, 4, 4);

        final TransitionContext context =
                new TransitionContext(TransitionContext.TRANSITION_SLIDE);
        context.setIntAttribute(TransitionContext.ATTR_DIRECTION,
                TransitionContext.KIND_OUT);

        Ui.getUiEngineInstance().setTransition(null, resultsScreen,
                UiEngineInstance.TRIGGER_PUSH, context);

        resultsScreen.add(text);
        resultsScreen.add(type);

        UiApplication.getUiApplication().pushScreen(resultsScreen);
    }
View Full Code Here

                    initializeCamera(new BarcodeDecoder(hints),
                            _imageDecoderListener);

            // If the field was constructed successfully, create the UI
            if (cameraField != null) {
                _vfScreen = new MainScreen();
                _vfScreen.add(cameraField);
                UiApplication.getUiApplication().pushScreen(_vfScreen);
            }
        }
View Full Code Here

        // Turn on images in html. Change 'true' to 'false'
        // to disable image rendering.
        renderingOptions.setProperty(RenderingOptions.CORE_OPTIONS_GUID,
                RenderingOptions.SHOW_IMAGES_IN_HTML, true);

        _mainScreen = new MainScreen();
        _mainScreen.add(new LabelField("Label before the content",
                Field.FOCUSABLE));

        _mainScreen.add(_browserContentManager);
View Full Code Here

TOP

Related Classes of net.rim.device.api.ui.container.MainScreen

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.