Package net.rim.device.api.ui.component

Examples of net.rim.device.api.ui.component.RichTextField


  }

  public CheckCodeScreen(String user) {
    mUser = user;
    setTitle(sResources.getString(CHECK_CODE_TITLE));
    mCheckCodeTextView = new RichTextField();
    mCheckCodeTextView.setText(sResources.getString(CHECK_CODE));

    mCodeArea = new HorizontalFieldManager(FIELD_HCENTER);

    Bitmap bitmap = Bitmap.getBitmapResource("ic_lock_lock.png");
View Full Code Here


  public AuthenticatorScreen() {
    setTitle(sResources.getString(APP_NAME));
    // LabelField cannot scroll content that is bigger than the screen,
    // so use RichTextField instead.
    mEnterPinTextView = new RichTextField(sResources.getString(ENTER_PIN));

    mUserList = new PinListField();
    mUserAdapter = new PinListFieldCallback(mUsers);
    setAdapter();
View Full Code Here

        super( new HorizontalFieldManager(), Field.NON_FOCUSABLE);
        final BitmapField logo = new BitmapField(Bitmap.getPredefinedBitmap(Bitmap.HOURGLASS));
        logo.setSpace( 5, 5 );
        add(logo);

        RichTextField rtf = new RichTextField(message, Field.FIELD_VCENTER | Field.NON_FOCUSABLE | Field.FIELD_HCENTER);
        rtf.setEditable( false );

        add(rtf);
    }
View Full Code Here

 
  protected Field createLabelAndTextField(String label, String text) {
    HorizontalFieldManager fieldManager = new HorizontalFieldManager();
    fieldManager.setPadding(5, 0, 5, 0);
    LabelField labelField = new LabelField(label, Field.FIELD_LEFT);
    RichTextField textField = new RichTextField(text, RichTextField.TEXT_ALIGN_RIGHT | RichTextField.NON_FOCUSABLE);
    fieldManager.add(labelField);
    fieldManager.add(textField);

    return fieldManager;
  }
View Full Code Here

          checkBoxField.setChecked(!checked);
        }
      }
    };
    checkBoxField.setChangeListener(changeListener);
    RichTextField textField = new RichTextField(text, RichTextField.TEXT_ALIGN_RIGHT | RichTextField.NON_FOCUSABLE);
    fieldManager.add(checkBoxField);
    fieldManager.add(textField);

    return fieldManager;
  }
View Full Code Here

              DateField date = new DateField("",
                  eventLogEntryDate, DateFormat
                      .getInstance(DateFormat.DATE_SHORT
                          | DateFormat.TIME_SHORT),
                  DateField.DATE_TIME | DateField.READONLY);
              RichTextField text = new RichTextField(
                  eventLogEntryText,
                  RichTextField.NON_FOCUSABLE);
              eventLogScreen.add(date);
              eventLogScreen.add(text);
            }
View Full Code Here

    {
        synchronized(getEventLock())
        {
            AppScreen as = null;

            statusField = new RichTextField("", Field.NON_FOCUSABLE) ;
            as          = new AppScreen()                            ;
            statusField.setText(message);
            as.setStatus(statusField);
            pushScreen(as);
        }
View Full Code Here

    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);
            pushScreen(mainScreen);
View Full Code Here

                new XYEdges(Color.OLIVE, Color.OLIVE, Color.OLIVE, Color.OLIVE);

        // Set the title of the application
        setTitle("D�cor Demo");

        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick and solid rounded border
        // and single solid color background.
        final RichTextField simpleField =
                new RichTextField("Solid rounded border, solid background");

        // Create border and background objects
        final Border roundedBorder =
                BorderFactory.createRoundedBorder(thickPadding,
                        Border.STYLE_SOLID);
        final Background solidBackground =
                BackgroundFactory.createSolidBackground(Color.LIGHTSTEELBLUE);

        // Set the objects for use
        simpleField.setBorder(roundedBorder);
        simpleField.setBackground(solidBackground);

        // Add the field to the screen
        add(simpleField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick and dotted rounded border
        // and single color transparent background.
        final RichTextField transparentField =
                new RichTextField(
                        "Dotted rounded border, transparent background");
        final Border dottedBorder =
                BorderFactory.createRoundedBorder(thickPadding,
                        Border.STYLE_DOTTED);
        final Background transparentBackground =
                BackgroundFactory.createSolidTransparentBackground(
                        Color.LIGHTSTEELBLUE, 50);
        transparentField.setBorder(dottedBorder);
        transparentField.setBackground(transparentBackground);
        add(transparentField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick and dashed border
        // and gradient background.
        final RichTextField gradientField =
                new RichTextField("Dashed simple border, gradient background");
        final Border dashedBorder =
                BorderFactory.createSimpleBorder(thickPadding, blueColors,
                        Border.STYLE_DASHED);
        final Background gradientBackground =
                BackgroundFactory.createLinearGradientBackground(Color.RED,
                        Color.GREEN, Color.BLUE, Color.WHITE);
        gradientField.setBorder(dashedBorder);
        gradientField.setBackground(gradientBackground);
        add(gradientField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a no padding dotted border and no background.
        final RichTextField noPaddingField =
                new RichTextField("Dotted simple border, no padding");
        final Border noPaddingBorder =
                BorderFactory.createSimpleBorder(noPadding, oliveColors,
                        Border.STYLE_DOTTED);
        noPaddingField.setBorder(noPaddingBorder);
        add(noPaddingField);
        add(new RichTextField(Field.NON_FOCUSABLE));

        // Sample text field with a thick bevel border and bitmap background.
        final RichTextField bevelAndBitmapField =
                new RichTextField("Bevel border, bitmap background");
        final Border bevelBorder =
                BorderFactory.createBevelBorder(thickPadding, multiColors,
                        pinkColors);

        // Attempt to load a bitmap background
        try {
            final Background bitmapBackground =
                    BackgroundFactory.createBitmapBackground(Bitmap
                            .getBitmapResource("smiley.bmp"),
                            Background.POSITION_X_CENTER,
                            Background.POSITION_Y_CENTER,
                            Background.REPEAT_BOTH);
            bevelAndBitmapField.setBackground(bitmapBackground);
        } catch (final IllegalArgumentException e) {
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    Dialog.alert(e.toString());
                }
            });
        }
        bevelAndBitmapField.setBorder(bevelBorder);
        add(bevelAndBitmapField);
    }
View Full Code Here

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

TOP

Related Classes of net.rim.device.api.ui.component.RichTextField

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.