SlideShare uma empresa Scribd logo
1 de 51
 
GWT Extreme! Performance and Flexibility ,[object Object],[object Object]
BUDD:  Why did he call it GWT Extreme? BILL:  I guess he thought it sounded kinda cool.
Extreme Performance and Flexibility ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
GWT Bloated and Slow? Think Again ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],“ Faster and Smaller than Possible” Code
GwtQuery (aka GQuery) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
GwtQuery Example Runtime Evaluation ,[object Object],import gwtquery.client.GwtQuery; import static gwtquery.client.GwtQuery.$; public class GwtQueryModule implements EntryPoint { public void onModuleLoad() { $( “ul.menu > li:first-child” ).html(“hello”); } }
GwtQuery Example What does the $(selector) function translate into? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Digression: Generators ,[object Object],[object Object],[object Object],[object Object]
GwtQuery Example Compile-time  parsing ,[object Object],[object Object],[object Object],public MySelectors extends  Selectors  { @Selector ( “ul.menu > li:first-child” ) GQuery  allFirstMenuItems (); } MySelectors selector =  GWT.create ( MySelectors.class ); selector. allFirstMenuItems ().html(“hello”);
GwtQuery Example Compile-time  parsing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
GwtQuery Example Compile Time Parsing: Bottom Line ul > li:first-child becomes document.evaluate(“ul/li[position() = 1]”)
GwtQuery Example How big is the output? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Caveats and Objections ,[object Object],[object Object],[object Object],[object Object],[object Object]
Demo: Progressively Enhancing <UL> into PowerPoint-like slide transitions Sample Code < div   class =&quot; slide  transition-fade&quot;> Slide 1 < ul  class=&quot;transition-fade&quot;> < li > Point One </li> < li > Point Two </li> < li > Point Three </li> </ul> </div> < div   class =&quot; slide  transition-fade&quot;> Slide 2 < ul  class=&quot;transition-appear&quot;> < li > Slide 2 Point One </li> < li > Slide 2 Point Two </li> < li > Slide 3 Point Three </li> </ul> </div>
GwtQuery code Sample Code for Selectors needed interface  Slide  extends  Selectors  { // find all LI elements rooted at ctx @Selector ( &quot;li&quot; ) NodeList<Element>  slideBulletsCtx ( Node ctx ); // Find all DIV elements with class 'slide' @Selector ( &quot;div.slide&quot; ) NodeList<Element>  allSlides (); }
GwtQuery code Sample Code for Event Handling final   Slide s  =  GWT.create ( Slide.class ) ; $(Document.get().getBody()).click(new Function() { int curSlide = 0; int curBullet = 0; GQuery slides = $(s. allSlides() ); GQuery bullets = $(s. slideBulletsCtx( slides.get(curSlide) ) ); public boolean f(Event e) { if (curBullet < bullets.size())  bullets.eq(curBullet++).as(Effects).fadeIn(); else  bullets.css(&quot;opacity&quot;,&quot;0&quot;); slides.eq(curSlide).css(&quot;display&quot;, &quot;none&quot;); curSlide++; if(curSlide == slides.size()) curSlide = 0; curBullet = 0; bullets = $(s.slideBulletsCtx(slides.get(curSlide))); slides.eq(curSlide).css(&quot;display&quot;,&quot;block&quot;) .as(Effects).fadeIn(); return true; } });
Sample of Generated Output for Selector “.slide li” W3C Selector API version public class SlideNativeImpl extends SelectorEngine implements MySelectors { public final NodeList<Element> slideBullets() { return querySelectorAll ( &quot;.slide li&quot; ); } }
Sample of Generated Output for Selector “.slide li” XPath Version public class SlideXPathImpl extends SelectorEngine implements Slide { public final NodeList<Element> slideBullets() { return xpathEvaluate ( &quot;./descendant::*[contains(concat(' ', @class, ' '), ' slide ')]/descendant::li&quot; ); } }
GWT Query ,[object Object],[object Object],[object Object]
High Performance Graphics
Extreme Graphics Performance ,[object Object],[object Object],[object Object],[object Object],[object Object]
Extreme Graphics Performance: Display Lists ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Extreme Graphics Performance and Flexibility: Chronoscope Chart Library Chronoscope Chart Library ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some insights from porting to GWT 1.5 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Chronoscope and Mobile Code with GWT ,[object Object],[object Object],[object Object],[object Object]
Integrating GWT with other Environments
Integrating GWT with other environments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example: Syndroid Gadgets can span many Platforms Android iGoogle OSX Google Desktop Yahoo And many Flash widget startups
Example: Syndroid ,[object Object],[object Object],[object Object],[object Object],[object Object]
Example: Android Native Interface What if Android browser had a window.locationService object? public class  LocationServiceClient   implements LocationService  { public native String  getLocation()  /*-{ return   $wnd. locationService . getLocation() ; }-*/; }
Generators + Linkers = Awesomeness ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Android Native Interface AndroidNativeInterface  LocationService  String getLocation(); extends LocationServiceClient String getLocation() {  return $wnd.locationService.getLocation(); } implements Emitted by Generator LocationServiceImpl String getLocation() {  return  ...android native code... } impl Written by Developer Android Bootstrap Bind  LocationServiceImpl  to window.locationService Provided by Linker
Example: Android Native Interface Synchronous RPC public interface  AndroidNativeInterface  {} @ANIBinding ( &quot;locationService&quot; ) @ImplementedBy ( &quot;LocationServiceImpl&quot; ) public interface  LocationService   extends AndroidNativeInterface  { String  getLocation (); }
Example: Android Native Interface Implement Android side (not legal GWT code!) public class  LocationServiceImpl   implements LocationService  { public String  getLocation () { try { Location currentLocation = ((LocationManager)  context.getSystemService(Context.LOCATION_SERVICE)) .getCurrentLocation(&quot;gps&quot;); return &quot;Lat: &quot;+currentLocation.getLatitude()+ &quot;, Long: &quot;+currentLocation.getLongitude() ; } catch (Throwable e) { return &quot;ExceptionInNativeAndroid:&quot;+e.getClass().getName()+&quot;: &quot;+e.getMessage(); } } }
Example: Android Native Interface To use LocationService  service =  GWT.create ( LocationService.class ); Window.alert(“Your location is: “+ service.getLocation() );
Example: Linker Generated BootstrapActivity LocationServiceImpl gets exposed as  window.locationService public class BootstrapActivity extends Activity {  @Override  public void onCreate(Bundle icicle) {  super.onCreate(icicle);  setContentView(getBootstrapView()); } public WebView getBootstrapView() {  WebView wv=new WebView(this);  wv.getSettings().setJavaScriptEnabled(true);  wv.getSettings().setUseDesktopUserAgent(true);  wv.getSettings().setLoadsImagesAutomatically(true);  wv.addJavascriptInterface(new ContactsServiceImpl(this), &quot;contactsService&quot;);  wv.addJavascriptInterface(new  LocationServiceImpl (this), &quot;locationService&quot; );   wv.loadUrl(&quot;file:///android_asset/index.html&quot;);  return wv;  } } @ImplementedBy @ANIBinding
Example: Linker Generated Manifest Needed by Android <manifest xmlns:android=&quot; http://schemas.android.com/apk/res/android &quot; package=&quot;syndroid.demo.SyndroidDemo&quot;><uses-permission  android:name=&quot;android.permission.ACCESS_LOCATION&quot;/><uses-permission android:name=&quot;android.permission.ACCESS_GPS&quot;/><uses-permission  android:name=&quot;android.permission.ACCESS_ASSISTED_GPS&quot;/> <application>  <activity android:name=&quot;BootstrapActivity&quot;  android:label=&quot;SyndroidDemo&quot;>  <intent-filter>  <action android:name=&quot;android.intent.action.MAIN&quot;/>  <category android:name=&quot;android.intent.category.LAUNCHER&quot;/>  </intent-filter>  </activity> </application></manifest>
Example: Linker Generated Build Script Used to compile and package APK file mkdir resmkdir classes $ANDROID_HOME/tools/aapt compile  -m -J src -M AndroidManifest.xml -I $ANDROID_HOME/android.jar find src -name '*.java' -print >src.list javac -cp $ANDROID_HOME/android.jar @src.list -d classes $ANDROID_HOME/tools/dx -JXmx384M --dex --output=classes.dex -- locals=full --positions=lines classes/ $ANDROID_HOME/tools/aapt package -f -c -M AndroidManifest.xml  -A assets -I $ANDROID_HOME/android.jar SyndroidDemo.apk zip SyndroidDemo.apk classes.dex
Client Stub Generator ,[object Object],[object Object],[object Object],[object Object],[object Object]
Generator to Linker Communication ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using Linker Generate Bootstrap/Package for APT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Future Directions ,[object Object],[object Object],[object Object]
Compiling GWT to Flash
Reusing the same Design Pattern for Flash ,[object Object],[object Object],[object Object],[object Object],[object Object]
ActionScript Native Interface ActionScriptNativeInterface  DrawService void drawLine(x,y); extends DrawServiceClient void drawLine(int x, int y) {  $wnd.flashPlugin.drawLine(x, y); } implements Emitted by Generator package foo.flash; native void drawLine(int x, int y) /*-{  ... actionscript code to draw line ...  }-*/; impl Written by Developer Flash Bootstrap generate main() Export drawLine(x,y)  via ExternalInterface Provided by Linker
Compiling Java to ActionScript with GWT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Packaging GWT output as SWF? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Writing Gears Workers in GWT ,[object Object],[object Object],[object Object],[object Object],[object Object]
Q&A? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 

Mais conteúdo relacionado

Mais procurados

Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
catherinewall
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010
Chris Ramsdale
 

Mais procurados (20)

Cannibalising The Google App Engine
Cannibalising The  Google  App  EngineCannibalising The  Google  App  Engine
Cannibalising The Google App Engine
 
HTML5 Real-Time and Connectivity
HTML5 Real-Time and ConnectivityHTML5 Real-Time and Connectivity
HTML5 Real-Time and Connectivity
 
JBoss World 2010
JBoss World 2010JBoss World 2010
JBoss World 2010
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun Again
 
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWS
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWSConfiguring Highly Scalable Compile Masters, Vasco Cardoso, AWS
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWS
 
Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++Going native with less coupling: Dependency Injection in C++
Going native with less coupling: Dependency Injection in C++
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
 
The Workflow Pattern, Composed (2021)
The Workflow Pattern, Composed (2021)The Workflow Pattern, Composed (2021)
The Workflow Pattern, Composed (2021)
 
How to Add Original Library to Android NDK
How to Add Original Library to Android NDKHow to Add Original Library to Android NDK
How to Add Original Library to Android NDK
 
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesEWD 3 Training Course Part 14: Using Ajax for QEWD Messages
EWD 3 Training Course Part 14: Using Ajax for QEWD Messages
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)Asynchronous Module Definition (AMD)
Asynchronous Module Definition (AMD)
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
Google io extended '17 인천
Google io extended '17 인천Google io extended '17 인천
Google io extended '17 인천
 
Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009Dynamic Languages Web Frameworks Indicthreads 2009
Dynamic Languages Web Frameworks Indicthreads 2009
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django Architecture
 

Destaque

vehicole extravagante
vehicole extravagantevehicole extravagante
vehicole extravagante
sokoban
 
Magnifique et invitant Tyrol
Magnifique et invitant TyrolMagnifique et invitant Tyrol
Magnifique et invitant Tyrol
sokoban
 
Christian boltanski
Christian boltanskiChristian boltanski
Christian boltanski
juan paez
 
Nurbaya Initiative
Nurbaya InitiativeNurbaya Initiative
Nurbaya Initiative
andysj
 
Educating charlie using content
Educating charlie using contentEducating charlie using content
Educating charlie using content
ReinҲ Rein
 
湖山水庫工程計畫環境影響調查報告
湖山水庫工程計畫環境影響調查報告湖山水庫工程計畫環境影響調查報告
湖山水庫工程計畫環境影響調查報告
relax.chi
 
Snow in Norvegia
Snow in NorvegiaSnow in Norvegia
Snow in Norvegia
sokoban
 
Greenfields
GreenfieldsGreenfields
Greenfields
sokoban
 
三峽隆恩埔原住民族文化部落新建工程
三峽隆恩埔原住民族文化部落新建工程三峽隆恩埔原住民族文化部落新建工程
三峽隆恩埔原住民族文化部落新建工程
relax.chi
 

Destaque (20)

Make Something Worth Sharing
Make Something Worth SharingMake Something Worth Sharing
Make Something Worth Sharing
 
2014-04-04 PaperFree Web•Tech•Law presentation
2014-04-04 PaperFree Web•Tech•Law presentation2014-04-04 PaperFree Web•Tech•Law presentation
2014-04-04 PaperFree Web•Tech•Law presentation
 
Azalee
AzaleeAzalee
Azalee
 
Meeting FFSAM Abstract
Meeting FFSAM AbstractMeeting FFSAM Abstract
Meeting FFSAM Abstract
 
vehicole extravagante
vehicole extravagantevehicole extravagante
vehicole extravagante
 
2014-04-16 Protection of Personal Information Act Readiness Workshop
2014-04-16 Protection of Personal Information Act Readiness Workshop2014-04-16 Protection of Personal Information Act Readiness Workshop
2014-04-16 Protection of Personal Information Act Readiness Workshop
 
Magnifique et invitant Tyrol
Magnifique et invitant TyrolMagnifique et invitant Tyrol
Magnifique et invitant Tyrol
 
Riseof technology
Riseof technologyRiseof technology
Riseof technology
 
Software engineering at the speed of technology
Software engineering at the speed of technologySoftware engineering at the speed of technology
Software engineering at the speed of technology
 
Challenges in adapting predictive analytics
Challenges  in  adapting  predictive  analyticsChallenges  in  adapting  predictive  analytics
Challenges in adapting predictive analytics
 
Christian boltanski
Christian boltanskiChristian boltanski
Christian boltanski
 
Presentation – Mobile Show Africa 2012
Presentation – Mobile Show Africa 2012Presentation – Mobile Show Africa 2012
Presentation – Mobile Show Africa 2012
 
Nurbaya Initiative
Nurbaya InitiativeNurbaya Initiative
Nurbaya Initiative
 
Educating charlie using content
Educating charlie using contentEducating charlie using content
Educating charlie using content
 
湖山水庫工程計畫環境影響調查報告
湖山水庫工程計畫環境影響調查報告湖山水庫工程計畫環境影響調查報告
湖山水庫工程計畫環境影響調查報告
 
Excitans - Visievorming op zorg-ICT
Excitans - Visievorming op zorg-ICTExcitans - Visievorming op zorg-ICT
Excitans - Visievorming op zorg-ICT
 
Snow in Norvegia
Snow in NorvegiaSnow in Norvegia
Snow in Norvegia
 
Greenfields
GreenfieldsGreenfields
Greenfields
 
三峽隆恩埔原住民族文化部落新建工程
三峽隆恩埔原住民族文化部落新建工程三峽隆恩埔原住民族文化部落新建工程
三峽隆恩埔原住民族文化部落新建工程
 
Media And Money
Media And MoneyMedia And Money
Media And Money
 

Semelhante a GWT Extreme!

SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer
 
Web polyglot programming
Web polyglot programmingWeb polyglot programming
Web polyglot programming
Dmitry Buzdin
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
marpierc
 

Semelhante a GWT Extreme! (20)

SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
Web polyglot programming
Web polyglot programmingWeb polyglot programming
Web polyglot programming
 
JavaOne TS-5098 Groovy SwingBuilder
JavaOne TS-5098 Groovy SwingBuilderJavaOne TS-5098 Groovy SwingBuilder
JavaOne TS-5098 Groovy SwingBuilder
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
 
Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Mlocjs buzdin
Mlocjs buzdinMlocjs buzdin
Mlocjs buzdin
 
Think jQuery
Think jQueryThink jQuery
Think jQuery
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 
5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)5 x HTML5 worth using in APEX (5)
5 x HTML5 worth using in APEX (5)
 
GQuery a jQuery clone for Gwt, RivieraDev 2011
GQuery a jQuery clone for Gwt, RivieraDev 2011GQuery a jQuery clone for Gwt, RivieraDev 2011
GQuery a jQuery clone for Gwt, RivieraDev 2011
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than You
 
GWT 2 Is Smarter Than You
GWT 2 Is Smarter Than YouGWT 2 Is Smarter Than You
GWT 2 Is Smarter Than You
 
HTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game TechHTML5 and Other Modern Browser Game Tech
HTML5 and Other Modern Browser Game Tech
 
Introduction to Go language
Introduction to Go languageIntroduction to Go language
Introduction to Go language
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

GWT Extreme!

  • 1.  
  • 2.
  • 3. BUDD: Why did he call it GWT Extreme? BILL: I guess he thought it sounded kinda cool.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. GwtQuery Example Compile Time Parsing: Bottom Line ul > li:first-child becomes document.evaluate(“ul/li[position() = 1]”)
  • 13.
  • 14.
  • 15. Demo: Progressively Enhancing <UL> into PowerPoint-like slide transitions Sample Code < div class =&quot; slide transition-fade&quot;> Slide 1 < ul class=&quot;transition-fade&quot;> < li > Point One </li> < li > Point Two </li> < li > Point Three </li> </ul> </div> < div class =&quot; slide transition-fade&quot;> Slide 2 < ul class=&quot;transition-appear&quot;> < li > Slide 2 Point One </li> < li > Slide 2 Point Two </li> < li > Slide 3 Point Three </li> </ul> </div>
  • 16. GwtQuery code Sample Code for Selectors needed interface Slide extends Selectors { // find all LI elements rooted at ctx @Selector ( &quot;li&quot; ) NodeList<Element> slideBulletsCtx ( Node ctx ); // Find all DIV elements with class 'slide' @Selector ( &quot;div.slide&quot; ) NodeList<Element> allSlides (); }
  • 17. GwtQuery code Sample Code for Event Handling final Slide s = GWT.create ( Slide.class ) ; $(Document.get().getBody()).click(new Function() { int curSlide = 0; int curBullet = 0; GQuery slides = $(s. allSlides() ); GQuery bullets = $(s. slideBulletsCtx( slides.get(curSlide) ) ); public boolean f(Event e) { if (curBullet < bullets.size()) bullets.eq(curBullet++).as(Effects).fadeIn(); else bullets.css(&quot;opacity&quot;,&quot;0&quot;); slides.eq(curSlide).css(&quot;display&quot;, &quot;none&quot;); curSlide++; if(curSlide == slides.size()) curSlide = 0; curBullet = 0; bullets = $(s.slideBulletsCtx(slides.get(curSlide))); slides.eq(curSlide).css(&quot;display&quot;,&quot;block&quot;) .as(Effects).fadeIn(); return true; } });
  • 18. Sample of Generated Output for Selector “.slide li” W3C Selector API version public class SlideNativeImpl extends SelectorEngine implements MySelectors { public final NodeList<Element> slideBullets() { return querySelectorAll ( &quot;.slide li&quot; ); } }
  • 19. Sample of Generated Output for Selector “.slide li” XPath Version public class SlideXPathImpl extends SelectorEngine implements Slide { public final NodeList<Element> slideBullets() { return xpathEvaluate ( &quot;./descendant::*[contains(concat(' ', @class, ' '), ' slide ')]/descendant::li&quot; ); } }
  • 20.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Integrating GWT with other Environments
  • 28.
  • 29. Example: Syndroid Gadgets can span many Platforms Android iGoogle OSX Google Desktop Yahoo And many Flash widget startups
  • 30.
  • 31. Example: Android Native Interface What if Android browser had a window.locationService object? public class LocationServiceClient implements LocationService { public native String getLocation() /*-{ return $wnd. locationService . getLocation() ; }-*/; }
  • 32.
  • 33. Android Native Interface AndroidNativeInterface LocationService String getLocation(); extends LocationServiceClient String getLocation() { return $wnd.locationService.getLocation(); } implements Emitted by Generator LocationServiceImpl String getLocation() { return ...android native code... } impl Written by Developer Android Bootstrap Bind LocationServiceImpl to window.locationService Provided by Linker
  • 34. Example: Android Native Interface Synchronous RPC public interface AndroidNativeInterface {} @ANIBinding ( &quot;locationService&quot; ) @ImplementedBy ( &quot;LocationServiceImpl&quot; ) public interface LocationService extends AndroidNativeInterface { String getLocation (); }
  • 35. Example: Android Native Interface Implement Android side (not legal GWT code!) public class LocationServiceImpl implements LocationService { public String getLocation () { try { Location currentLocation = ((LocationManager) context.getSystemService(Context.LOCATION_SERVICE)) .getCurrentLocation(&quot;gps&quot;); return &quot;Lat: &quot;+currentLocation.getLatitude()+ &quot;, Long: &quot;+currentLocation.getLongitude() ; } catch (Throwable e) { return &quot;ExceptionInNativeAndroid:&quot;+e.getClass().getName()+&quot;: &quot;+e.getMessage(); } } }
  • 36. Example: Android Native Interface To use LocationService service = GWT.create ( LocationService.class ); Window.alert(“Your location is: “+ service.getLocation() );
  • 37. Example: Linker Generated BootstrapActivity LocationServiceImpl gets exposed as window.locationService public class BootstrapActivity extends Activity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(getBootstrapView()); } public WebView getBootstrapView() { WebView wv=new WebView(this); wv.getSettings().setJavaScriptEnabled(true); wv.getSettings().setUseDesktopUserAgent(true); wv.getSettings().setLoadsImagesAutomatically(true); wv.addJavascriptInterface(new ContactsServiceImpl(this), &quot;contactsService&quot;); wv.addJavascriptInterface(new LocationServiceImpl (this), &quot;locationService&quot; ); wv.loadUrl(&quot;file:///android_asset/index.html&quot;); return wv; } } @ImplementedBy @ANIBinding
  • 38. Example: Linker Generated Manifest Needed by Android <manifest xmlns:android=&quot; http://schemas.android.com/apk/res/android &quot; package=&quot;syndroid.demo.SyndroidDemo&quot;><uses-permission android:name=&quot;android.permission.ACCESS_LOCATION&quot;/><uses-permission android:name=&quot;android.permission.ACCESS_GPS&quot;/><uses-permission android:name=&quot;android.permission.ACCESS_ASSISTED_GPS&quot;/> <application> <activity android:name=&quot;BootstrapActivity&quot; android:label=&quot;SyndroidDemo&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot;/> <category android:name=&quot;android.intent.category.LAUNCHER&quot;/> </intent-filter> </activity> </application></manifest>
  • 39. Example: Linker Generated Build Script Used to compile and package APK file mkdir resmkdir classes $ANDROID_HOME/tools/aapt compile -m -J src -M AndroidManifest.xml -I $ANDROID_HOME/android.jar find src -name '*.java' -print >src.list javac -cp $ANDROID_HOME/android.jar @src.list -d classes $ANDROID_HOME/tools/dx -JXmx384M --dex --output=classes.dex -- locals=full --positions=lines classes/ $ANDROID_HOME/tools/aapt package -f -c -M AndroidManifest.xml -A assets -I $ANDROID_HOME/android.jar SyndroidDemo.apk zip SyndroidDemo.apk classes.dex
  • 40.
  • 41.
  • 42.
  • 43.
  • 45.
  • 46. ActionScript Native Interface ActionScriptNativeInterface DrawService void drawLine(x,y); extends DrawServiceClient void drawLine(int x, int y) { $wnd.flashPlugin.drawLine(x, y); } implements Emitted by Generator package foo.flash; native void drawLine(int x, int y) /*-{ ... actionscript code to draw line ... }-*/; impl Written by Developer Flash Bootstrap generate main() Export drawLine(x,y) via ExternalInterface Provided by Linker
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.