AXV09

Untitled

May 14th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. class SecuriedButtonClickListener implements ClickListener {
  2.  
  3. private static final long serialVersionUID = 194416383513769075L;
  4.  
  5. @Inject
  6. private Application myVaadinApplication;
  7.  
  8. @Inject
  9. @Named("FB.appId")
  10. private String appId;
  11.  
  12. @Inject
  13. @Named("FB.redirect")
  14. private String redirect;
  15.  
  16. @Inject
  17. private Random random;
  18.  
  19. @SecureAction
  20. public void buttonClick(ClickEvent event) {
  21. myVaadinApplication.getMainWindow().addComponent(
  22. new Label("Thank you for clicking"));
  23.  
  24. String target = "https://www.facebook.com/dialog/oauth?client_id="
  25. + appId + "&redirect_uri=" + redirect + "&state="
  26. + random.nextInt();
  27. myVaadinApplication.getMainWindow().open(new ExternalResource(target),
  28. "_top");
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment