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

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


    VerticalPanel leftLayout = new VerticalPanel();
    leftLayout.setSize("220px", "100%");

    leftLayout.add(new HTML("<h3>Drawing options:</h3>"));

    Button circleBtn = new Button("Draw circle");
    circleBtn.setWidth("200");
    circleBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Circle circle = new Circle(0, 0, 3000000);
        circle.setFillColor("#66CC66");
        circle.setFillOpacity(0.4);
        container.add(circle);
      }
    });
    leftLayout.add(circleBtn);

    Button deleteBtn = new Button("Delete all drawings");
    deleteBtn.setWidth("200");
    deleteBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        container.clear();
      }
    });
View Full Code Here


    VerticalPanel leftLayout = new VerticalPanel();
    leftLayout.setSize("220px", "100%");

    leftLayout.add(new HTML("<h3>Drawing options:</h3>"));

    Button rectangleBtn = new Button("Draw rectangle");
    rectangleBtn.setWidth("200");
    rectangleBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Rectangle rectangle = new Rectangle(60, 40, 200, 80);
        rectangle.setFillColor("#CC9900");
        rectangle.setFillOpacity(0.4);
        container.add(rectangle);
      }
    });
    leftLayout.add(rectangleBtn);

    Button textBtn = new Button("Draw text");
    textBtn.setWidth("200");
    textBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Text text = new Text(70, 60, "Hello World");
        text.setFontFamily("Arial");
        text.setFontSize(16);
        text.setStrokeOpacity(0);
        text.setFillColor("#000000");
        container.add(text);
      }
    });
    leftLayout.add(textBtn);

    Button circleBtn = new Button("Draw circle");
    circleBtn.setWidth("200");
    circleBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Circle circle = new Circle(300, 140, 30);
        circle.setFillColor("#0099CC");
        circle.setFillOpacity(0.4);
        container.add(circle);
      }
    });
    leftLayout.add(circleBtn);

    Button pathBtn = new Button("Draw path");
    pathBtn.setWidth("200");
    pathBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Path path = new Path(120, 160);
        path.setFillColor("#0066AA");
        path.setFillOpacity(0.4);
        path.setStrokeColor("#004499");
        path.lineRelativelyTo(100, 0);
        path.lineRelativelyTo(0, 100);
        path.lineRelativelyTo(-100, 0);
        path.lineRelativelyTo(0, -100);
        path.moveTo(140, 180);
        path.lineRelativelyTo(50, 0);
        path.lineRelativelyTo(0, 50);
        path.lineRelativelyTo(-50, 0);
        path.lineRelativelyTo(0, -50);
        container.add(path);
      }
    });
    leftLayout.add(pathBtn);

    Button deleteBtn = new Button("Delete all drawings");
    deleteBtn.setWidth("200");
    deleteBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        container.clear();
      }
    });
View Full Code Here

    VerticalPanel leftLayout = new VerticalPanel();
    leftLayout.setSize("220px", "100%");

    leftLayout.add(new HTML("<h3>Resize the map:</h3>"));

    Button resizeBtn = new Button("Enlarge map");
    resizeBtn.setWidth("200");
    resizeBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        int width = mapPresenter.getViewPort().getMapWidth() + 20;
        int height = mapPresenter.getViewPort().getMapHeight() + 15;
        mapPresenter.setSize(width, height);
      }
    });
    leftLayout.add(resizeBtn);

    Button shrinkBtn = new Button("Shrink map");
    shrinkBtn.setWidth("200");
    shrinkBtn.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent arg0) {
        int width = mapPresenter.getViewPort().getMapWidth() - 20;
        int height = mapPresenter.getViewPort().getMapHeight() - 15;
        mapPresenter.setSize(width, height);
View Full Code Here

      Label lbl = new Label("OK, what do you want to know?");
      panel.add(lbl);
      final TextBox box = new TextBox();
      box.setText("What is the meaning of life?");
      panel.add(box);
      Button ok = new Button("Ask");
      ok.addClickListener(new ClickListener()
      {
         public void onClick(Widget w)
         {
            ValidationUtility valid = new ValidationUtility();
            if (!valid.isValid(box.getText()))
View Full Code Here

    Window screen;

    @Override
    public void onModuleLoad() {
    
        Button button = new Button("Broadcast");
        button.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                sendMessage();
            }
        });
       
        Button post = new Button("Post");
        post.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                client.post(new Event(count++, "This was send using the post mechanism"));
            }
        });
       
        Button pollButton = new Button("Poll");
        pollButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                polling.pollDelayed(3000, new AsyncCallback<Event>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        GWT.log("Failed to poll", caught);
                    }

                    @Override
                    public void onSuccess(Event result) {
                        Info.display("Polling message received: " + result.getCode(), result.getData());
                    }
                });
            }
        });

        Button wnd = new Button("Open Window");
        wnd.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                    @Override
                    public void execute() {
                        screen = Window.current().open(Document.get().getURL(), "child", new WindowFeatures().setStatus(true).setResizable(true));
                    }
                });
            }
        });

        Button sendWindow = new Button("Send to window");
        sendWindow.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                if (screen != null) {
                    WindowSocket.post(screen, "wsock", "Hello Child!");
                }
            }
        });

        WindowSocket socket = new WindowSocket();
        socket.addHandler(new WindowSocket.MessageHandler() {
            @Override
            public void onMessage(String message) {
                Info.display("Received through window socket", message);
            }
        });
        socket.bind("wsock");
       
        RootPanel.get("buttons").add(button);
        RootPanel.get("buttons").add(post);
        RootPanel.get("buttons").add(pollButton);
        RootPanel.get("buttons").add(wnd);
        RootPanel.get("buttons").add(sendWindow);

        initialize();

        Button killbutton = new Button("Stop");
        killbutton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                client.stop();
            }
        });
View Full Code Here

            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);
                }
            });
View Full Code Here

    }

    protected void showTypeChoice(Widget w) {
        final FormStylePopup form = new FormStylePopup( images.newexWiz(),
                                                        constants.FieldValue() );
        Button lit = new Button( constants.LiteralValue() );
        lit.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                methodParameter.nature = FieldNature.TYPE_LITERAL;
                methodParameter.value = " ";
                makeDirty();
                refresh();
                form.hide();
            }

        } );

        form.addAttribute( constants.LiteralValue() + ":",
                           widgets( lit,
                                    new InfoPopup( constants.Literal(),
                                                   constants.LiteralValTip() ) ) );
        form.addRow( new HTML( "<hr/>" ) );
        form.addRow( new SmallLabel( constants.AdvancedSection() ) );

        /*
         * If there is a bound variable that is the same type of the current
         * variable type, then show abutton
         */
        List<String> vars = model.getModel().getLHSBoundFacts();
        List<String> vars2 = model.getModel().getRHSBoundFacts();
        for ( String i : vars2 ) {
            vars.add( i );
        }
        for ( String v : vars ) {
            boolean createButton = false;
            Button variable = new Button( constants.BoundVariable() );
            if ( vars2.contains( v ) == false ) {
                FactPattern factPattern = model.getModel().getLHSBoundFact( v );
                if ( factPattern.getFactType().equals( this.parameterType ) ) {
                    createButton = true;
                }
            } else {
                ActionInsertFact factPattern = model.getModel().getRHSBoundFact( v );
                if ( factPattern.factType.equals( this.parameterType ) ) {
                    createButton = true;
                }
            }
            if ( createButton == true ) {
                form.addAttribute( constants.BoundVariable() + ":",
                                   variable );
                variable.addClickHandler( new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        methodParameter.nature = FieldNature.TYPE_VARIABLE;
                        methodParameter.value = "=";
                        makeDirty();
View Full Code Here

            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) {
                                                     copySelected( validFacts,
                                                                   availFacts );
View Full Code Here

        if ( ApplicationPreferences.showVisualRuleFlow() ) {
            initRuleflowViewer();

            if ( ruleFlowViewer != null && parameterPanel != null ) {
                Button viewSource = new Button();
                viewSource.setText( constants.OpenEditorInNewWindow() );
                viewSource.addClickHandler( new ClickHandler() {
                    public void onClick( ClickEvent arg0 ) {
                        doViewDiagram();

                        ruleFlowViewer.update();
                    }
View Full Code Here

                            }
                        }
                    }
                });

        save = new Button(constants.SaveAndClose());
        save.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                String[] wsUUIDs = new String[selectedFacts.getItemCount()];
                for (int i = 0; i < selectedFacts.getItemCount(); i++) {
                    wsUUIDs[i] = selectedFacts.getValue(i);
View Full Code Here

TOP

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

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.