SlideShare a Scribd company logo
1 of 28
Download to read offline
Wednesday, November 2, 11
UIBINDER
                            Darrell Meyer, Sencha



             darrell@sencha.com                @darrellmeyer




Wednesday, November 2, 11
Overview
                                What is UiBinder?
                            UiBinder Support in GXT 3
                                    Examples
                                    Question




Wednesday, November 2, 11
What is UiBinder?




Wednesday, November 2, 11
What is UiBinder?
       Declarative markup via Xml
       Supports HTML, Widgets, or both
       Separates user interface code from Java code
       Separation of duties between developers and designers
       Compile time checking between Java and Xml




Wednesday, November 2, 11
Html Example Pt. 1

      <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
      <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder">
        <ui:style>
          .important {
            font-weight: bold;
          }
        </ui:style>
        <div>
          Hello,
          <span class="{style.important}" ui:field="nameSpan" />
        </div>
      </ui:UiBinder>




Wednesday, November 2, 11
Html Example Pt. 2
     public class HelloWorld extends UIObject {

       private static HelloWorldUiBinder uiBinder =
     GWT.create(HelloWorldUiBinder.class);

         interface HelloWorldUiBinder extends UiBinder<Element, HelloWorld> {
         }

         @UiField
         SpanElement nameSpan;

         public HelloWorld(String firstName) {
           setElement(uiBinder.createAndBindUi(this));
           nameSpan.setInnerText(firstName);
         }

     }


Wednesday, November 2, 11
Widget Example Pt. 1
   <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
   <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
   xmlns:g="urn:import:com.google.gwt.user.client.ui">
     <ui:style>
       .important {
         font-weight: bold;
       }
     </ui:style>
     <g:HTMLPanel>
       Hello,
       <g:Button styleName="{style.important}" ui:field="button" />
     </g:HTMLPanel>
   </ui:UiBinder>




Wednesday, November 2, 11
Widget Example Pt. 2
    public class HelloWorldPanel extends Composite implements HasText {

      private static HelloWorldPanelUiBinder uiBinder =
    GWT.create(HelloWorldPanelUiBinder.class);

        interface HelloWorldPanelUiBinder extends UiBinder<Widget, HelloWorldPanel> {
        }

        public HelloWorldPanel() {
          initWidget(uiBinder.createAndBindUi(this));
        }

        @UiField
        Button button;

        @UiHandler("button")
        void onClick(ClickEvent e) {
          Window.alert("Hello!");
        }

    }

Wednesday, November 2, 11
CSS with UiBinder
       Add CSS within Xml
       Reference external CSS
       Works with CssResource
       CSS class names obfuscated




Wednesday, November 2, 11
Inline CSS Example
       <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
         <ui:style>
           .pretty { background-color: Skyblue; }
         </ui:style>

          <ui:style field='otherStyle'>
            .pretty { background-color: Orange; }
          </ui:style>

          <div class='{style.pretty}'>
            Hello, <span class='{otherStyle.pretty}' ui:field='nameSpan'/>.
          </div>

       </ui:UiBinder>




Wednesday, November 2, 11
External CSS Example
       <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
         <ui:style src="MyUi.css" />
         <ui:style field='otherStyle' src="MyUiOtherStyle.css">

         <div class='{style.pretty}'>
           Hello, <span class='{otherStyle.pretty}' ui:field='nameSpan'/>.
         </div>
       </ui:UiBinder>



     ...
     <ui:with field='res' type='com.my.app.widgets.logoname.Resources'/>
     <span class='{res.style.nameSpan}' ui:field='nameSpan'/>
     ...




Wednesday, November 2, 11
GXT 3.0 UiBinder
                                Support




Wednesday, November 2, 11
3.0 UiBinder Support
     2.0
     Can use GXT Components with UiBinder
     Can’t use GXT Containers
     Can’t use GXT LayoutContainer’s with Layouts

      3.0
      Can use GXT Containers
      Can use GXT LayoutData with 2 options
      1. Construct layout data instances in Java
      2. Construct and configure layout data instances in Xml




Wednesday, November 2, 11
Working with ui:with
       Allows object to be created in Xml or referenced by Xml
       Objects created in Xml can’t be configured, only constructed
       With an optional Jar, GXT allows object to be configured
       Optional Jar will not be needed with GWT 2.5




Wednesday, November 2, 11
ui:with
       Creating objects in Java
       @UiField(provided=true) MarginData outerData = new MarginData(20);

       northData.setMargins(new Margins(0, 0, 5, 0));




         <ui:with type="com.sencha.gxt.widget.core.client.container.MarginData"
       field="outerData" />

           ...
           <container:SimpleContainer>
             <container:child layoutData="{outerData}">
               <b:TextButton text="Button" />
             </container:child>
           </container:SimpleContainer>
           ...

Wednesday, November 2, 11
ui:with
       Creating objects in Xml



        <ui:with type="com.sencha.gxt.core.client.util.Margins" field="outerMargins">
          <ui:attributes top="20" right="20" bottom="20" left="20" />
        </ui:with>




Wednesday, November 2, 11
Using Optional Jar
       Without Maven
       Add uibinder-bridge.jar to classpath

       Maven
       Add following entry to pom.xml

       <dependency>
             <groupId>com.sencha.gxt</groupId>
             <artifactId>uibinder-bridge</artifactId>
             <version>${gwt.version}-SNAPSHOT</version>
             <scope>provided</scope>
        </dependency>


       Both
       Add following entry after GWT / GXT User module

       <inherits name="com.sencha.gwt.uibinder.UiBinder" />


Wednesday, November 2, 11
Examples




Wednesday, November 2, 11
Button Aligning




Wednesday, November 2, 11
Button Aligning Code Pt. 1

       <ui:with type="com.sencha.gxt.core.client.util.Margins" field="margins">
         <ui:attributes top="5" right="5" bottom="5" left="5" />
       </ui:with>

     <ui:with type="com.sencha.gxt.widget.core.client.container.MarginData"
   field="layoutData">
       <ui:attributes margins="{margins}" />
     </ui:with>




Wednesday, November 2, 11
Button Aligning Code Pt. 2

         <container:FlowLayoutContainer>
           <container:child layoutData="{layoutData}">
             <gxt:FramedPanel headingText="Button Aligning Example: center"
       buttonAlign="CENTER" pixelSize="500, 150" addStyleNames="white-bg">
               <gxt:button>
                 <button:TextButton text="Button 1" ui:field="button1" />
               </gxt:button>
               <gxt:button>
                 <button:TextButton text="Button 2" ui:field="button2" />
               </gxt:button>
               <gxt:button>
                 <button:TextButton text="Button 3" ui:field="button3" />
               </gxt:button>
             </gxt:FramedPanel>
           </container:child>




Wednesday, November 2, 11
CardLayout Example




Wednesday, November 2, 11
CardLayout Code Pt. 1
        <g:VerticalPanel spacing="10">
          <gxt:FramedPanel ui:field="panel" pixelSize="400, 100"
      headingText="CardLayout Example">
            <container:CardLayoutContainer ui:field="layout">
              <g:Label text="This is the contents for card: 1"
      styleName="{style.text}" />
              <g:Label text="This is the contents for card: 2"
      styleName="{style.text}" />
              ...
            </container:CardLayoutContainer>
            <gxt:button>
              <b:TextButton ui:field="card1Button" text="Card 1" />
            </gxt:button>
              ...
          </gxt:FramedPanel>
        </g:VerticalPanel>




Wednesday, November 2, 11
CardLayout Code Pt. 2
          @UiField CardLayoutContainer layout;
          @UiField FramedPanel panel;

          public Widget asWidget() {
            return uiBinder.createAndBindUi(this);
          }

          public void onModuleLoad() {
              RootPanel.get().add(asWidget());
          }

          @UiHandler({"card1Button", "card2Button", "card3Button", "card4Button"})
          public void onButton1Click(SelectEvent event) {
            TextButton button = (TextButton) event.getSource();
            int index = panel.getButtonBar().getWidgetIndex(button);
            layout.setWidget(layout.getWidget(index));
          }



Wednesday, November 2, 11
ToolBar Example




Wednesday, November 2, 11
ToolBar Code

   <ui:with type="com.sencha.gxt.examples.resources.client.images.ExampleImages"
   field="images" />

   <toolbar:ToolBar>
     <button:TextButton text="Button w/ Menu" icon="{images.menu_show}">
       <button:menu>
         <menu:Menu>
           <menu:CheckMenuItem text="I Like Cats" checked="true" />
           <menu:CheckMenuItem text="I Like Dogs" />
           <menu:SeparatorMenuItem />
         </menu:Menu>
       </button:menu>
     </button:TextButton>

       <toolbar:SeparatorToolItem />
       ...




Wednesday, November 2, 11
Questions?




Wednesday, November 2, 11

More Related Content

What's hot

JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New EvolutionAllan Huang
 
Event handling using jQuery
Event handling using jQueryEvent handling using jQuery
Event handling using jQueryIban Martinez
 
Ext GWT 3.0 Advanced Templates
Ext GWT 3.0 Advanced TemplatesExt GWT 3.0 Advanced Templates
Ext GWT 3.0 Advanced TemplatesSencha
 
Annihilate test smells by refactoring to patterns
Annihilate test smells by refactoring to patternsAnnihilate test smells by refactoring to patterns
Annihilate test smells by refactoring to patternscenny2
 
Special Events: Beyond Custom Events
Special Events: Beyond Custom EventsSpecial Events: Beyond Custom Events
Special Events: Beyond Custom EventsBrandon Aaron
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinonesalertchair8725
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMJonathan Wage
 
Jackson 사용법
Jackson 사용법Jackson 사용법
Jackson 사용법남윤 김
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperJonathan Wage
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinonesnumberlesspasto93
 
Android Testing
Android TestingAndroid Testing
Android TestingEvan Lin
 
Lenguaje de programación jn
Lenguaje de programación jnLenguaje de programación jn
Lenguaje de programación jnJhiselys Vásquez
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMJonathan Wage
 
Programmers, communicate your intentions
Programmers, communicate your intentionsProgrammers, communicate your intentions
Programmers, communicate your intentionsYael Zaritsky Perez
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coveragebrendacuthbert89
 

What's hot (20)

Erlang Introduction
Erlang IntroductionErlang Introduction
Erlang Introduction
 
JQuery New Evolution
JQuery New EvolutionJQuery New Evolution
JQuery New Evolution
 
Event handling using jQuery
Event handling using jQueryEvent handling using jQuery
Event handling using jQuery
 
Ext GWT 3.0 Advanced Templates
Ext GWT 3.0 Advanced TemplatesExt GWT 3.0 Advanced Templates
Ext GWT 3.0 Advanced Templates
 
Annihilate test smells by refactoring to patterns
Annihilate test smells by refactoring to patternsAnnihilate test smells by refactoring to patterns
Annihilate test smells by refactoring to patterns
 
Special Events: Beyond Custom Events
Special Events: Beyond Custom EventsSpecial Events: Beyond Custom Events
Special Events: Beyond Custom Events
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
 
Jackson 사용법
Jackson 사용법Jackson 사용법
Jackson 사용법
 
Doctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document MapperDoctrine MongoDB Object Document Mapper
Doctrine MongoDB Object Document Mapper
 
What Would You Do? With John Quinones
What Would You Do? With John QuinonesWhat Would You Do? With John Quinones
What Would You Do? With John Quinones
 
Android Testing
Android TestingAndroid Testing
Android Testing
 
Lenguaje de programación jn
Lenguaje de programación jnLenguaje de programación jn
Lenguaje de programación jn
 
Symfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODMSymfony Day 2010 Doctrine MongoDB ODM
Symfony Day 2010 Doctrine MongoDB ODM
 
Matreshka.js
Matreshka.jsMatreshka.js
Matreshka.js
 
Matreshka.js
Matreshka.jsMatreshka.js
Matreshka.js
 
Amp Up Your Admin
Amp Up Your AdminAmp Up Your Admin
Amp Up Your Admin
 
Programmers, communicate your intentions
Programmers, communicate your intentionsProgrammers, communicate your intentions
Programmers, communicate your intentions
 
Politics News and U.S. Elections Coverage
Politics News and U.S. Elections CoveragePolitics News and U.S. Elections Coverage
Politics News and U.S. Elections Coverage
 

Similar to Using UIBinder with Ext GWT 3.0

Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJsTudor Barbu
 
classes & objects in cpp overview
classes & objects in cpp overviewclasses & objects in cpp overview
classes & objects in cpp overviewgourav kottawar
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180Mahmoud Samir Fayed
 
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023Johnny Sung
 
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212Mahmoud Samir Fayed
 
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxCalculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxRAHUL126667
 
classes & objects in cpp
classes & objects in cppclasses & objects in cpp
classes & objects in cppgourav kottawar
 
Java script frame history
Java script frame historyJava script frame history
Java script frame historyH K
 
Nuxeo - OpenSocial
Nuxeo - OpenSocialNuxeo - OpenSocial
Nuxeo - OpenSocialThomas Roger
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentationScott Messinger
 
Building a js widget
Building a js widgetBuilding a js widget
Building a js widgetTudor Barbu
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterpriseDave Artz
 
The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181Mahmoud Samir Fayed
 

Similar to Using UIBinder with Ext GWT 3.0 (20)

Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJs
 
classes & objects in cpp overview
classes & objects in cpp overviewclasses & objects in cpp overview
classes & objects in cpp overview
 
The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180The Ring programming language version 1.5.1 book - Part 67 of 180
The Ring programming language version 1.5.1 book - Part 67 of 180
 
Yuihacku iitd-sumana
Yuihacku iitd-sumanaYuihacku iitd-sumana
Yuihacku iitd-sumana
 
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
[Flutter] Flutter Provider 看似簡單卻又不簡單的狀態管理工具 @ Devfest Kaohsiung 2023
 
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212
 
Unit3.pptx
Unit3.pptxUnit3.pptx
Unit3.pptx
 
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docxCalculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
Calculator Week2.DS_Store__MACOSXCalculator Week2._.DS_St.docx
 
classes & objects in cpp
classes & objects in cppclasses & objects in cpp
classes & objects in cpp
 
Java script frame history
Java script frame historyJava script frame history
Java script frame history
 
Nuxeo - OpenSocial
Nuxeo - OpenSocialNuxeo - OpenSocial
Nuxeo - OpenSocial
 
Introduzione a Gwt
Introduzione a GwtIntroduzione a Gwt
Introduzione a Gwt
 
Backbone - TDC 2011 Floripa
Backbone - TDC 2011 FloripaBackbone - TDC 2011 Floripa
Backbone - TDC 2011 Floripa
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentation
 
Building a js widget
Building a js widgetBuilding a js widget
Building a js widget
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Data Binding
Data BindingData Binding
Data Binding
 
jQuery in the [Aol.] Enterprise
jQuery in the [Aol.] EnterprisejQuery in the [Aol.] Enterprise
jQuery in the [Aol.] Enterprise
 
The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181The Ring programming language version 1.5.2 book - Part 68 of 181
The Ring programming language version 1.5.2 book - Part 68 of 181
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 

More from Sencha

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsSencha
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 HighlightsSencha
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridSencha
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportSencha
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsSencha
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSencha
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...Sencha
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...Sencha
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsSencha
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...Sencha
 

More from Sencha (20)

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 

Recently uploaded

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
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 educationjfdjdjcjdnsjd
 
"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 ...Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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...apidays
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
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, ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 businesspanagenda
 

Recently uploaded (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
"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 ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
+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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 

Using UIBinder with Ext GWT 3.0

  • 2. UIBINDER Darrell Meyer, Sencha darrell@sencha.com @darrellmeyer Wednesday, November 2, 11
  • 3. Overview What is UiBinder? UiBinder Support in GXT 3 Examples Question Wednesday, November 2, 11
  • 5. What is UiBinder? Declarative markup via Xml Supports HTML, Widgets, or both Separates user interface code from Java code Separation of duties between developers and designers Compile time checking between Java and Xml Wednesday, November 2, 11
  • 6. Html Example Pt. 1 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"> <ui:style> .important { font-weight: bold; } </ui:style> <div> Hello, <span class="{style.important}" ui:field="nameSpan" /> </div> </ui:UiBinder> Wednesday, November 2, 11
  • 7. Html Example Pt. 2 public class HelloWorld extends UIObject { private static HelloWorldUiBinder uiBinder = GWT.create(HelloWorldUiBinder.class); interface HelloWorldUiBinder extends UiBinder<Element, HelloWorld> { } @UiField SpanElement nameSpan; public HelloWorld(String firstName) { setElement(uiBinder.createAndBindUi(this)); nameSpan.setInnerText(firstName); } } Wednesday, November 2, 11
  • 8. Widget Example Pt. 1 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"> <ui:style> .important { font-weight: bold; } </ui:style> <g:HTMLPanel> Hello, <g:Button styleName="{style.important}" ui:field="button" /> </g:HTMLPanel> </ui:UiBinder> Wednesday, November 2, 11
  • 9. Widget Example Pt. 2 public class HelloWorldPanel extends Composite implements HasText { private static HelloWorldPanelUiBinder uiBinder = GWT.create(HelloWorldPanelUiBinder.class); interface HelloWorldPanelUiBinder extends UiBinder<Widget, HelloWorldPanel> { } public HelloWorldPanel() { initWidget(uiBinder.createAndBindUi(this)); } @UiField Button button; @UiHandler("button") void onClick(ClickEvent e) { Window.alert("Hello!"); } } Wednesday, November 2, 11
  • 10. CSS with UiBinder Add CSS within Xml Reference external CSS Works with CssResource CSS class names obfuscated Wednesday, November 2, 11
  • 11. Inline CSS Example <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'> <ui:style> .pretty { background-color: Skyblue; } </ui:style> <ui:style field='otherStyle'> .pretty { background-color: Orange; } </ui:style> <div class='{style.pretty}'> Hello, <span class='{otherStyle.pretty}' ui:field='nameSpan'/>. </div> </ui:UiBinder> Wednesday, November 2, 11
  • 12. External CSS Example <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'> <ui:style src="MyUi.css" /> <ui:style field='otherStyle' src="MyUiOtherStyle.css"> <div class='{style.pretty}'> Hello, <span class='{otherStyle.pretty}' ui:field='nameSpan'/>. </div> </ui:UiBinder> ... <ui:with field='res' type='com.my.app.widgets.logoname.Resources'/> <span class='{res.style.nameSpan}' ui:field='nameSpan'/> ... Wednesday, November 2, 11
  • 13. GXT 3.0 UiBinder Support Wednesday, November 2, 11
  • 14. 3.0 UiBinder Support 2.0 Can use GXT Components with UiBinder Can’t use GXT Containers Can’t use GXT LayoutContainer’s with Layouts 3.0 Can use GXT Containers Can use GXT LayoutData with 2 options 1. Construct layout data instances in Java 2. Construct and configure layout data instances in Xml Wednesday, November 2, 11
  • 15. Working with ui:with Allows object to be created in Xml or referenced by Xml Objects created in Xml can’t be configured, only constructed With an optional Jar, GXT allows object to be configured Optional Jar will not be needed with GWT 2.5 Wednesday, November 2, 11
  • 16. ui:with Creating objects in Java @UiField(provided=true) MarginData outerData = new MarginData(20); northData.setMargins(new Margins(0, 0, 5, 0)); <ui:with type="com.sencha.gxt.widget.core.client.container.MarginData" field="outerData" /> ... <container:SimpleContainer> <container:child layoutData="{outerData}"> <b:TextButton text="Button" /> </container:child> </container:SimpleContainer> ... Wednesday, November 2, 11
  • 17. ui:with Creating objects in Xml <ui:with type="com.sencha.gxt.core.client.util.Margins" field="outerMargins"> <ui:attributes top="20" right="20" bottom="20" left="20" /> </ui:with> Wednesday, November 2, 11
  • 18. Using Optional Jar Without Maven Add uibinder-bridge.jar to classpath Maven Add following entry to pom.xml <dependency> <groupId>com.sencha.gxt</groupId> <artifactId>uibinder-bridge</artifactId> <version>${gwt.version}-SNAPSHOT</version> <scope>provided</scope> </dependency> Both Add following entry after GWT / GXT User module <inherits name="com.sencha.gwt.uibinder.UiBinder" /> Wednesday, November 2, 11
  • 21. Button Aligning Code Pt. 1 <ui:with type="com.sencha.gxt.core.client.util.Margins" field="margins"> <ui:attributes top="5" right="5" bottom="5" left="5" /> </ui:with> <ui:with type="com.sencha.gxt.widget.core.client.container.MarginData" field="layoutData"> <ui:attributes margins="{margins}" /> </ui:with> Wednesday, November 2, 11
  • 22. Button Aligning Code Pt. 2 <container:FlowLayoutContainer> <container:child layoutData="{layoutData}"> <gxt:FramedPanel headingText="Button Aligning Example: center" buttonAlign="CENTER" pixelSize="500, 150" addStyleNames="white-bg"> <gxt:button> <button:TextButton text="Button 1" ui:field="button1" /> </gxt:button> <gxt:button> <button:TextButton text="Button 2" ui:field="button2" /> </gxt:button> <gxt:button> <button:TextButton text="Button 3" ui:field="button3" /> </gxt:button> </gxt:FramedPanel> </container:child> Wednesday, November 2, 11
  • 24. CardLayout Code Pt. 1 <g:VerticalPanel spacing="10"> <gxt:FramedPanel ui:field="panel" pixelSize="400, 100" headingText="CardLayout Example"> <container:CardLayoutContainer ui:field="layout"> <g:Label text="This is the contents for card: 1" styleName="{style.text}" /> <g:Label text="This is the contents for card: 2" styleName="{style.text}" /> ... </container:CardLayoutContainer> <gxt:button> <b:TextButton ui:field="card1Button" text="Card 1" /> </gxt:button> ... </gxt:FramedPanel> </g:VerticalPanel> Wednesday, November 2, 11
  • 25. CardLayout Code Pt. 2 @UiField CardLayoutContainer layout; @UiField FramedPanel panel; public Widget asWidget() { return uiBinder.createAndBindUi(this); } public void onModuleLoad() { RootPanel.get().add(asWidget()); } @UiHandler({"card1Button", "card2Button", "card3Button", "card4Button"}) public void onButton1Click(SelectEvent event) { TextButton button = (TextButton) event.getSource(); int index = panel.getButtonBar().getWidgetIndex(button); layout.setWidget(layout.getWidget(index)); } Wednesday, November 2, 11
  • 27. ToolBar Code <ui:with type="com.sencha.gxt.examples.resources.client.images.ExampleImages" field="images" /> <toolbar:ToolBar> <button:TextButton text="Button w/ Menu" icon="{images.menu_show}"> <button:menu> <menu:Menu> <menu:CheckMenuItem text="I Like Cats" checked="true" /> <menu:CheckMenuItem text="I Like Dogs" /> <menu:SeparatorMenuItem /> </menu:Menu> </button:menu> </button:TextButton> <toolbar:SeparatorToolItem /> ... Wednesday, November 2, 11