Example usage for com.google.gwt.user.client.ui Button Button

List of usage examples for com.google.gwt.user.client.ui Button Button

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui Button Button.

Prototype

public Button() 

Source Link

Document

Creates a button with no caption.

Usage

From source file:client.attic.CreateReservation.java

License:Open Source License

public CreateReservation() {
    final Button button = new Button();
    this.vert = new VerticalPanel();
    final ClickListener listener = new ClickListener() {
        public void onClick(final Widget sender) {

            final ArgonManagementServiceAsync emailService = (ArgonManagementServiceAsync) GWT
                    .create(ArgonManagementService.class);

            final ServiceDefTarget endpoint = (ServiceDefTarget) emailService;
            final String moduleRelativeURL = GWT.getModuleBaseURL() + "/gui/server/argon";
            endpoint.setServiceEntryPoint(moduleRelativeURL);

            // (3) Create an asynchronous callback to handle the result.
            ////from  ww w.  j a  va  2  s  . c  o m
            final AsyncCallback callback = new AsyncCallback() {
                public void onSuccess(final Object result) {
                    final InfoDialog dialog = new InfoDialog("Result", (String) result);

                    dialog.show();
                    dialog.center();
                }

                public void onFailure(final Throwable caught) {
                    final InfoDialog dialog = new InfoDialog("Failure", new HTML(caught.toString()));

                    dialog.show();
                    dialog.center();

                }
            };

            emailService.getDomainName(callback);
        }

    };

    button.addClickListener(listener);
    button.setText("Click me");
    this.vert.add(button);
    this.vert.setWidth("100%");
    this.initWidget(this.vert);

}

From source file:client.reservation.panel.ExecuteReservationPanel.java

License:Open Source License

/**
 * Constructor. Create the whole panel at once.
 * /*from  ww  w . jav  a  2  s . co  m*/
 * @param list
 *            ListPanel which should be attached to the execution Panel.
 */
public ExecuteReservationPanel(final ListPanel list) {
    final ExecutionCallbackHandler callback = new ExecutionCallbackHandler(this, "Execution");

    this.dropdown = new ListBox();
    this.button = new Button();
    this.button.setText("Execute");
    this.activity = new Image("ajaxloader.gif");
    this.activity.setVisible(false);

    final ExecutionButtonListener execListener = new ExecutionButtonListener();
    execListener.setCallback(callback);
    execListener.setList(list);
    execListener.setListBox(this.dropdown);
    execListener.setButton(this.button);
    execListener.setActivity(this.activity);
    this.button.addClickListener(execListener);

    this.dropdown.addItem("Cancel");
    this.add(this.dropdown);
    this.add(this.button);
    this.add(this.activity);
    this.setStyleName("res-Top");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
}

From source file:client.reservation.panel.RefreshReservationPanel.java

License:Open Source License

/**
 * Constructor. Create the whole panel at once.
 * /*from  w w w.jav a  2 s  .  co  m*/
 * @param callback
 *            Callback Object which gets the Refresh parameters.
 * @param list
 *            ListPanel which should be attached to the refresh Panel.
 */
public RefreshReservationPanel(final AsyncCallback callback, final ListPanel list) {
    final Label labelOne = new Label();
    labelOne.setText("Period: ");

    // TODO: user those values??
    this.dropdown = new ListBox();
    this.dropdown.addItem("Now", "0");
    this.dropdown.addItem("1 Hour", "1");
    this.dropdown.addItem("3 Hours", "3");
    this.dropdown.addItem("1 Day", "24");
    this.dropdown.addItem("3 Days", "72");
    this.dropdown.addItem("1 Week", "168");

    // activity indicator
    this.button = new Button();
    this.button.setText("refresh");
    this.activity = new Image("ajaxloader.gif");
    this.activity.setVisible(false);

    // tell refresh-Button which elements to update
    final RefreshButtonListener listener = new RefreshButtonListener();
    listener.setButton(this.button);
    listener.setActivity(this.activity);
    listener.setCallback(callback);
    listener.setList(list);
    listener.setListBox(this.dropdown);
    this.button.addClickListener(listener);

    this.add(labelOne);
    this.add(this.dropdown);
    this.add(this.button);
    this.add(this.activity);
    this.setStyleName("res-Top");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
}

From source file:client.tools.panel.ExecuteLinkPanel.java

License:Open Source License

/**
 * Constructor. Create the whole panel at once.
 * //w w w .  ja  v a 2s.c o  m
 * @param list
 *            ListPanel which should be attached to the execution Panel.
 */
public ExecuteLinkPanel(final ListPanel list) {

    final RemoveExecutionCallbackHandler callback = new RemoveExecutionCallbackHandler(this, "Execution");

    this.dropdown = new ListBox();
    this.button = new Button();
    this.button.setText("Execute");
    this.activity = new Image("ajaxloader.gif");
    this.activity.setVisible(false);

    final ExecutionButtonListener execListener = new ExecutionButtonListener();
    execListener.setCallback(callback);
    execListener.setList(list);
    execListener.setListBox(this.dropdown);
    execListener.setButton(this.button);
    execListener.setActivity(this.activity);
    this.button.addClickListener(execListener);

    this.dropdown.addItem("Enable/Disable");
    this.dropdown.addItem("Delete");
    this.dropdown.addItem("Modify");
    this.add(this.dropdown);
    this.add(this.button);
    this.add(this.activity);
    this.setStyleName("res-Top");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
}

From source file:client.tools.panel.ExecuteRouterPanel.java

License:Open Source License

/**
 * Constructor. Create the whole panel at once.
 * /*from   w w w  .ja v a  2s . c  o  m*/
 * @param list
 *            ListPanel which should be attached to the execution Panel.
 */
public ExecuteRouterPanel(final ListPanel list) {

    final RemoveExecutionCallbackHandler callback = new RemoveExecutionCallbackHandler(this, "Execution");

    this.dropdown = new ListBox();
    this.button = new Button();
    this.button.setText("Execute");
    this.activity = new Image("ajaxloader.gif");
    this.activity.setVisible(false);

    final ExecutionButtonListener execListener = new ExecutionButtonListener();
    execListener.setCallback(callback);
    execListener.setList(list);
    execListener.setListBox(this.dropdown);
    execListener.setButton(this.button);
    execListener.setActivity(this.activity);
    this.button.addClickListener(execListener);

    this.dropdown.addItem("Delete");
    this.dropdown.addItem("Modify");
    this.add(this.dropdown);
    this.add(this.button);
    this.add(this.activity);
    this.setStyleName("res-Top");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
}

From source file:client.tools.panel.RefreshLinkPanel.java

License:Open Source License

/**
 * Constructor. Create the whole panel at once.
 * //  w  w  w  . j  ava  2 s  .c  o  m
 * @param callback
 *            Callback Object which gets the Refresh parameters.
 * @param list
 *            ListPanel which should be attached to the refresh Panel.
 */
public RefreshLinkPanel(final AsyncCallback callback, final ListPanel list) {

    // activity indicator
    this.button = new Button();
    this.button.setText("refresh");
    this.activity = new Image("ajaxloader.gif");
    this.activity.setVisible(false);

    // tell refresh-Button which elements to update
    final SlimRefreshButtonListener listener = new SlimRefreshButtonListener();
    listener.setButton(this.button);
    listener.setActivity(this.activity);
    listener.setCallback(callback);
    listener.setList(list);
    this.button.addClickListener(listener);

    this.add(this.button);
    this.add(this.activity);
    this.setStyleName("res-Top");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
}

From source file:client.tools.panel.RefreshRouterPanel.java

License:Open Source License

/**
 * Constructor. Create the whole panel at once.
 * /*w  w w  .ja  v a 2s.  c om*/
 * @param callback
 *            Callback Object which gets the Refresh parameters.
 * @param list
 *            ListPanel which should be attached to the refresh Panel.
 */
public RefreshRouterPanel(final AsyncCallback callback, final ListPanel list) {

    // activity indicator
    this.button = new Button();
    this.button.setText("refresh");
    this.activity = new Image("ajaxloader.gif");
    this.activity.setVisible(false);

    // tell refresh-Button which elements to update
    final SlimRefreshButtonListener listener = new SlimRefreshButtonListener();
    listener.setButton(this.button);
    listener.setActivity(this.activity);
    listener.setCallback(callback);
    listener.setList(list);
    this.button.addClickListener(listener);

    this.add(this.button);
    this.add(this.activity);
    this.setStyleName("res-Top");
    this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
}

From source file:cmg.org.monitor.module.client.InviteUser.java

License:Open Source License

/**
 * Show dialog invited./*from w w  w .  ja va2 s . com*/
 */
static void showDialogInvited() {
    dialogInvite = new DialogBox();
    dialogInvite.setAnimationEnabled(true);
    final Button exitButton = new Button();
    exitButton.setStyleName("");
    exitButton.getElement().setId("closeButton");
    exitButton.addStyleName("align=right");
    exitButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            dialogInvite.hide();
        }
    });
    btt_invite = new Button("Invite");
    btt_invite.setStyleName("margin:6px;");
    btt_invite.addStyleName("form-button");
    btt_invite.addClickHandler(new inviteUserHandler());
    btt_reset = new Button("Reset");
    btt_reset.setStyleName("margin:6px;");
    btt_reset.addStyleName("form-button");
    btt_reset.addClickHandler(new ResetInviteHandler());
    txt_email = new TextArea();
    txt_email.setTitle("Invite user");
    txt_email.setWidth("400px");
    txt_email.setHeight("100px");
    FlexTable panelButton = new FlexTable();
    panelButton.setWidget(0, 0, btt_invite);
    panelButton.setWidget(0, 1, btt_reset);
    panelButton.setCellPadding(5);
    panelButton.setCellSpacing(5);
    panelValidateEmail = new AbsolutePanel();
    panelValidateEmail.setVisible(false);
    listGroupInvi = new ListBox();
    listGroupInvi.setTitle("List Group");
    listGroupInvi.setWidth("200px");
    for (SystemGroup s : listGroup) {
        listGroupInvi.addItem(s.getName());
    }
    Label lblEmail = new Label("Gmail Address");
    FlexTable table = new FlexTable();
    table.setCellPadding(5);
    table.setCellSpacing(5);
    table.setWidget(0, 0, lblEmail);
    table.setWidget(0, 1, txt_email);
    table.setWidget(0, 2, panelValidateEmail);
    table.setWidget(0, 3, listGroupInvi);
    /*table.setWidget(2, 0, panelLog);*/
    table.getCellFormatter().setHorizontalAlignment(0, 0, VerticalPanel.ALIGN_LEFT);
    table.getCellFormatter().setHorizontalAlignment(0, 1, VerticalPanel.ALIGN_RIGHT);
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.add(exitButton);
    dialogVPanel.setCellHorizontalAlignment(exitButton, VerticalPanel.ALIGN_RIGHT);
    dialogVPanel.add(table);
    dialogVPanel.add(panelButton);
    dialogVPanel.setCellHorizontalAlignment(panelButton, VerticalPanel.ALIGN_RIGHT);
    dialogInvite.setWidget(dialogVPanel);
    dialogInvite.getCaption().asWidget().setStyleName("myCaption");
    dialogInvite.center();
}

From source file:co.fxl.gui.gwt.GWTContainer.java

License:Open Source License

@Override
public IButton button() {
    setComponent((T) new Button());
    return (IButton) (element = new GWTButton((GWTContainer<Button>) this));
}

From source file:com.ait.toolkit.editors.ckeditor.client.CKEditor.java

License:Open Source License

/**
 * Initialize the editor/*  w w w  .jav  a  2  s . com*/
 */
private void initCKEditor() {
    div = DOM.createDiv();
    baseTextArea = DOM.createTextArea();
    name = HTMLPanel.createUniqueId();
    div.appendChild(baseTextArea);
    DOM.setElementAttribute(baseTextArea, "name", name);
    this.sinkEvents(Event.ONCLICK | Event.KEYEVENTS);

    if (config.isUsingFormPanel()) {
        FormPanel form = new FormPanel();
        Button submit = new Button();
        submit.addClickHandler(this);
        submit.getElement().setAttribute("name", "submit");
        submit.setVisible(false);
        // .getElement().setAttribute("style", "visibility:hidden");

        form.getElement().appendChild(div);
        form.add(submit);
        initWidget(form);
    } else {
        SimplePanel simplePanel = new SimplePanel();
        simplePanel.getElement().appendChild(div);
        initWidget(simplePanel);
    }
}