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

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


  }
 
  public MyDialog(Widget contents, boolean buttons) {
    super(false, true);
    setAnimationEnabled(true);
    Grid grid = new Grid(1,1);
    grid.setWidget(0, 0, dockPanel);
    setWidget(grid);
   
    if ( buttons ) {
      buttonsPanel = createButtonsPanel();
      hp.setCellHorizontalAlignment(buttonsPanel, HasHorizontalAlignment.ALIGN_RIGHT);
View Full Code Here


     
      layout.setHTML(1, 0, constants.password());
      layout.setWidget(1, 1, passBox);

      // Create some advanced options
      Grid advancedOptions = new Grid(5, 2);
      advancedOptions.setCellSpacing(6);
     
      final TextBox hostBox = new TextBox();
      final TextBox portBox = new TextBox();
      final TextBox domainBox = new TextBox();
      final CheckBox authCheck = new CheckBox("SASL");
      authCheck.setChecked(false);
     
      hostBox.setEnabled(false);
    portBox.setEnabled(false);
    domainBox.setEnabled(false);
    authCheck.setEnabled(false);
           
      final CheckBox serverConfig = new CheckBox(constants.defineServerConfig());
      advancedOptions.setWidget(0, 0, serverConfig);
      serverConfig.addClickListener(new ClickListener()
      {
      public void onClick(Widget sender) {
        if(serverConfig.isChecked())
        {
          hostBox.setEnabled(true);
          portBox.setEnabled(true);
          domainBox.setEnabled(true);
          authCheck.setEnabled(true);
        }
        else
        {
          hostBox.setEnabled(false);
          portBox.setEnabled(false);
          domainBox.setEnabled(false);
          authCheck.setEnabled(false);
        }
       
      }
       
      });
     
      serverConfig.setChecked(false);
     
      advancedOptions.setHTML(1, 0, constants.domain());
      advancedOptions.setWidget(1, 1, hostBox);
     
      advancedOptions.setHTML(2, 0, constants.host());
      advancedOptions.setWidget(2, 1, portBox);
     
      advancedOptions.setHTML(3, 0, constants.port());
      advancedOptions.setWidget(3, 1, domainBox);
     
      advancedOptions.setWidget(4, 0, authCheck);

      // Add advanced options to form in a disclosure panel
      DisclosurePanel advancedDisclosure = new DisclosurePanel(
          constants.moreOptions());
      advancedDisclosure.setAnimationEnabled(true);
View Full Code Here

    public EmoticonPalettePanel(final EmoticonPaletteListener listener)
    {
      setStyleName("emoticon_menu");
      //setAnimationEnabled(true);
      grid = new Grid(PALETTE_ROWS, PALETTE_COLUMNS);
      //final SimplePanel sp = new SimplePanel();
      //sp.add(grid);
      //setWidget(grid);
      add(grid);
      currentWidget = 0;
View Full Code Here

        final Label html_1 = new Label(c.Login());
        html_1.setStylePrimaryName("h1");
        verticalPanel.add(html_1);
        verticalPanel.add(decPanel);

        final Grid grid = new Grid(4, 2);
        decPanel.setWidget(grid);
        grid.setTitle(c.Login()); // pretty useless.
        grid.setCellPadding(10);
        setTitle(c.Login());

        final Label loginPrompt = new Label(c.Please_log_in());
        // "Please log in; leaving fields empty.");
        final Label namePrompt = new Label(c.Name());
        final TextBox nameTextbox = new TextBox();
        final Label passwordPrompt = new Label(c.Password());
        final PasswordTextBox passwordTextbox = new PasswordTextBox();
        final Button button = new Button(c.Login());

        nameTextbox.setEnabled(false);
        passwordTextbox.setEnabled(false);

        button.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                History.newItem(iCing.WELCOME_STATE);
            }
        });

        loginPrompt.addStyleName("loginPrompt");
        /**
         * nameTextbox.addStyleName("nameField"); passwordTextbox.addStyleName("passwordField");
         */
        grid.setWidget(0, 1, loginPrompt);
        grid.setWidget(1, 0, namePrompt);
        grid.setWidget(1, 1, nameTextbox);
        nameTextbox.setTitle(c.Short_name_like());

        grid.setWidget(2, 0, passwordPrompt);
        grid.setWidget(2, 1, passwordTextbox);
        passwordTextbox.setTitle(c.Short_secret_wo());

        grid.setWidget(3, 1, button);
        button.setTitle(c.Advance_to_file());
    }
View Full Code Here

  @Inject
  public DefaultCardGrid(@BackOfCard Provider<Image> backOfCard,
      @Rows int rows, @Columns int columns) {
    // we use a Provider to avoid weird results with duplicate images in Grid
    this.backOfCard = backOfCard;
    this.grid = new Grid(rows, columns);

    this.rows = rows;
    this.columns = columns;
   
    grid.addStyleName("cardGrid");
View Full Code Here

  private DialogBox makeAddPolyDialog() {

    DialogBox dialog = new DialogBox();
    dialog.setTitle("Add Polyline");

    Grid grid = new Grid(2, 4);

    VerticalPanel vp = new VerticalPanel();
    grid.setHTML(0, 0, "<b>Opacity</b>");
    // The drop down lists for setting the style
    final ListBox opacityBox = new ListBox();
    for (int i = 100; i > 0; i -= 10) {
      opacityBox.addItem(i + "%");
    }
    opacityBox.addChangeHandler(new ChangeHandler() {
      public void onChange(ChangeEvent event) {
        String val = opacityBox.getItemText(opacityBox.getSelectedIndex());
        opacity = Double.parseDouble(val.replace("%", "")) / 100.0;
      }
    });
    grid.setWidget(1, 0, opacityBox);

    grid.setHTML(0, 1, "<b>Weight</b>");
    final ListBox weightBox = new ListBox();
    weightBox.addItem("1 pixel");
    weightBox.addItem("2 pixels");
    weightBox.addItem("3 pixels");
    weightBox.addItem("5 pixels");
    weightBox.addItem("10 pixels");
    weightBox.addChangeHandler(new ChangeHandler() {
      public void onChange(ChangeEvent event) {
        String val = weightBox.getItemText(weightBox.getSelectedIndex());
        val = val.replace(" pixel", "");
        val = val.replace("s", "");
        weight = Integer.parseInt(val);
      }
    });
    grid.setWidget(1, 1, weightBox);

    grid.setHTML(0, 2, "<b>Color</b>");
    final ListBox colorBox = new ListBox();
    colorBox.addItem("#FF0000 red");
    colorBox.addItem("#FFFF00 yellow");
    colorBox.addItem("#00FF00 green");
    colorBox.addItem("#00FFFF cyan");
    colorBox.addItem("#0000FF blue");
    colorBox.addItem("#FF00FF violet");
    colorBox.addChangeHandler(new ChangeHandler() {
      public void onChange(ChangeEvent event) {
        color = colorBox.getItemText(colorBox.getSelectedIndex()).substring(0,
            7);
      }
    });
    grid.setWidget(1, 2, colorBox);

    grid.setHTML(0, 3, "<b>Fill Polygon</b>");
    final CheckBox fillCheckBox = new CheckBox("");
    fillCheckBox.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        fillFlag = fillCheckBox.getValue();
      }
    });
    grid.setWidget(1, 3, fillCheckBox);

    Button addPolylineButton = new Button("Make Polyline");
    addPolylineButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        message1.setText("opacity=" + opacity + " color=" + color + " weight="
View Full Code Here

  }

  private MapWidget map;

  public SimpleDirectionsDemo() {
    final Grid grid = new Grid(1, 2);
    grid.setWidth("100%");
    grid.getCellFormatter().setWidth(0, 0, "500px");
    grid.getCellFormatter().setVerticalAlignment(0, 0,
        HasVerticalAlignment.ALIGN_TOP);
    grid.getCellFormatter().setWidth(0, 1, "300px");
    grid.getCellFormatter().setVerticalAlignment(0, 1,
        HasVerticalAlignment.ALIGN_TOP);
    map = new MapWidget(LatLng.newInstance(42.351505, -71.094455), 15);
    map.setHeight("480px");
    grid.setWidget(0, 0, map);
    DirectionsPanel directionsPanel = new DirectionsPanel();
    grid.setWidget(0, 1, directionsPanel);
    directionsPanel.setSize("100%", "100%");

    initWidget(grid);

    DirectionQueryOptions opts = new DirectionQueryOptions(map, directionsPanel);
View Full Code Here

    map = new MapWidget(LatLng.newInstance(34, 0), 1);
    map.setSize("100%", "480px");
    panel.add(map);

    Grid grid = new Grid((sampleAddresses.length / NUM_ADDRESS_COLUMNS) + 1,
        NUM_ADDRESS_COLUMNS);

    for (int i = 0; i < sampleAddresses.length; i++) {
      final String address = sampleAddresses[i];
      Button link = new Button(address);
      // Hyperlink link = new Hyperlink(address, true,
      // "Extracting Structured Address Information");
      link.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          addressBox.setText(address);
          form.submit();
        }
      });
      grid.setWidget(i / NUM_ADDRESS_COLUMNS, i % NUM_ADDRESS_COLUMNS, link);
    }
    panel.add(grid);

    initWidget(panel);
    geocoder = new Geocoder();
View Full Code Here

        public void onClick(ClickEvent clickEvent) {
          map.zoomOut();
        }
      });

      Grid container = new Grid(2, 2);
      container.setWidget(0, 0, zoomInImage);
      container.setWidget(1, 0, zoomOutImage);
      container.setWidget(0, 1, trafficImage);
      container.setWidget(1, 1, satelliteImage);

      return container;
    }
View Full Code Here

   @Override
   protected Widget createMainWidget()
   {
      ExportPlotResources.Styles styles = ExportPlotResources.INSTANCE.styles();
     
      Grid grid = new Grid(7, 2);
      grid.setStylePrimaryName(styles.savePdfMainWidget());
     
      // paper size
      grid.setWidget(0, 0, new Label("PDF Size:"));
     
      // paper size label
      paperSizeEditor_ = new PaperSizeEditor();
      grid.setWidget(0, 1, paperSizeEditor_);
     
      // orientation
      grid.setWidget(1, 0, new Label("Orientation:"));
      HorizontalPanel orientationPanel = new HorizontalPanel();
      orientationPanel.setSpacing(kComponentSpacing);
      VerticalPanel orientationGroupPanel = new VerticalPanel();
      final String kOrientationGroup = new String("Orientation");
      portraitRadioButton_ = new RadioButton(kOrientationGroup, "Portrait");
      orientationGroupPanel.add(portraitRadioButton_);
      landscapeRadioButton_ = new RadioButton(kOrientationGroup, "Landscape");
      orientationGroupPanel.add(landscapeRadioButton_);
      orientationPanel.add(orientationGroupPanel);
      grid.setWidget(1, 1, orientationPanel);
     
      boolean haveCairoPdf = sessionInfo_.isCairoPdfAvailable();
      if (haveCairoPdf)
         grid.setWidget(20, new Label("Options:"));
      HorizontalPanel cairoPdfPanel = new HorizontalPanel();
      String label = "Use cairo_pdf device";
      if (BrowseCap.isMacintoshDesktop())
         label = label + " (requires X11)";
      chkCairoPdf_ = new CheckBox(label);
      chkCairoPdf_.getElement().getStyle().setMarginLeft(kComponentSpacing,
                                                         Unit.PX);
      cairoPdfPanel.add(chkCairoPdf_);
      chkCairoPdf_.setValue(haveCairoPdf && options_.getCairoPdf());
      if (haveCairoPdf)
         grid.setWidget(2, 1, cairoPdfPanel);
     
      grid.setWidget(3, 0, new HTML("&nbsp;"));
     
      ThemedButton directoryButton = new ThemedButton("Directory...");
      directoryButton.setStylePrimaryName(styles.directoryButton());
      directoryButton.getElement().getStyle().setMarginLeft(-2, Unit.PX);
      grid.setWidget(4, 0, directoryButton);
      directoryButton.addClickHandler(new ClickHandler() {
         @Override
         public void onClick(ClickEvent event)
         {
            fileDialogs_.chooseFolder(
               "Choose Directory",
               fileSystemContext_,
               FileSystemItem.createDir(directoryLabel_.getTitle().trim()),
               new ProgressOperationWithInput<FileSystemItem>() {

                 public void execute(FileSystemItem input,
                                     ProgressIndicator indicator)
                 {
                    if (input == null)
                       return;
                   
                    indicator.onCompleted();
                   
                    // update default
                    ExportPlotUtils.setDefaultSaveDirectory(input);
                   
                    // set display
                    setDirectory(input)
                 }         
               });
         }
      });
     
     
      directoryLabel_ = new Label();
      setDirectory(defaultDirectory_);
      directoryLabel_.setStylePrimaryName(styles.savePdfDirectoryLabel());
      grid.setWidget(4, 1, directoryLabel_);
     
      Label fileNameLabel = new Label("File name:");
      fileNameLabel.setStylePrimaryName(styles.savePdfFileNameLabel());
      grid.setWidget(5, 0, fileNameLabel);
      fileNameTextBox_ = new TextBox();
      fileNameTextBox_.setText(defaultPlotName_);
      fileNameTextBox_.setStylePrimaryName(styles.savePdfFileNameTextBox());
      grid.setWidget(5, 1, fileNameTextBox_);
     
     
      // view after size
      viewAfterSaveCheckBox_ = new CheckBox("View plot after saving");
      viewAfterSaveCheckBox_.setStylePrimaryName(
                                       styles.savePdfViewAfterCheckbox());
      viewAfterSaveCheckBox_.setValue(options_.getViewAfterSave());
      grid.setWidget(6, 1, viewAfterSaveCheckBox_);
     
      // set default value
      if (options_.getPortrait())
         portraitRadioButton_.setValue(true);
      else
View Full Code Here

TOP

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

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.