Examples of VStack


Examples of com.smartgwt.client.widgets.layout.VStack

        SubmitItem okButton = new SubmitItem("login");
        okButton.setTitle("Login");
        okButton.setWidth(100);

        VStack vStack = new VStack();

        SpacerItem spacerItem1 = new SpacerItem();
        SpacerItem spacerItem2 = new SpacerItem();
        spacerItem1.setStartRow(true);
        spacerItem1.setEndRow(true);
        spacerItem2.setStartRow(true);
        spacerItem2.setEndRow(false);

        okButton.setStartRow(false);
        okButton.setEndRow(true);
       
        this.addSubmitValuesHandler(new SubmitValuesHandler() {
            @SuppressWarnings( "synthetic-access" )
            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                console.jcrService.login(userName.getValueAsString(),
                    password.getValueAsString(), new AsyncCallback<Object>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        SC.say(caught.getMessage());
                    }

                    @Override
                    public void onSuccess(Object result) {
                        LoginDialog.this.hideDialog();
                        console.updateUserName(userName.getValueAsString());
                    }
                });
            }
        });
       
        StaticTextItem description = new StaticTextItem();
        description.setTitle("");
        description.setValue("Please specify your username and password");
        description.setStartRow(true);
        description.setEndRow(true);
       
        setItems(description, userName, password,  spacerItem2, okButton);

        vStack.setTop(30);
        vStack.addMember(this);

        window.addChild(vStack);
        window.setTitle("Login");
        window.setCanDragReposition(true);
        window.setCanDragResize(false);
View Full Code Here

Examples of com.smartgwt.client.widgets.layout.VStack

    xmlAreaItem.setTitleOrientation(TitleOrientation.TOP);

    textForm.setFields(textAreaItem);
    editorLayout.addChild(textForm);

    VStack moveControls = new VStack(10);
    moveControls.setWidth(handleHorizontal(32));
    moveControls.setHeight(handleVertical(74));
    moveControls.setLayoutAlign(Alignment.CENTER);

    TransferImgButton rightArrow = new TransferImgButton(
        TransferImgButton.RIGHT, new ClickHandler() {
          public void onClick(ClickEvent event) {
            unmarshelService.unmarshel(
                textAreaItem.getValue() + "", TreeToStruct
                    .getStruct(treeGrid, rootNode, null),
                new AsyncCallback<String>() {

                  @Override
                  public void onFailure(Throwable caught) {
                    if (caught instanceof UnmarshalException) {
                      String val = (String) textAreaItem
                          .getValue();
                      String after = val
                          .replace("\n", "\r\n")
                          .substring(
                              0,
                              ((UnmarshalException) caught).lastPossition);
                      int count = after.length()
                          - after.replace("\r\n",
                              "\n").length();
                      textAreaItem
                          .setSelectionRange(
                              0,
                              ((UnmarshalException) caught).lastPossition
                                  - count);
                      xmlAreaItem.setValue("");

                      com.google.gwt.user.client.Window
                          .alert("Parsing failed. Managed to parse only the selected text. Last position:"
                              + ((UnmarshalException) caught).lastPossition);
                    } else {
                      com.google.gwt.user.client.Window
                          .alert("Operation failed.");
                    }
                    GWT.log("", caught);

                  }

                  @Override
                  public void onSuccess(String result) {
                    xmlAreaItem.setValue(result);

                  }
                });
          }

        });
    moveControls.addMember(rightArrow);

    TransferImgButton leftArrow = new TransferImgButton(
        TransferImgButton.LEFT, new ClickHandler() {
          public void onClick(ClickEvent event) {
            unmarshelService.marshel(xmlAreaItem.getValue() + "",
                TreeToStruct
                    .getStruct(treeGrid, rootNode, null),
                new AsyncCallback<String>() {

                  @Override
                  public void onFailure(Throwable caught) {
                    com.google.gwt.user.client.Window
                        .alert("Can't perform operation: "
                            + caught);
                    GWT.log("", caught);
                  }

                  @Override
                  public void onSuccess(String result) {
                    textAreaItem.setValue(result);

                  }
                });

          }
        });
    moveControls.addMember(leftArrow);
    moveControls.setTop(handleVertical(80));
    moveControls.setLeft(handleHorizontal(585));

    editorLayout.addChild(moveControls);

    xmlForm.setFields(xmlAreaItem);
    editorLayout.addChild(xmlForm);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.