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

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


     * This is the entry point method.
     */
    public void onModuleLoad() {

        List itens = getAuctionItens();
        Grid table = new Grid(itens.size() + 1, 6);
        table.setStylePrimaryName("corpo");

        table.setText(0, 0, "Item Name");
        table.setText(0, 1, "# of bids");
        table.setText(0, 2, "Price");
        table.setText(0, 3, "My bid");

        for (int i = 0; i < itens.size(); i++) {

            final AuctionItem item = (AuctionItem) itens.get(i);

            final int itemId = item.getId();
            final Label labelNumberOfBids = new Label(String.valueOf(item.getNumberOfBids()));
            final Label labelPrice = new Label("$ " + String.valueOf(item.getPrice()));
            final TextBox txtBoxMyBid = new TextBox();
            final Button bidButton = new Button("Bid!");
            final Label labelMessage = new Label("");

            bidButton.setStylePrimaryName("principal");

            //Save itemPrice Label to be used when new bids are processed.
            mapOfItemPrices.put(new Integer(itemId), labelPrice);
            //Save numberOfBids Label to be used when new bids are processed.
            mapOfNumberOfBids.put(new Integer(itemId), labelNumberOfBids);

            //Handle ENTER key
            txtBoxMyBid.addKeyboardListener(new KeyboardListener() {

                public void onKeyUp(Widget sender, char keyCode, int modifiers) {
                    if (keyCode == '\r') {
                        sendNewBid(item, txtBoxMyBid, labelMessage);
                    }
                }

                public void onKeyDown(Widget sender, char keyCode, int modifiers) {
                }

                public void onKeyPress(Widget sender, char keyCode, int modifiers) {
                }
            });

            //Handle button click
            bidButton.addClickListener(new ClickListener() {

                public void onClick(Widget sender) {
                    sendNewBid(item, txtBoxMyBid, labelMessage);
                }
            });

            table.setText(i + 1, 0, item.getName());
            table.setWidget(i + 1, 1, labelNumberOfBids);
            table.setWidget(i + 1, 2, labelPrice);
            table.setWidget(i + 1, 3, txtBoxMyBid);
            table.setWidget(i + 1, 4, bidButton);
            table.setWidget(i + 1, 5, labelMessage);

        }

        RootPanel.get("slot1").add(table);

View Full Code Here


        tPanel.selectTab( 0 );
        initWidget( tPanel );
    }

    private Grid buildDoubleList(WorkingSetConfigData wsData) {
        Grid grid = new Grid( 2,
                              3 );

        SuggestionCompletionEngine sce = SuggestionCompletionCache.getInstance().getEngineFromCache( workingSet.getMetaData().getPackageName() );
        boolean filteringFact = sce.isFilteringFacts();
        sce.setFilteringFacts( false );

        try {
            Set<String> elem = new HashSet<String>();

            availFacts.setVisibleItemCount( 10 );
            validFacts.setVisibleItemCount( 10 );

            if ( wsData.validFacts != null ) {
                elem.addAll( Arrays.asList( wsData.validFacts ) );
                for ( String factName : wsData.validFacts ) {
                    validFacts.addItem( factName );
                }
            }

            for ( String factName : sce.getFactTypes() ) {
                if ( !elem.contains( factName ) ) {
                    availFacts.addItem( factName );
                }
            }

            Grid btnsPanel = new Grid( 2,
                                       1 );

            btnsPanel.setWidget( 0,
                                 0,
                                 new Button( ">",
                                             new ClickHandler() {

                                                 public void onClick(ClickEvent sender) {
                                                     copySelected( availFacts,
                                                                   validFacts );
                                                     updateAsset( validFacts );
                                                     factsConstraintsgEditorPanel.fillSelectedFacts();
                                                     customFormsEditorPanel.fillSelectedFacts();
                                                 }
                                             } ) );

            btnsPanel.setWidget( 1,
                                 0,
                                 new Button( "&lt;",
                                             new ClickHandler() {

                                                 public void onClick(ClickEvent sender) {
View Full Code Here

        this.modeller = m;
        this.asset = a;

        pop = new FormStylePopup();
        pop.setTitle(constants.SelectWorkingSets());
        Grid g = buildDoubleList(null);

        RepositoryServiceFactory.getAssetService().listAssets(asset.getMetaData().getPackageUUID(),
                new String[] { AssetFormats.WORKING_SET }, 0, -1, "workingsetList",
                new GenericCallback<TableDataResult>() {
View Full Code Here

    public void show() {
        pop.show();
    }
   
    private Grid buildDoubleList(WorkingSetConfigData wsData) {
        Grid grid = new Grid(2, 3);

        availableFacts.setVisibleItemCount(10);
        selectedFacts.setVisibleItemCount(10);

        Grid btnsPanel = new Grid(2, 1);

        btnsPanel.setWidget(0, 0, new Button(">", new ClickHandler() {
            public void onClick(ClickEvent sender) {
                moveSelected(availableFacts, selectedFacts);
            }
        }));

        btnsPanel.setWidget(1, 0, new Button("&lt;", new ClickHandler() {
            public void onClick(ClickEvent sender) {
                moveSelected(selectedFacts, availableFacts);
            }
        }));
View Full Code Here

     * @param scenario = the scenario to add/remove from
     */
    public VerifyRulesFiredWidget(final FixtureList rfl,
                                  final Scenario scenario,
                                  boolean showResults) {
        outer = new Grid( 2,
                          1 );
        this.showResults = showResults;
        outer.getCellFormatter().setStyleName( 0,
                                               0,
                                               "modeller-fact-TypeHeader" ); //NON-NLS
View Full Code Here

        this.serviceCache = serviceCache;
        this.application = application;

        VerticalPanel mainPanel = new VerticalPanel();

        Grid ratingGrid = new Grid(thisUser.getRatingTypes().size(), 2);

        int row = 0;
        for (RatingType ratingType : thisUser.getRatingTypes()) {

            ratingGrid.setWidget(row, 0, new Label(ratingType.getName()));

            int rating = application.getRating(ratingType);

            RatingChooser chooser = new RatingChooser(ratingType, rating);
            chooser.addChangeListener(this);
            ratingGrid.setWidget(row, 1, chooser);

            row++;
        }
        mainPanel.add(ratingGrid);
View Full Code Here

    }
  }

  @Override
  protected Widget onInitialize() {
    Grid grid = new Grid(1, 3);
    grid.setBorderWidth(2);
    grid.setCellPadding(3);
    grid.setCellSpacing(0);

    // Toggle selection
    selectionPolicyBox.addItem("Multi Row");
    selectionPolicyBox.addItem("Single Row");
    selectionPolicyBox.addItem("Disabled");
    grid.setWidget(0, 0, selectionPolicyButton);
    grid.setWidget(0, 1, selectionPolicyBox);
    grid.setHTML(0, 2, DESC_SELECTION);

    return grid;
  }
View Full Code Here

    }
  }

  @Override
  protected Widget onInitialize() {
    grid = new Grid(4, 4);
    grid.setCellSpacing(0);
    grid.setBorderWidth(1);

    // Column options
    columnIndexBox.setWidth("70px");
View Full Code Here

    mainViewer.setHeight("369px");
    RootPanel.get().add(mainViewer);
    RootPanel.get().add(new HTML("<BR><BR>"));

    // Align options in a grid
    Grid grid = new Grid(5, 3);

    // Set video ID option
    final TextBox videoIDBox = new TextBox();
    videoIDBox.setText("iuywmPePYKQ");
    grid.setHTML(0, 0, "<B>Video ID:</B>");
    grid.setWidget(0, 1, videoIDBox);
    grid.setWidget(0, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setMovieID(videoIDBox.getText());
      }
    }));

    // Set player width
    final TextBox widthBox = new TextBox();
    widthBox.setText("443px");
    grid.setHTML(1, 0, "<B>Width:</B>");
    grid.setWidget(1, 1, widthBox);
    grid.setWidget(1, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setWidth(widthBox.getText());
      }
    }));

    // Set player height
    final TextBox heightBox = new TextBox();
    heightBox.setText("369px");
    grid.setHTML(2, 0, "<B>Height:</B>");
    grid.setWidget(2, 1, heightBox);
    grid.setWidget(2, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        mainViewer.setHeight(heightBox.getText());
      }
    }));

    // Plugins page
    final TextBox pluginsBox = new TextBox();
    pluginsBox.setText("http://www.google.com");
    grid.setHTML(3, 0, "<B>Plugins Page:</B>");
    grid.setWidget(3, 1, pluginsBox);
    grid.setWidget(3, 2, new Button("Set", new ClickListener() {
      public void onClick(Widget sender) {
        EmbeddedObjectInfo info = mainViewer.getInfo();
        info.setPluginsPage(pluginsBox.getText());
        mainViewer.setInfo(info);
      }
    }));

    // Enabled/disable autoplay
    grid.setWidget(4, 0, new Button("Enable AutoPlay", new ClickListener() {
      public void onClick(Widget sender) {
        if (mainViewer.isAutoPlayEnabled()) {
          mainViewer.setAutoPlayEnabled(false);
          ((Button) sender).setText("Enable AutoPlay");
        } else {
          mainViewer.setAutoPlayEnabled(true);
          ((Button) sender).setText("Disable AutoPlay");
        }
      }
    }));

    // Enabled/disable related videos
    grid.setWidget(4, 1, new Button("Enable Related", new ClickListener() {
      public void onClick(Widget sender) {
        if (mainViewer.isRelatedVideosEnabled()) {
          mainViewer.setRelatedVideosEnabled(false);
          ((Button) sender).setText("Enable Related");
        } else {
View Full Code Here

    }
  }

  @Override
  protected Widget onInitialize() {
    grid = new Grid(4, 3);

    // Row Index 1
    HorizontalPanel panel1 = new HorizontalPanel();
    panel1.add(moveRowUpButton);
    panel1.add(new HTML("&nbsp;"));
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.