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

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


    // Style name used for IE7 workaround related to layout
    // of the control. See Issue 261
    div.setStyleName("demo-transliterate-control");
    demoPanel.add(div);

    TextArea transltextarea = new TextArea();
    demoPanel.add(transltextarea);

    VerticalPanel wrapperPanel = new VerticalPanel();
    wrapperPanel.setWidth("100%");
    wrapperPanel.add(demoPanel);
View Full Code Here


    final MessageBox mb = new MessageBox();
    mb.setText(caption);
    mb.setButtons(buttons, listener);
    mb._dockPanel.add(asHTML ? new HTML(message) : new Label(message), DockPanel.NORTH);
    if(multiline) {
      mb._textArea = new TextArea();
      mb._dockPanel.add(mb._textArea, DockPanel.CENTER);
      mb.center();
      mb._textArea.setFocus(true);
    } else {
      mb._textBox = new TextBox();
View Full Code Here

        HasHorizontalAlignment.ALIGN_RIGHT);

    VerticalPanel locationVertical = new VerticalPanel();
    Label labelLocation = new Label("Location:");
    locationVertical.add(labelLocation);
    tbLocation = new TextArea();
    tbLocation.setEnabled(false);
    tbLocation.setTitle("used to find members in your Location");
    mapUI = new MapUI(true, true, tbLocation);
    locationVertical.add(tbLocation);
View Full Code Here

  FlexTable resultsPanel = new FlexTable();

  public SearchWidget() {
    service = (MentorServiceAsync) GWT.create(MentorService.class);
    location = new TextArea();
    location.setEnabled(false);
    location.setSize("213px", "43px");
    location.setText(LOCATION_HELP);
    location.setTitle(LOCATION_HELP);
    mapUI = new MapUI(false, true, location);
View Full Code Here

    horizontalPanel.add(new Label("Subject :"));

    subject = new TextBox();
    horizontalPanel.add(subject);
    subject.setWidth("150px");
    comment = new TextArea();
    verticalPanel.add(comment);
    comment.setSize("256px", "100px");
    HorizontalPanel hp = new HorizontalPanel();
    Button submit = new Button("Submit");
    Button cancel = new Button("Cancel");
View Full Code Here

    final DisclosurePanel addDisclosurePanel = new DisclosurePanel();
   
   
    final VerticalPanel bookMark = new VerticalPanel();
   
    final TextArea DiscussionText = new TextArea();
    DiscussionText.setWidth("200px");
 
   
    bookMark.add(DiscussionText);
 

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


    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(bookMark);
   
    //addItemPanel.add(new HTML(" "));
    //addItemPanel.add(bookMarkType);
 
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);

    addDisclosurePanel.add(addItemPanel);
   
    ActionLabel add = new ActionLabel(prefsUtils.getMsg("gadgetLabelAdd"));
    add.setTitle(prefsUtils.getMsg("gadgetLabelAdd"));
    add.setStyleName("gadglet-ActionLabel");
   
    addDisclosurePanel.setHeader(add);

    mainPanel.add(addDisclosurePanel);

    mainPanel.add(results);

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

    saveButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changeDiscussionQry.setRequestAction(ReqActionTypes.ADD);
        changeDiscussionQry.clearParamList();
       
       
        changeDiscussionQry.addParam(Params.DISCUSSION_TEXT.getParamName(),
            DiscussionText.getValue());
     
        changeDiscussionRequest.makeRequest();
        DiscussionText.setValue("");
     

      }
    });
View Full Code Here

    final HomeViewMainPanel mainPanel = new HomeViewMainPanel();

    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel(
        prefsUtils.getMsg("gadgetLabelAdd"));
    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);
    addDisclosurePanel.setHeader(new HTML(prefsUtils
        .getMsg("gadgetLabelAdd")));

    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

    final Button sendButton = new Button("Save");
    final TextBox nameField = new TextBox();
    final TextBox titleField = new TextBox();
    final TextBox helpUrlField = new TextBox();
    final TextBox gadgetFileNameField = new TextBox();
    final TextArea xmlSourceField = new TextArea();
    final ListBox statusField = new ListBox();
    final ListBox typeField = new ListBox();
    final TextBox handlerClassNameField = new TextBox();
    final ListBox gadgletTypeField = new ListBox();

    final TextArea descriptionField = new TextArea();
   
    titleField.setWidth("300px");
    helpUrlField.setWidth("300px");
    gadgetFileNameField.setWidth("300px");
    handlerClassNameField.setWidth("300px");

    descriptionField.setWidth("600px");
    descriptionField.setHeight("300px");

    xmlSourceField.setHeight("600px");
    xmlSourceField.setWidth("600px");

    statusField.addItem("Test", (new Integer(
        SharedConstants.gadgetStatusTest)).toString());
    statusField.addItem("On Line", (new Integer(
        SharedConstants.gadgetStatusOnLine)).toString());
    statusField.addItem("Off Line", (new Integer(
        SharedConstants.gadgetStatusOffLine)).toString());
    statusField.setVisibleItemCount(1);

    gadgletTypeField.addItem("Minglet", GadgetType.MINGLET.getGadgetType());
    gadgletTypeField.addItem("Bizlet", GadgetType.BIZLET.getGadgetType());
    gadgletTypeField.addItem("Other", GadgetType.OTHER.getGadgetType());

    typeField.addItem("iGoogle", (new Integer(
        SharedConstants.gadgetGoogleTypeiGoogle)).toString());
    typeField.addItem("Spreadsheet", (new Integer(
        SharedConstants.gadgetGoogleTypeSpreadsheets)).toString());
    typeField.addItem("GMail Context", (new Integer(
        SharedConstants.gadgetGoogleTypegMailContext)).toString());
    typeField.addItem("Calander Evnent", (new Integer(
        SharedConstants.gadgetGoogleTypeCalendarEvent)).toString());
    typeField.setVisibleItemCount(1);

    if (Location.getParameter("gname") != null) {
      // load object from server when gnage= ??? and save in gadget
      asyService.getGadget(Location.getParameter("gname"),
          new AsyncCallback<GadgetTransit>() {
            @Override
            public void onFailure(Throwable caught) {
              Window.alert(caught.getMessage());
            }

            @Override
            public void onSuccess(GadgetTransit result) {
              if (result != null) {
                // set values
                descriptionField.setValue(result
                    .getDescription());
                nameField.setValue(result.getName());
                nameField.setReadOnly(true);
                titleField.setValue(result.getTitle());

                xmlSourceField.setValue(result.getXmlSource());
                helpUrlField.setValue(result.getHelpUrl());
                typeField.setSelectedIndex(result.getType());
                statusField.setSelectedIndex(result.getStatus());
               
                 
                               
                for (int index = 0; index < gadgletTypeField
                    .getItemCount(); index++) {
                  if (result.getGadgletType()
                      .equals(gadgletTypeField
                          .getValue(index))) {
                    gadgletTypeField.setSelectedIndex(index);
                   
                    break;
                  }

                }

                gadgetFileNameField.setValue(result
                    .getGadgetFileName());
                handlerClassNameField.setValue(result
                    .getHandlerClassName());

              }
            }
          });

    }

    // We can add style names to widgets
    sendButton.addStyleName("sendButton");

    // Add the nameField and sendButton to the RootPanel
    // Use RootPanel.get() to get the entire body element
    RootPanel.get("nameFieldContainer").add(nameField);
    RootPanel.get("titleFieldContainer").add(titleField);
    RootPanel.get("statusFieldContainer").add(statusField);
    RootPanel.get("googleTypeFieldContainer").add(typeField);
    RootPanel.get("typeFieldContainer").add(gadgletTypeField);
    RootPanel.get("handlerClassNameContainer").add(handlerClassNameField);

    RootPanel.get("helpUrlFieldContainer").add(helpUrlField);
    RootPanel.get("gadgetFileNameFieldContainer").add(gadgetFileNameField);

    RootPanel.get("descriptionFieldContainer").add(descriptionField);
    RootPanel.get("xmlSourceFieldContainer").add(xmlSourceField);

    RootPanel.get("sendButtonContainer").add(sendButton);
    RootPanel.get("errorLabelContainer").add(errorLabel);

    // Focus the cursor on the name field when the app loads
    nameField.setFocus(true);
    nameField.selectAll();

    // Create the popup dialog box
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Add new Gadget");
    dialogBox.setAnimationEnabled(true);
    final Button closeButton = new Button("Close");
    // We can set the id of a widget by accessing its Element
    closeButton.getElement().setId("closeButton");
    final Label textToServerLabel = new Label();
    final HTML serverResponseLabel = new HTML();
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.addStyleName("dialogVPanel");
    dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
    dialogVPanel.add(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
    dialogVPanel.add(serverResponseLabel);
    dialogVPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    closeButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        dialogBox.hide();
        sendButton.setEnabled(true);
        sendButton.setFocus(true);
      }
    });

    class MyHandler implements ClickHandler, KeyUpHandler {
      /**
       * Fired when the User clicks on the sendButton.
       */
      @Override
      public void onClick(ClickEvent event) {
        sendNameToServer();
      }

      /**
       * Fired when the User types in the nameField.
       */
      @Override
      public void onKeyUp(KeyUpEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          sendNameToServer();
        }
      }

      /**
       * Send the name from the nameField to the server and wait for a
       * response.
       */
      private void sendNameToServer() {
        // First, we validate the input.
        // create gadget

        gadget.setName(nameField.getText());
        gadget.setTitle(titleField.getText());
        gadget.setHelpUrl(helpUrlField.getText());
        gadget.setGadgetFileName(gadgetFileNameField.getText());
        gadget.setDescription(descriptionField.getText());
        if (statusField != null)
          gadget.setStatus(Integer.parseInt(statusField
              .getValue(statusField.getSelectedIndex())));
        if (typeField != null)
          gadget.setType(Integer.parseInt(typeField
View Full Code Here

    final CanvasViewMainPanel mainPanel = new CanvasViewMainPanel();

    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel(
        prefsUtils.getMsg("gadgetLabelAdd"));
    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("&nbsp;"));
    addItemPanel.add(priority);
    addItemPanel.add(new HTML("&nbsp;"));
    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.personalNotes.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);
    addDisclosurePanel.setHeader(new HTML(prefsUtils
        .getMsg("gadgetLabelAdd")));

    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();
                }
               
               
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.