Examples of LayoutSpacer


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

    consentMessage.setMargin(8);
    consentMessage.setWidth(CONSENT_WINDOW_WIDTH - 20);
    consentMessage.setAlign(Alignment.CENTER);
    windowCanvas.addMember(consentMessage);
   
    LayoutSpacer vSpacer = new LayoutSpacer();
    vSpacer.setHeight100();
    windowCanvas.addMember(vSpacer);
   
    HLayout buttons = new HLayout();
    buttons.setAlign(Alignment.CENTER);
    IButton yesButton = new IButton("Yes, allow")
    yesButton.setWidth(CONSENT_BUTTON_WIDTH);
        yesButton.setShowRollOver(false)
        yesButton.setHeight(CONSENT_BUTTON_HEIGHT);
        yesButton.setIcon(Imgs.CHECKMARK.get());
        yesButton.setIconOrientation("left");
        yesButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        GoogleAnalyticsEvent consentEvent = new GoogleAnalyticsEvent("consent", "yes");
        GoogleAnalytics.trackEvent(consentEvent);
        consentWindow.destroy();
        view.getSettings().setTrackingConsent(true);
        view.getSettings().setTrackingQueryConsent(true);
        LocalStorageHelper.storeSettings(view.getSettings());
      }});
        yesButton.setShowDownIcon(false);
   
        LayoutSpacer spacer1 = new LayoutSpacer();
        spacer1.setWidth(10);
       
    buttons.setAlign(Alignment.CENTER);
    IButton noQueriesButton = new IButton("Yes, track site usage, but not <br>the queries/endpoints I use")
    noQueriesButton.setWidth(CONSENT_BUTTON_WIDTH);
    noQueriesButton.setHeight(CONSENT_BUTTON_HEIGHT);
    noQueriesButton.setShowRollOver(false)
    noQueriesButton.setIcon(Imgs.CHECK_CROSS.get());
    noQueriesButton.setIconOrientation("left")
    noQueriesButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        GoogleAnalyticsEvent consentEvent = new GoogleAnalyticsEvent("consent", "yes/no");
        GoogleAnalytics.trackEvent(consentEvent);
        consentWindow.destroy();
        view.getSettings().setTrackingConsent(true);
        view.getSettings().setTrackingQueryConsent(false);
        LocalStorageHelper.storeSettings(view.getSettings());
      }});
    noQueriesButton.setShowDownIcon(false);
       
        LayoutSpacer spacer2 = new LayoutSpacer();
        spacer2.setWidth(10);
       
    IButton noButton = new IButton("No, disable tracking")
    noButton.setShowRollOver(false)
    noButton.setWidth(CONSENT_BUTTON_WIDTH);
    noButton.setHeight(CONSENT_BUTTON_HEIGHT);
    noButton.setIcon(Imgs.CROSS.get());
    noButton.setIconOrientation("left")
    noButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        GoogleAnalyticsEvent consentEvent = new GoogleAnalyticsEvent("consent", "no");
        GoogleAnalytics.trackEvent(consentEvent);
        consentWindow.destroy();
        view.getSettings().setTrackingConsent(false);
        view.getSettings().setTrackingQueryConsent(false);
        LocalStorageHelper.storeSettings(view.getSettings());
      }});
    noButton.setShowDownIcon(false);
   
        LayoutSpacer spacer3 = new LayoutSpacer();
        spacer3.setWidth(10);
   
    IButton askLater = new IButton("Ask me later")
    askLater.setShowRollOver(false)
    askLater.setWidth(CONSENT_BUTTON_WIDTH - 30);
    askLater.setHeight(CONSENT_BUTTON_HEIGHT);
View Full Code Here

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

        });
       
      }});
    tryConnectButton.setLayoutAlign(VerticalAlignment.CENTER);
   
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setWidth(5);
    offlineNotification.setMembers(disconnectedImg, offlineText, tryConnectButton, spacer);
    offlineNotification.hide();
    offlineNotification.redraw();
  }
View Full Code Here

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

  private void setViewLayout() {
    setWidth100();
    setHeight100();
    // Setting margins on tabset messes up layout. Therefore use spacer
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setHeight(TOP_SPACING);
    addMember(spacer);
  }
View Full Code Here

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

   
  }
 
  private void addContent() {
    HLayout hLayout = new HLayout();
    LayoutSpacer leftSpacer = new LayoutSpacer();
    leftSpacer.setWidth100();
   
    hLayout.addMember(leftSpacer);
    hLayout.addMember(getGithubCanvas());
   
    LayoutSpacer middleSpacer = new LayoutSpacer();
    middleSpacer.setWidth(40);
    hLayout.addMember(middleSpacer);
   
    hLayout.addMember(view.getElements().getYasguiLogo(45, "Show YASGUI page", "aboutYasguiLogo"));
   
   
    hLayout.addMember(middleSpacer);
    hLayout.addMember(getData2SemanticsCanvas());
   
    LayoutSpacer rightSpacer = new LayoutSpacer();
    rightSpacer.setWidth100();
    hLayout.addMember(rightSpacer);
   
    addItem(hLayout);
    draw();
  }
View Full Code Here

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

        "(\\#[-a-z\\d_]*)?$", "i");
    return pattern.test(url);
  }

  public static LayoutSpacer getVSpacer() {
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setHeight100();
    return spacer;
  }
View Full Code Here

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

    spacer.setHeight100();
    return spacer;
  }

  public static LayoutSpacer getHSpacer() {
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setWidth100();
    return spacer;
  }
View Full Code Here

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

    spacer.setWidth100();
    return spacer;
  }

  public static LayoutSpacer getHSpacer(int width) {
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setWidth(width);
    return spacer;
  }
View Full Code Here

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

    spacer.setWidth(width);
    return spacer;
  }

  public static LayoutSpacer getVSpacer(int height) {
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setHeight(height);
    return spacer;
  }
View Full Code Here

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

                    History.newItem("main", false);
                }
            }
        });

        LayoutSpacer layoutSpacer = new LayoutSpacer();
        layoutSpacer.setWidth(5);

        SelectItem selectItem = new SelectItem();
        selectItem.setHeight(21);
        selectItem.setWidth(130);
        LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
View Full Code Here

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

            setWidth("33%");
            setPadding(10);
            setContents("<b>No alignment</b>");
            setBackgroundColor("red");
        }});
        hLayoutLayoutSpacers.addMember(new LayoutSpacer()); // Note the use of the LayoutSpacer
        hLayoutLayoutSpacers.addMember(new Canvas() {{
            setHeight(40);
            setWidth("33%");
            setPadding(10);
            setContents("<b>Centered in remaning space</b>");
            setBackgroundColor("green");
        }});
        hLayoutLayoutSpacers.addMember(new LayoutSpacer()); // Note the use of the LayoutSpacer
       
        // 4. VLayout with layout.align = 'center'
        //
        // This centers the members along the vertical axis of the VLayout.
        // Note that the members have a specified height that is less than the
        // height of the VLayout -- otherwise, you would not see the centering
        // visually!
        final VLayout vLayoutAlignCenter = new VLayout();
        // Specifying the height creates space within which to center the members.
        vLayoutAlignCenter.setWidth100();
        vLayoutAlignCenter.setHeight100();
        vLayoutAlignCenter.setLayoutMargin(6);
        vLayoutAlignCenter.setMembersMargin(6);
        vLayoutAlignCenter.setBorder("1px dashed blue");
        vLayoutAlignCenter.setAlign(Alignment.CENTER);
       
        vLayoutAlignCenter.addMember(new Canvas() {{
            setHeight(40);
            setWidth(40);
            setBackgroundColor("red");
        }});
        vLayoutAlignCenter.addMember(new Canvas() {{
            setHeight(40);
            setWidth(40);
            setBackgroundColor("green");
        }});
        vLayoutAlignCenter.addMember(new Canvas() {{
            setHeight(40);
            setWidth(40);
            setBackgroundColor("blue");
        }});
       
        // 5. VLayout with member.layoutAlign = 'center' (or layout.defaultLayoutAlign = 'center')
        //
        // This centers every member along the horizontal axis of the VLayout.
        // If you don't want to center *every* member horizontally, you can
        // instead specify the layoutAlign property on individual members.
        // Note that the width of the members is fixed -- if they filled
        // the layout, you wouldn't see the centering.
        final VLayout vLayoutDefaultLayoutAlign = new VLayout();
        // Specifying the width creates space within which to center the members.
        vLayoutDefaultLayoutAlign.setWidth100();
        vLayoutDefaultLayoutAlign.setHeight100();
        vLayoutDefaultLayoutAlign.setLayoutMargin(6);
        vLayoutDefaultLayoutAlign.setMembersMargin(6);
        vLayoutDefaultLayoutAlign.setBorder("1px dashed blue");
        vLayoutDefaultLayoutAlign.setDefaultLayoutAlign(Alignment.CENTER); // As promised!
       
        vLayoutDefaultLayoutAlign.addMember(new Canvas() {{
            setHeight(40);
            setWidth(40);
            setBackgroundColor("red");
        }});
        vLayoutDefaultLayoutAlign.addMember(new Canvas() {{
            setHeight(40);
            setWidth(40);
            setBackgroundColor("green");
        }});
        vLayoutDefaultLayoutAlign.addMember(new Canvas() {{
            setHeight(40);
            setWidth(40);
            setBackgroundColor("blue");
        }});
       
        // 6. VLayout with LayoutSpacers
        //
        // This example uses LayoutSpacers as members to center one member in the space
        // remaining after the first member is drawn. Note that it is the positioning
        // of the two LayoutSpacer members that creates the centering ... no alignment
        // property is used.
        final VLayout vLayoutLayoutSpacers = new VLayout();
        // Specifying the width creates space for the LayoutSpacers to distribute.
        vLayoutLayoutSpacers.setWidth100();
        vLayoutLayoutSpacers.setHeight100();
        vLayoutLayoutSpacers.setLayoutMargin(6);
        vLayoutLayoutSpacers.setMembersMargin(6);
        vLayoutLayoutSpacers.setBorder("1px dashed blue");
        // Note no alignment property! It's all done with LayoutSpacers
        vLayoutLayoutSpacers.addMember(new Canvas() {{
            setWidth100();
            setHeight("33%");
            setPadding(10);
            setContents("<b>No alignment</b>");
            setBackgroundColor("red");
        }});
        vLayoutLayoutSpacers.addMember(new LayoutSpacer()); // Note the use of the LayoutSpacer
        vLayoutLayoutSpacers.addMember(new Canvas() {{
            setWidth100();
            setHeight("33%");
            setPadding(10);
            setBackgroundColor("green");
            setContents("<b>Centered in remaning space</b>");
        }});
        vLayoutLayoutSpacers.addMember(new LayoutSpacer()); // Note the use of the LayoutSpacer
       
        // The rest of the code is merely to organize the examples visually.
        HLayout mainLayout = new HLayout();
        mainLayout.setWidth100();
        mainLayout.setHeight100();
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.