Examples of VerticalFieldManager


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

     * Adds UI components to a VerticalFieldManager
     *
     * @return Manager containing UI components
     */
    private Manager createFreeFormManager() {
        final VerticalFieldManager manager = new VerticalFieldManager();

        _freeFormEditField = new BasicEditField("Freeform: ", "");
        manager.add(_freeFormEditField);

        return manager;
    }
View Full Code Here

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

        // 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.
View Full Code Here

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

             *
             * @param bitmapField
             *            <code>BitmapField</code> to display inside this popup
             */
            public BitmapDemoPopup(final BitmapField bitmapField) {
                super(new VerticalFieldManager());
                add(bitmapField);
            }
View Full Code Here

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

        // Add a field which will not scroll
        add(new CustomField(Color.WHITE, "This field does not scroll"));

        // Create a scrollable VerticalFieldManager
        final VerticalFieldManager scrollingRegion =
                new VerticalFieldManager(USE_ALL_HEIGHT | VERTICAL_SCROLL
                        | VERTICAL_SCROLLBAR);

        // Add fields to the scrollable region, alternating background color
        for (int i = 0; i < 15; ++i) {
            final int color = colors[i % 2];
            scrollingRegion.add(new CustomField(color, i + 1
                    + " - This field is in the scrolling region"));
        }

        // Add the VerticalfieldManager to the screen
        add(scrollingRegion);
View Full Code Here

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

     * @param fileholder
     *            Used to retrieve the file information
     */
    public FileExplorerDemoScreenFileInfoPopup(
            final FileExplorerDemoFileHolder fileholder) {
        super(new VerticalFieldManager());
        add(new LabelField("File Information"));
        add(new SeparatorField());
        add(new LabelField(fileholder.getFileName()));
        add(new LabelField(""));

View Full Code Here

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

        // Construct and populate a model with the WayPoints and their
        // associated indices.
        _model = new WayPointTableModelAdapter();

        final VerticalFieldManager vfm = new VerticalFieldManager() {
            /**
             * @see net.rim.device.api.ui.Screen#keyChar(char, int, int)
             */
            protected boolean keyChar(final char key, final int status,
                    final int time) {
                if (key == Characters.ENTER) {
                    displayWayPoint();
                    return true;
                }

                return super.keyChar(key, status, time);
            }
        };

        // Create the view
        _view = new TableView(_model);

        // Create the controller
        _controller = new TableController(_model, _view);
        _controller.setCommand(new Command(new CommandHandler() {
            /**
             * @see CommandHandler#execute(ReadOnlyCommandMetadata, Object)
             */
            public void execute(final ReadOnlyCommandMetadata metadata,
                    final Object context) {
                displayWayPoint();
            }

        }));

        _view.setController(_controller);

        // Set the highlight style for the view
        _view.setDataTemplateFocus(BackgroundFactory
                .createLinearGradientBackground(Color.LIGHTBLUE,
                        Color.LIGHTBLUE, Color.BLUE, Color.BLUE));

        // Create a data template that will format the model data as an array of
        // LabelFields
        final DataTemplate dataTemplate = new DataTemplate(_view, 1, 1) {
            public Field[] getDataFields(final int modelRowIndex) {
                final Field[] fields =
                        { new LabelField("Waypoint " + modelRowIndex,
                                DrawStyle.ELLIPSIS | Field.NON_FOCUSABLE) };

                return fields;
            }
        };

        // Define the regions of the data template and column/row size
        dataTemplate.createRegion(new XYRect(0, 0, 1, 1));
        dataTemplate.setColumnProperties(0, new TemplateColumnProperties(
                Display.getWidth()));
        dataTemplate.setRowProperties(0, new TemplateRowProperties(24));

        _view.setDataTemplate(dataTemplate);
        dataTemplate.useFixedHeight(true);

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

        _viewPointAction =
                new MenuItem(new StringProvider("View"), 0x230010, 0);
        _viewPointAction.setCommand(new Command(new CommandHandler() {
View Full Code Here

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

     * @param screen
     *            The screen that spawned this Dialog
     */
    public FileUploadDialog(final FileHolder fileHolder,
            final FileExplorerScreen screen) {
        super(new VerticalFieldManager());

        _fileHolder = fileHolder;
        _screen = screen;

        setPadding(getPaddingTop(), 0, getPaddingBottom(), 0);
View Full Code Here

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

        _publishButton.setChangeListener(this);
        _addFromFileButton.setChangeListener(this);
        _searchButton.setChangeListener(this);

        // Add fields to manager
        final VerticalFieldManager vfm =
                new VerticalFieldManager(VERTICAL_SCROLL);
        vfm.add(_listField);
        vfm.add(new SeparatorField());
        vfm.add(_addButton);
        vfm.add(new SeparatorField());
        vfm.add(_addFromFileButton);
        vfm.add(new SeparatorField());
        vfm.add(_publishButton);
        vfm.add(new SeparatorField());
        vfm.add(_searchButton);

        add(vfm);
    }
View Full Code Here

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

     *            the string for the title of this screen - may be null
     * @param text
     *            the help text to display - may be null
     */
    public HelpScreen(final String title, final String text) {
        this(title, text, new VerticalFieldManager(Manager.VERTICAL_SCROLL
                | Manager.VERTICAL_SCROLLBAR));
    }
View Full Code Here

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

        // This manager will facilitate input being directed to the search field
        final SearchScreenVerticalFieldManager scvfm =
                new SearchScreenVerticalFieldManager();

        // This manager will contain the search result list field
        final VerticalFieldManager vfm =
                new VerticalFieldManager(VERTICAL_SCROLL);

        _searchInput = new EditField("Search:", "", 30, TextField.NO_NEWLINE);
        _searchInput.setChangeListener(this);

        _listField = new DemoListField();
        _listField.setCallback(this);

        // Add fields to respective managers
        vfm.add(_listField);
        scvfm.add(_searchInput);
        scvfm.add(new SeparatorField());
        scvfm.add(vfm);
        add(scvfm);
    }
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.