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

protected Button(com.google.gwt.dom.client.Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:com.google.gwt.gadgets.sample.traveler.client.TravelMap.java

License:Apache License

private InfoWindowContent newLocationCreateForm(final LatLng point, final LocationHandler handler,
        final InfoWindow info) {
    final TextBox titleBox = new TextBox();
    final TextArea descriptionBox = new TextArea();
    Button saveButton = new Button("Save");
    saveButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            titleBox.setReadOnly(true);//  w w  w  .j  a  v a2  s  . c  o  m
            descriptionBox.setReadOnly(true);
            Location loc = Location.newInstance();
            loc.setTitle(titleBox.getText());
            loc.setDescription(descriptionBox.getText());
            loc.setLatitude(point.getLatitude());
            loc.setLongitude(point.getLongitude());
            loc.setMilis(Long.toString(new Date().getTime()));
            handler.handle(loc);
            info.close();
            map.addOverlay(createMarker(loc));
        }
    });

    VerticalPanel panel = new VerticalPanel();
    panel.add(new HTML("title:"));
    panel.add(titleBox);
    panel.add(new HTML("description"));
    panel.add(descriptionBox);
    panel.add(saveButton);
    panel.setCellHorizontalAlignment(saveButton, HasHorizontalAlignment.ALIGN_RIGHT);
    return new InfoWindowContent(panel);
}

From source file:com.google.gwt.gadgets.sample.traveler.client.TravelMap.java

License:Apache License

private InfoWindowContent newLocationDescription(final Location location, final InfoWindow info,
        final Marker marker) {
    VerticalPanel panel = new VerticalPanel();
    panel.setSpacing(3);/*www. jav a  2  s.  co  m*/
    panel.setWidth("100%");
    Label title = new Label(location.getTitle());
    title.setStylePrimaryName("location-title");
    Label desc = new Label(location.getDescription());
    desc.setStylePrimaryName("location-desc");
    Label date = new Label("Added " + location.getDate());
    date.setStylePrimaryName("location-date");
    panel.add(title);
    panel.add(desc);
    panel.add(date);
    Button deleteButton;
    if (deleteHandler != null) {
        deleteButton = new Button("Delete");
        deleteButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                map.removeOverlay(marker);
                deleteHandler.handle(location);
                info.close();
            }
        });
        panel.add(deleteButton);
        panel.setCellHorizontalAlignment(deleteButton, HasHorizontalAlignment.ALIGN_RIGHT);
    }
    return new InfoWindowContent(panel);
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerCreateBlogPostCommentDemo.java

License:Apache License

/**
 * Starts this demo.//  w  w w  . j  a va 2s .co m
 */
private void startDemo() {
    service = BloggerService.newInstance("HelloGData_Blogger_CreateBlogPostCommentDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Create a blog comment");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                getBlogs("http://www.blogger.com/feeds/default/blogs");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Blogger.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerCreateBlogPostDemo.java

License:Apache License

/**
 * Starts this demo./*from   w  w  w  .java 2 s  .  c  o  m*/
 */
private void startDemo() {
    service = BloggerService.newInstance("HelloGData_Blogger_CreateBlogPostDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Create a blog post");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                getBlogs("http://www.blogger.com/feeds/default/blogs");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Blogger.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerDeleteBlogPostCommentDemo.java

License:Apache License

/**
 * Starts this demo.//from www  .j  a  v a 2  s  . c  o  m
 */
private void startDemo() {
    service = BloggerService.newInstance("HelloGData_Blogger_DeleteBlogPostCommentDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Delete a blog comment");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                getBlogs("http://www.blogger.com/feeds/default/blogs");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Blogger.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerDeleteBlogPostDemo.java

License:Apache License

/**
 * Starts this demo.//ww  w  .  ja  va 2 s.c  o  m
 */
private void startDemo() {
    service = BloggerService.newInstance("HelloGData_Blogger_DeleteBlogPostDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Delete a blog post");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                getBlogs("http://www.blogger.com/feeds/default/blogs");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Blogger.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.BloggerUpdateBlogPostDemo.java

License:Apache License

/**
 * Starts this demo./*from w  w w  .ja v a  2  s . c  o m*/
 */
private void startDemo() {
    service = BloggerService.newInstance("HelloGData_Blogger_UpdateBlogPostDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Update a blog post");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                getBlogs("http://www.blogger.com/feeds/default/blogs");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Blogger.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.CalendarCreateCalendarDemo.java

License:Apache License

/**
 * Starts this demo./*from  ww w .ja va 2s . co m*/
 */
private void startDemo() {
    service = CalendarService.newInstance("HelloGData_Calendar_CreateCalendarDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Create a calendar");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                createCalendar("http://www.google.com/calendar/feeds/default/" + "owncalendars/full");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Google Calendar.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.CalendarCreateEventReminderDemo.java

License:Apache License

/**
 * Starts this demo.//  w  ww .j  a v a 2 s  .co m
 */
private void startDemo() {
    service = CalendarService.newInstance("HelloGData_Calendar_CreateEventReminderDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Create an event reminder");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                createEvent("http://www.google.com/calendar/feeds/default/private/full");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Google Calendar.", true);
    }
}

From source file:com.google.gwt.gdata.sample.hellogdata.client.CalendarCreateEventWithExtendedPropertyDemo.java

License:Apache License

/**
 * Starts this demo./*from   w w w. ja v  a2  s  . co  m*/
 */
private void startDemo() {
    service = CalendarService.newInstance("HelloGData_Calendar_CreateEventWithExtendedPropertyDemo_v2.0");
    if (User.getStatus(scope) == AuthSubStatus.LOGGED_IN) {
        Button startButton = new Button("Create an event with an extended property");
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                createEvent("http://www.google.com/calendar/feeds/default/private/full");
            }
        });
        mainPanel.setWidget(0, 0, startButton);
    } else {
        showStatus("You are not logged on to Google Calendar.", true);
    }
}