Results 1 to 2 of 2
  1. #1
    SaintShion is offline Member
    Join Date
    Nov 2011
    Posts
    4
    Rep Power
    0

    Question create window similar to Google Calendar with GWT

    Hello, sorry if I'm posting in wrong forum but did not find the specific forum for my topic.

    I am using the Google Calendar API and GWT.

    I would like to create events as they are created in Google Calendar.
    It seems to me that so called "quick add". You click over the day and then that window appears.

    But the moment I can only enter events with a DatePicker and a Listbox.

    Would you like to do as in the image:
    create window similar to Google Calendar with GWT-quick-add.jpg

    MainEntryPoint.java:
    Java Code:
    public void onClick(ClickEvent event) {
    				String title = lb.getValue(lb.getSelectedIndex()); //getName manda o nome em branco para o google
    				Date start = startDate.getValue();
    				
    				GoogleCalendarUtils ourCalendar = new GoogleCalendarUtils(calendarUrl);
    				ourCalendar.insertCalendarEvent(title, start, new CalendarEventEntryCallback() {
    					@Override
    					public void onSuccess(CalendarEventEntry result) {
    						Window.alert("Event" + result.getTitle().getText() + "was inserted");
    						updateCalendarView();
    					}	
    					@Override
    					public void onFailure(CallErrorException caught) {
    						Window.alert("Error");
    					}
    				});
    			}
    GoogleCalendarUtils.java:
    Java Code:
    private CalendarEventEntry createCalendarEventEntry(String title, Date startDate){
    
    	    CalendarEventEntry eventEntry = CalendarEventEntry.newInstance();
    	    eventEntry.setTitle(Text.newInstance());
    	    eventEntry.getTitle().setText(title);
    	    When when = When.newInstance();
    	    when.setStartTime(DateTime.newInstance(startDate));
    	    eventEntry.addTime(when);
    		return eventEntry;
    	}
    	public void insertCalendarEvent(String title, Date startDate, CalendarEventEntryCallback callback){
    		CalendarEventEntry eventEntry = createCalendarEventEntry(title, startDate);
    		calendarService.insertEntry(calendarUrl, eventEntry, callback);
    	}
    Thank You!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 0
    Last Post: 11-13-2011, 02:47 PM
  2. Help with Google Window Builder!
    By Zorobay in forum AWT / Swing
    Replies: 0
    Last Post: 04-29-2011, 09:06 PM
  3. Why does google calendar have a BLUE background in jframe.
    By Mr.StevenFeldman in forum AWT / Swing
    Replies: 2
    Last Post: 03-09-2011, 05:14 AM
  4. Replies: 1
    Last Post: 11-14-2010, 08:44 AM
  5. Java application using google calendar
    By nikolas8 in forum Java Applets
    Replies: 3
    Last Post: 03-20-2009, 12:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •