Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.TextArea


    addDisclosurePanel.setHeader(add);

    final VerticalPanel bookMark = new VerticalPanel();

    final TextArea discssionText = new TextArea();
    discssionText.setWidth("400px");

    bookMark.add(discssionText);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));

    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(bookMark);

    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);

    addDisclosurePanel.add(addItemPanel);

    mainPanel.add(addDisclosurePanel);
   
    mainPanel.add(viewAll);

    mainPanel.add(results);

    RootPanel.get().add(mainPanel.getGadgetPanel());

    saveButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changeDiscussionsQry.setRequestAction(ReqActionTypes.ADD);
        changeDiscussionsQry.clearParamList();

        changeDiscussionsQry.addParam(
            Params.DISCUSSION_TEXT.getParamName(),
            discssionText.getValue());

        addDeleteDiscussions.makeRequest();
        discssionText.setValue("");

      }
    });

    prevButton.setVisible(false);
View Full Code Here


          if(creation!=null)
            discussionItem.add(replyDate);
         
          discussionItem.add(replayText);

          final TextArea discussionReplay = new TextArea();

          final Button saveReplay = new Button(
              prefsUtils.getMsg("gadgetLabelSave"));
         
          replayItem.setSpacing(3);
          
           int messageLevel = 0;
          
           try {
            messageLevel = Integer.parseInt(data.getStringItemValue(Params.DISCUSSION_LEVEL.getParamName(), index));
          } catch (NumberFormatException e) {
         
          }
     
                 
          replayItem.add(UIUtils.getSpaces(messageLevel*4));

          String nick = data.getStringItemValue(
              ProfileFields.PROFILE_NICKNAME.getParamName(),
              index);
         
          String title = data.getStringItemValue(
              ProfileFields.PROFILE_TITLE.getParamName(),
              index);
         
          VerticalPanel details = new VerticalPanel();
          details.setWidth("100px");
                   
          details.add(new HTML(nick));
         
          details.add(new HTML(title));
         
          replayItem.add(details);
         
          replayItem.add(discussionItem);
             

          results.setWidget(index, 0, replayItem);
         
          saveReplay.setVisible(false);

          if (data.isUpdatePermitted(index)) {
           
            final ActionLabel replay = new ActionLabel(
                prefsUtils.getMsg("gadgetLabelReply"));

            replay.setTitle(prefsUtils.getMsg("gadgetLabelEdit"));

            replay.addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                replay.mouseOff();
               
                discussionReplay.setVisible(true);
                saveReplay.setVisible(true);

              }

            });
           
           
            replayItem.add(replay);
           
            replayItem.setCellVerticalAlignment(replay,HasVerticalAlignment.ALIGN_BOTTOM );
           
            discussionReplay.setWidth("700px");
            discussionReplay.setVisible(false);
           
            discussionItem.add(discussionReplay);
            discussionItem.add(saveReplay);

            saveReplay.addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // ignore empty
                if (discussionReplay.getText().length() == 0) {
                  discussionReplay.setVisible(false);
                  saveReplay.setVisible(false);

                } else {
               

                  chcangeDiscussionsReplyQry.clearParamList();
                                 

                  chcangeDiscussionsReplyQry
                      .setRequestAction(ReqActionTypes.ADD);
                 
                  chcangeDiscussionsReplyQry
                  .setRequestItemkey(gadgetState.getDiscussionId());

                  chcangeDiscussionsReplyQry.addParam(
                      Params.DISCUSSION_PARENT_ID
                          .getParamName(), noteId);

                  chcangeDiscussionsReplyQry.addParam(
                      Params.DICUSSION_REPLY
                          .getParamName(),
                      discussionReplay.getText());

                  chcangeDiscussionsReplyQry
                      .setCustomtContentName("replay");
                  changeDiscussionsReplys.makeRequest();
                }
View Full Code Here

    final DisclosurePanel addDisclosurePanel = new DisclosurePanel();
   
    addDisclosurePanel.setHeader(add);

   
    final TextArea message = new TextArea();
   
    message.setSize(GadgetNativeUtils.getGadgetWidth() / 2 + "px","200px");
   
    final VerticalPanel priority = new VerticalPanel();
    final RadioButton highPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelHigh"));
    final RadioButton medPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelMedium"));
    final RadioButton lowPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelLow"));
    lowPriority.setValue(true);
    priority.add(highPriority);
    priority.add(medPriority);
    priority.add(lowPriority);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));
    final PrioritySelection selection = new PrioritySelection(
        viewPersonalNotesQry, viewPersonalNotesRequest);
    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(message);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(priority);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);
   
    /**  This code is designed to demonstrate a ("custom")request
    *  to a server side method that is defined on the Gadget level
    *  the name of the server side method is explicitly set "doDeleteAll"
    *  with the  setContentActoinName() method.
    *  @ see com.gadglet.gadgets.personalNotesApps.server.RequestHandler.deleteAll()
     
      to test enable both client and server-side code 
    */
   
   
    final Button deleteAllButton = new Button(prefsUtils.getMsg("gadgetLabelDelete")+ " " + prefsUtils.getMsg("gadgetLabelAll"));
    addItemPanel.add(UIUtils.getSpace());
    addItemPanel.add(deleteAllButton);
 
   
    deleteAllButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changePersonalNoteQry.setContentActoinName("doDeleteAll");
        changePersonalNoteQry.clearParamList();


        addDeletePersonalNoteRequest.makeRequest();
   

      }
    });
   

    addDisclosurePanel.add(addItemPanel);

    mainPanel.add(addDisclosurePanel);

    mainPanel.add(selection.getPanel());

    mainPanel.add(results);

    RootPanel.get().add(mainPanel.getGadgetPanel());

    saveButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changePersonalNoteQry.setRequestAction(ReqActionTypes.ADD);
        changePersonalNoteQry.clearParamList();

        String priority = "";
        if (highPriority.getValue())
          priority = "1";
        else if (medPriority.getValue())
          priority = "2";
        else
          priority = "3";

        changePersonalNoteQry.addParam(Params.PRIORITY.getParamName(), priority);
        changePersonalNoteQry.addParam(Params.MESSAGE.getParamName(),
            message.getValue());

        addDeletePersonalNoteRequest.makeRequest();
        message.setValue("");

      }
    });

    viewPersonalNotesQry.setRequestAction(ReqActionTypes.VIEW);
View Full Code Here

          msg.setText(jResponse.getStringItemValue(
              Params.MESSAGE.getParamName(), index));
          VerticalPanel msgItem= new VerticalPanel();
          msgItem.add(msg);
         
          final TextArea msgEdit = new TextArea();
         
          if(data.isUpdatePermitted(index)){
            msgEdit.setWidth("500px");
            msgEdit.setVisible(false);
            msgEdit.setText(jResponse.getStringItemValue(
                Params.MESSAGE.getParamName(), index));
                   
            msgItem.add(msgEdit);
                   
            msg.addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                msgEdit.setVisible(true);
                msg.setVisible(false);
                   
              }

            });
           
            msgEdit.addBlurHandler(new BlurHandler(){
              @Override
              public void onBlur(BlurEvent event) {
                // ignore empty
                if(msgEdit.getText().length()==0){
                  msgEdit.setVisible(false);
                  msg.setVisible(true);
                  msgEdit.setText(msg.getText());
                }
                else
                {
                  msgEdit.setVisible(false);
                  msg.setText(msgEdit.getText());
                  msg.setVisible(true);
                 
                  changePersonalNoteQry.clearParamList();
                 
                  changePersonalNoteQry
                  .setRequestAction(ReqActionTypes.UPDATE);
                 
                  changePersonalNoteQry
                  .setRequestItemkey(noteId);
                                             
                  changePersonalNoteQry.addParam(Params.MESSAGE.getParamName(),
                      msgEdit.getText());
                 
                  updatePersonalNoteRequest.makeRequest();
                }
               
               
            }});
          }
         
       
          results.setWidget(index, 1, msgItem);
                   
          final ActionLabel deleteLabel = new ActionLabel(prefsUtils.getMsg("gadgetLabelDelete"));

         
          if(data.isDeletePermitted(index)){
       
         
 
            deleteLabel.addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                changePersonalNoteQry.clearParamList();
                changePersonalNoteQry
                .setRequestAction(ReqActionTypes.DELETE);
                changePersonalNoteQry
                .setRequestItemkey(noteId);
                addDeletePersonalNoteRequest.makeRequest();
 
              }
 
            });
           
          }
          else{
            // delete: "hide" sharing
           
            deleteLabel.addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                changePersonalNoteQry.clearParamList();
               
                changePersonalNoteQry
                .setRequestAction(ReqActionTypes.DELETE);
                changePersonalNoteQry.setCustomtContentName("sharing");
                changePersonalNoteQry
                .setRequestItemkey(noteId);
                addDeletePersonalNoteRequest.makeRequest();
                changePersonalNoteQry.setCustomtContentName(null);
 
              }
 
            });
          }
       
        results.setWidget(index, 2, deleteLabel);
         
        if(data.isSharePermitted(index)){
         
             
          final ActionLabel shareWithLabel = new ActionLabel(prefsUtils.getMsg("gadgetLabelShare"));
         
         
          shareWithLabel.addClickHandler(new ClickHandler() {
           
            public void onClick(ClickEvent event) {
              String title=msgEdit.getText();
             
              if(title!=null && title.length()>44)
                title = title.substring(0, 40)+"...";
             
              shareWithLabel.mouseOff();
View Full Code Here

   
    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel();
    addDisclosurePanel.setHeader(add);
   
    final TextArea message = new TextArea();

    final VerticalPanel priority = new VerticalPanel();
    final RadioButton highPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelHigh"));
    final RadioButton medPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelMedium"));
    final RadioButton lowPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelLow"));
    lowPriority.setValue(true);
    priority.add(highPriority);
    priority.add(medPriority);
    priority.add(lowPriority);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));

    final PrioritySelection selection = new PrioritySelection(
        viewPersonalNotesQry, viewPersonalNotesRequest);
    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(message);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(priority);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);

    addDisclosurePanel.add(addItemPanel);


    mainPanel.add(addDisclosurePanel);

    mainPanel.add(selection.getPanel());

    mainPanel.add(results);

    RootPanel.get().add(mainPanel.getGadgetPanel());

    saveButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changePersonalNoteQry.setRequestAction(ReqActionTypes.ADD);
        changePersonalNoteQry.clearParamList();

        String priority = "";
        if (highPriority.getValue())
          priority = "1";
        else if (medPriority.getValue())
          priority = "2";
        else
          priority = "3";

        changePersonalNoteQry.addParam(Params.PRIORITY.getParamName(),
            priority);
        changePersonalNoteQry.addParam(Params.MESSAGE.getParamName(),
            message.getValue());

        changePersonalNoteRequest.makeRequest();
        message.setValue("");

      }
    });

    viewPersonalNotesQry.setRequestAction(ReqActionTypes.VIEW);
View Full Code Here

        add(male, "userGender");
       
        /*
         User description
         */
        m_userDesc = new TextArea();
        m_userDesc.addKeyUpHandler(this);
        m_userDesc.getElement().setId("userDescTxt");
        m_userDesc.getElement().addClassName(WIDE_TEXT_FIELD);
        add(m_userDesc, "userDesc");
       
        m_userDescFeedback = new FormFeedback();
        m_feedbacks.add(m_userDescFeedback);
        add(m_userDescFeedback, "userDescRow");
       
        /*
         Password
         */
        m_password = new PasswordTextBox();
        m_password.addKeyUpHandler(this);
        m_password.getElement().setId("passwordTxt");
        m_password.getElement().addClassName("slimTextField");
        add(m_password, "password");
       
        m_passwordFeedback = new FormFeedback();
        m_feedbacks.add(m_passwordFeedback);
        add(m_passwordFeedback, "passwordRow");
       
        /*
         Password repeat
         */
        m_passwordRepeat = new PasswordTextBox();
        m_passwordRepeat.addKeyUpHandler(this);
        m_passwordRepeat.getElement().setId("passwordRepeatTxt");
        m_passwordRepeat.getElement().addClassName("slimTextField");
        add(m_passwordRepeat, "passwordRepeat");
       
        m_passwordRepeatFeedback = new FormFeedback();
        m_feedbacks.add(m_passwordRepeatFeedback);
        add(m_passwordRepeatFeedback, "passwordRepeatRow");
       
        /*
         Security Question
         */
        m_securityQuestion = new TextArea();
        m_securityQuestion.addKeyUpHandler(this);
        m_securityQuestion.getElement().setId("securityQuestionTxt");
        m_securityQuestion.getElement().addClassName(WIDE_TEXT_FIELD);
        add(m_securityQuestion, "securityQuestion");
       
View Full Code Here

        final Label chatLabel = new Label("Chats");
        chatLabel.addStyleName("bold");
        chatList.add(chatLabel);
        chatList.setWidth("10em");
        populateChats(chatList);
        text = new TextArea();
        text.addStyleName("messages");
        text.setWidth("60em");
        text.setHeight("20em");
        midPanel.add(chatList);
        midPanel.add(text);
View Full Code Here

        final Label chatLabel = new Label("Chats");
        chatLabel.addStyleName("bold");
        chatList.add(chatLabel);
        chatList.setWidth("10em");
        populateChats(chatList);
        text = new TextArea();
        text.addStyleName("messages");
        text.setWidth("60em");
        text.setHeight("20em");
        midPanel.add(chatList);
        midPanel.add(text);
View Full Code Here

        final VerticalPanel chatList = new VerticalPanel(); // (12)
        final Label chatLabel = new Label("CHATS");
        chatList.add(chatLabel);
        chatList.setWidth("20em");
        populateChats(chatList);
        final TextArea text = new TextArea();
        text.setWidth("60em");
        midPanel.add(chatList);
        midPanel.add(text);

        final TextBox messageBox = new TextBox(); // (13)
        final Button sendButton = new Button("send");
View Full Code Here

        chatList.add(chatLabel);
        chatList.setWidth("10em");//(9)
        populateChats(chatList); //(10)
        // "TextArea text" is defined as a field of the class, so that
        // the textarea can be referenced by handler methods.
        text = new TextArea();//(11)
        text.addStyleName("messages");
        text.setWidth("60em");
        text.setHeight("20em");
        midPanel.add(chatList);
        midPanel.add(text);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.TextArea

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.