예제 #1
0
 protected TextArea createTextArea(String text, boolean editable) {
   TextArea textArea = new TextArea(text);
   textArea.setEditable(editable);
   return textArea;
 }
예제 #2
0
    public Component getListCellRendererComponent(
        List list, Object value, int index, boolean isSelected) {

      PrivacyModel cell = (PrivacyModel) value;

      setLayout(new BorderLayout());

      Label name = new Label();
      name.getStyle().setPadding(Component.LEFT, 5, true);
      name.setText(cell.getTitle());
      name.getStyle().setFont(Fonts.MEDIUM, true);
      name.getStyle().setFgColor(ColorCodes.settingsScreenListItemHeadingGrey, true);
      name.getSelectedStyle().setPadding(Component.BOTTOM, 0, true);
      name.getStyle().setBgTransparency(0, true);

      TextArea description = new TextArea();
      description.setText(cell.getSubTitle());
      description.getStyle().setFgColor(ColorCodes.settingsScreenListItemDescGrey);
      description.getSelectedStyle().setFgColor(ColorCodes.settingsScreenListItemDescGrey);
      description.getStyle().setBgColor(ColorCodes.settingsScreenListBgGrey, true);
      description.getSelectedStyle().setBgColor(ColorCodes.settingsScreenListBgGrey, true);
      description.setEditable(false);
      description.setRows(2);
      description.setPreferredW(com.sun.lwuit.Display.getInstance().getDisplayWidth() - 20);
      description.getSelectedStyle().setBgTransparency(255, true);
      description.getStyle().setBgTransparency(255, true);
      description.getStyle().setBorder(Border.createEmpty(), true);
      description.getSelectedStyle().setBorder(Border.createEmpty(), true);
      description.getStyle().setPadding(Component.LEFT, 5, true);
      description.getSelectedStyle().setPadding(Component.LEFT, 5, true);
      description.getStyle().setPadding(Component.TOP, 0, true);
      description.getSelectedStyle().setPadding(Component.TOP, 0, true);
      description.getStyle().setPadding(Component.BOTTOM, 0, true);
      description.getSelectedStyle().setPadding(Component.BOTTOM, 0, true);
      description.getSelectedStyle().setFont(Fonts.SMALL, true);
      description.getStyle().setFont(Fonts.SMALL, true);

      Container nameDescContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
      nameDescContainer.getStyle().setPadding(Component.RIGHT, 0, true);
      nameDescContainer.getSelectedStyle().setPadding(Component.RIGHT, 0, true);
      nameDescContainer.getStyle().setBorder(Border.createEmpty(), true);
      nameDescContainer.getSelectedStyle().setBorder(Border.createEmpty(), true);
      nameDescContainer.addComponent(name);
      nameDescContainer.addComponent(description);

      arrowIconLabel = new Label();
      arrowIconLabel.setIcon(arrowIconImage);
      arrowIconLabel.getStyle().setAlignment(Component.CENTER);
      arrowIconLabel.getStyle().setBgTransparency(0, true);
      arrowIconLabel.getSelectedStyle().setBgTransparency(0, true);
      arrowIconLabel.getPressedStyle().setBgTransparency(0, true);
      arrowIconLabel.getPressedStyle().setBorder(null, true);
      arrowIconLabel.getStyle().setBorder(null, true);
      arrowIconLabel.getSelectedStyle().setBorder(null, true);
      arrowIconLabel.getStyle().setAlignment(CENTER);
      arrowIconLabel.getStyle().setPadding(Component.RIGHT, 10, true);

      mainContainer = new Container(new BorderLayout());
      mainContainer.setPreferredH(80);
      mainContainer.getStyle().setPadding(Component.TOP, 2, true);
      mainContainer
          .getStyle()
          .setBorder(
              Border.createCompoundBorder(
                  null,
                  Border.createEtchedRaised(
                      ColorCodes.settingsScreenSeperatorGrey,
                      ColorCodes.settingsScreenSeperatorShadow),
                  null,
                  null),
              true);
      mainContainer.addComponent(BorderLayout.WEST, nameDescContainer);
      mainContainer.addComponent(BorderLayout.EAST, arrowIconLabel);

      return mainContainer;
    }