/** {@inheritDoc} */
  @Override
  public Component doCreateWidget(Object parent) {
    if (textArea == null) {

      textArea = new TextArea();
      textArea.setSizeFull();
      textArea.addStyleName(CSS_CLASS_CONTROL);
      textArea.setImmediate(true);
      textArea.setNullRepresentation("");
      setupComponent(textArea, getCastedModel());

      associateWidget(textArea, modelAccess.yField);
      if (modelAccess.isCssIdValid()) {
        textArea.setId(modelAccess.getCssID());
      } else {
        textArea.setId(getEditpart().getId());
      }

      property = new ObjectProperty<String>(null, String.class);
      textArea.setPropertyDataSource(property);

      // creates the binding for the field
      createBindings(modelAccess.yField, textArea);

      if (modelAccess.isCssClassValid()) {
        textArea.addStyleName(modelAccess.getCssClass());
      }

      applyCaptions();

      initializeField(textArea);
    }
    return textArea;
  }
Exemplo n.º 2
0
 private Component buildNotes() {
   TextArea notes = new TextArea("Notes");
   notes.setValue(
       "Remember to:\n· Zoom in and out in the Sales view\n· Filter the transactions and drag a set of them to the Reports tab\n· Create a new report\n· Change the schedule of the movie theater");
   notes.setSizeFull();
   notes.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
   Component panel = createContentWrapper(notes);
   panel.addStyleName("notes");
   return panel;
 }
Exemplo n.º 3
0
    BuilderDrawer() {
      if (drawerResource != null) {
        Embedded drawerBkg = new Embedded(null, drawerResource);
        addComponent(drawerBkg, "top:0px;left:0px");
      }
      content = new TextArea();
      // only shows if no focus, and if we don't have focus, it's not normally showing
      // content.setInputPrompt("Type here to add to this card chain.");
      content.setWordwrap(true);
      content.setImmediate(true);
      content.setTextChangeEventMode(TextChangeEventMode.LAZY);
      content.setTextChangeTimeout(500);
      // cause exception w/ 2 windows?
      // content.setDebugId(CardTypeManager.getCardContentDebugId(ct));
      content.setId(
          CardDebug.getCardContentDebugId(ct)); // CardTypeManager.getCardContentDebugId(ct));

      content.addTextChangeListener(new characterTypedHandler());

      content.setWidth(CARDLISTHEADER_DRAWER_TEXT_W);
      content.setHeight(CARDLISTHEADER_DRAWER_TEXT_H);
      content.addStyleName("m-white-background");
      addComponent(content, CARDLISTHEADER_DRAWER_TEXT_POS);

      count = new Label("0/140");
      count.setWidth(CARDLISTHEADER_DRAWER_COUNT_W);
      count.setHeight(CARDLISTHEADER_DRAWER_COUNT_H);
      count.addStyleName("m-cardbuilder-count-text");
      addComponent(count, CARDLISTHEADER_DRAWER_COUNT_POS);

      cancelButt = new NativeButton("cancel");
      cancelButt.setWidth(CARDLISTHEADER_DRAWER_CANCEL_W);
      cancelButt.setHeight(CARDLISTHEADER_DRAWER_CANCEL_H);
      cancelButt.addStyleName("borderless");
      cancelButt.addStyleName("m-cardbuilder-button-text");
      cancelButt.addClickListener(new CancelHandler());
      addComponent(cancelButt, CARDLISTHEADER_DRAWER_CANCEL_POS);

      submitButt = new NativeButton("submit");
      // cause exception w/ 2 windows?
      // submitButt.setDebugId(CardTypeManager.getCardSubmitDebugId(ct));
      submitButt.setId(
          CardDebug.getCardSubmitDebugId(ct)); // CardTypeManager.getCardSubmitDebugId(ct));

      submitButt.setWidth(CARDLISTHEADER_DRAWER_OKBUTT_W);
      submitButt.setHeight(CARDLISTHEADER_DRAWER_OKBUTT_H);
      submitButt.addStyleName("borderless");
      submitButt.addStyleName("m-cardbuilder-button-text");
      submitButt.addClickListener(new CardPlayHandler());
      addComponent(submitButt, CARDLISTHEADER_DRAWER_OKBUTT_POS);

      setWidth(CARDLISTHEADER_DRAWER_W);
      setHeight(CARDLISTHEADER_DRAWER_H);
    }