introducing ext gwt 3.0

61
Thursday, November 3, 2011

Upload: sencha

Post on 27-Jan-2015

114 views

Category:

Technology


4 download

DESCRIPTION

This session will provide an overview of Ext GWT 3.0. There are many new features and lots of new functionality in this major release including Cell-based data widgets, Cell-based fields, a new data API, new charts, and theming.

TRANSCRIPT

Page 1: Introducing Ext GWT 3.0

Thursday, November 3, 2011

Page 2: Introducing Ext GWT 3.0

Darrell Meyer, Sencha

Ext GWT [email protected] @darrellmeyer

Thursday, November 3, 2011

Page 3: Introducing Ext GWT 3.0

OverviewRelease Goals

Feature OverviewRelease Timeline

Thursday, November 3, 2011

Page 4: Introducing Ext GWT 3.0

Name Games

Google Web Toolkit “G-W-T” “Gwit”

Ext GWT “E-X-T-G-W-T” “X-Gwit” “G-X-T”

Thursday, November 3, 2011

Page 5: Introducing Ext GWT 3.0

Ext GWT 3.0 Goals

Thursday, November 3, 2011

Page 6: Introducing Ext GWT 3.0

Primary Goals

Leverage the power of GWT and its compilerUse GWT API’s where applicable for better interoperabilityIntegrate and support best practices of GWTBuild and release through Maven

Thursday, November 3, 2011

Page 7: Introducing Ext GWT 3.0

Syncing with GWT

GXT 2.0 GXT 3.0

Events & Listeners Custom GWT

Rendering Deferred Direct

Interface Based No Yes

Models Custom POJO

UiBinder Support No Yes

SafeHtml Support No Yes

GWT Based Charts Flash Yes

Theming Custom ClientBundle

Thursday, November 3, 2011

Page 8: Introducing Ext GWT 3.0

Feature Overview

Thursday, November 3, 2011

Page 9: Introducing Ext GWT 3.0

FeaturesModels

Stores & LoadersTemplates

Widget ChangesCells & Cell Widgets

LayoutsUiBinderCharts

Theming & Appearance

Thursday, November 3, 2011

Page 10: Introducing Ext GWT 3.0

Models

Thursday, November 3, 2011

Page 11: Introducing Ext GWT 3.0

Model Support

2.0Forced users to work with GXT ModelsModels kept internal map for dataNot strongly typed

3.0Full support for any POJOSupports RPC, RequestFactory, AutoBeansData Stores take any object type

Thursday, November 3, 2011

Page 12: Introducing Ext GWT 3.0

Server Communications

Transport Data TypeRPC POJOs

RequestFactory EntityProxy / AutoBeanRequestBuilder (XML / JSON) Interface / AutoBean

Thursday, November 3, 2011

Page 13: Introducing Ext GWT 3.0

ValueProviderAllows access to an object’s propertySupports string based pathSupports nested propertiesCan be created directlyCan be created by generator

Thursday, November 3, 2011

Page 14: Introducing Ext GWT 3.0

ValueProviderAllows access to an object’s propertySupports string based pathSupports nested propertiesCan be created directlyCan be created by generator

Thursday, November 3, 2011

Page 15: Introducing Ext GWT 3.0

ValueProvider

interface PostProperties extends PropertyAccess<Post> {

ValueProvider<Post, String> username();

ValueProvider<Post, String> forum();

ValueProvider<Post, Date> date(); }

// create properties instance via deferred binding PostProperties props = GWT.create(PostProperties.class);

// use value providers new ColumnConfig<Post, String>(props.forum(), 150, "Forum");

Thursday, November 3, 2011

Page 16: Introducing Ext GWT 3.0

Stores & Loaders

Thursday, November 3, 2011

Page 17: Introducing Ext GWT 3.0

StoresStores are client-side collections of dataFiltering and sortingChange eventsAccept any object typeData widgets are bound to stores

ListStore TreeStore

Store

Thursday, November 3, 2011

Page 18: Introducing Ext GWT 3.0

LoadersLoader: Builds requests, sends to DataProxyDataProxy: Makes request to serverDataReader: Translates wire-format to objectsDataWriter: Translates objects to wire-format

DataProxy DataReader

Loader

Thursday, November 3, 2011

Page 19: Introducing Ext GWT 3.0

Loader Interaction

Thursday, November 3, 2011

Page 20: Introducing Ext GWT 3.0

Loader

Loader Interaction

Thursday, November 3, 2011

Page 21: Introducing Ext GWT 3.0

Loader DataProxy

Loader Interaction

Thursday, November 3, 2011

Page 22: Introducing Ext GWT 3.0

Loader DataProxy Server

Loader Interaction

Thursday, November 3, 2011

Page 23: Introducing Ext GWT 3.0

Loader DataProxy Server

Loader Interaction

Thursday, November 3, 2011

Page 24: Introducing Ext GWT 3.0

Loader DataProxy Server

Loader Interaction

Thursday, November 3, 2011

Page 25: Introducing Ext GWT 3.0

Loader DataProxy Server

DataReader

Loader Interaction

Thursday, November 3, 2011

Page 26: Introducing Ext GWT 3.0

DataProxy Example

String path = "data/data.xml";

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, path);

HttpProxy<ListLoadConfig> proxy = new HttpProxy<ListLoadConfig>(builder);

HttpProxy works with GWT RequestBuilderThe type parameters defines the input and return type

Thursday, November 3, 2011

Page 27: Introducing Ext GWT 3.0

DataReader Example

reader = new XmlReader<ListLoadResult<Email>, EmailCollection>(factory, EmailCollection.class) {

protected ListLoadResult<Email> createReturnData(Object loadConfig, EmailCollection records) { return new BaseListLoadResult<Email>(records.getValues()); };

};

Reader “transforms” dataMost String readers use AutoBeans

Thursday, November 3, 2011

Page 28: Introducing Ext GWT 3.0

DataLoader Example

loader = new ListLoader<ListLoadConfig, ListLoadResult<Email>>( proxy, reader);loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, Email, ListLoadResult<Email>>(store));loader.load();

Thursday, November 3, 2011

Page 29: Introducing Ext GWT 3.0

DataWriter

Turns logical data into format to be sent back to serverReverse behavior of DataReadersExample use with LoadConfig object sent to server

DataWriter

AutoBeanWriter

JsonWriter UrlEncodingWriter XmlWriter

Thursday, November 3, 2011

Page 30: Introducing Ext GWT 3.0

Templates

Thursday, November 3, 2011

Page 31: Introducing Ext GWT 3.0

XTemplatesProvides compile time templatingRetrieves data from any Java BeanProduces SafeHtml

Thursday, November 3, 2011

Page 32: Introducing Ext GWT 3.0

<p><b>Name:</b> {data.name}</p><p><b>Salary</b>: {data.income:currency}</p><p><b>Kids:</b></p><tpl for="data.kids"><tpl if="age < 100"><p>{#}. {parent.name}'s kid - {name} - {bday:date("M/d/yyyy")}</p></tpl></tpl>

XTemplates Example Pt. 1

Thursday, November 3, 2011

Page 33: Introducing Ext GWT 3.0

public interface DataRenderer extends XTemplates {

@XTemplate(source = "template.html") public SafeHtml renderTemplate(Person data);

}

DataRenderer renderer = GWT.create(DataRenderer.class); HTML text = new HTML(renderer.renderTemplate(person));

XTemplates Example Pt. 2

Thursday, November 3, 2011

Page 34: Introducing Ext GWT 3.0

interface ExampleStyle extends CssResource { String searchItem(); } interface ExampleTemplate extends XTemplates { @XTemplate("<div class='{style.searchItem}'>{post}</div>") SafeHtml render(Forum post, ExampleStyle style); }

XTemplates Example Pt. 3

Thursday, November 3, 2011

Page 35: Introducing Ext GWT 3.0

Widget Changes

Thursday, November 3, 2011

Page 36: Introducing Ext GWT 3.0

FieldsMost fields are now cell basedAllows to be used standalone and in data widgetsFields now work with the GWT Editing framework

Thursday, November 3, 2011

Page 37: Introducing Ext GWT 3.0

State ManagementSate code moved out of Components themselvesSupports asynchronous retrieval of dataHTML Local Storage

Thursday, November 3, 2011

Page 38: Introducing Ext GWT 3.0

Cells & Cell Widgets

Thursday, November 3, 2011

Page 39: Introducing Ext GWT 3.0

Cells

New design and implementation from GWTRenders views of dataSupports events

Work with both GWT and Ext GWT Cells

Thursday, November 3, 2011

Page 40: Introducing Ext GWT 3.0

Cells GWT AbstractInputCell

AbstractEventInputCell

FieldCell

ValueBaseFieldCell

CheckBoxCell TextInputCell TriggerFieldCell

ComboCell DateCell

SliderCell

TwinTriggerFieldCell

NumberCell

SpinnerFieldCell

Thursday, November 3, 2011

Page 41: Introducing Ext GWT 3.0

Cell WidgetsCell support in all data widgetsTree, ListView, Grid,TreeGridReplaces Widget support in data widgets from 2.0High performance, interactive behavior

Thursday, November 3, 2011

Page 42: Introducing Ext GWT 3.0

Thursday, November 3, 2011

Page 43: Introducing Ext GWT 3.0

Cell Example

ColumnConfig column = new ColumnConfig();column.setRenderer(renderer);

cc1 = new ColumnConfig<Plant, String>(properties.name(), 100, "Name"); TextButtonCell button = new TextButtonCell();button.addSelectHandler(new SelectHandler() { @Override public void onSelect(SelectEvent event) { Context c = event.getContext(); int row = c.getIndex(); Plant p = store.get(row); Info.display("Event", "The " + p.getName() + " was clicked."); }});cc1.setCell(button);

Thursday, November 3, 2011

Page 44: Introducing Ext GWT 3.0

UiBinder

Thursday, November 3, 2011

Page 45: Introducing Ext GWT 3.0

GWT UiBinder

Declarative user interfaces via XmlSeparations of duties Java developers and designersSupports both widgets and HTML markupSupports CSS

Thursday, November 3, 2011

Page 46: Introducing Ext GWT 3.0

UiBinder

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' ...>

<container:CenterLayoutContainer> <gxt:ContentPanel bodyStyle="padding: 6px" headingText="CenterLayout" width="200"> <g:Label text="I should be centered" /> </gxt:ContentPanel> </container:CenterLayoutContainer>

</ui:UiBinder>

Thursday, November 3, 2011

Page 47: Introducing Ext GWT 3.0

Layouts

Thursday, November 3, 2011

Page 48: Introducing Ext GWT 3.0

LayoutsNew optimized layout engineUiBinder support including layout dataFully typed containersEasier to use and understand API

Thursday, November 3, 2011

Page 49: Introducing Ext GWT 3.0

Layouts

Container

BorderLayoutContainerBorderLayout

CenterLayout

FlowLayout

CenterLayoutContainer

FlowLayoutContainer

3.02.0

Thursday, November 3, 2011

Page 50: Introducing Ext GWT 3.0

Charts

Thursday, November 3, 2011

Page 51: Introducing Ext GWT 3.0

DrawCross platform drawing APISVG / VML / CanvasNormalizes differences between engine API syntaxDrawComponent base component for drawingDrawComponent works with GXT layouts

Thursday, November 3, 2011

Page 52: Introducing Ext GWT 3.0

ChartsIntegrated with GXT Models & StoresFull event support for series and legendsCustom tooltip for seriesAll charts support animations via GXT FxCustomize appearance of series, axis, legend

Thursday, November 3, 2011

Page 53: Introducing Ext GWT 3.0

Thursday, November 3, 2011

Page 54: Introducing Ext GWT 3.0

Appearance & Theming

Thursday, November 3, 2011

Page 55: Introducing Ext GWT 3.0

2.0 ThemingSingle monolithic gxt-all.cssContains CSS for all browsersManual image spritingHard to determine what CSS is applied to a WidgetNo compile time checks

Thursday, November 3, 2011

Page 56: Introducing Ext GWT 3.0

Appearance PatternRenders the “view” via a SafeHtml stringResponsible for HTML structure and stylesResponds to state changesAppearance pattern applied to both widgets and cells

AppearanceWidget

ClientBundle

CssResource

XTemplate

Thursday, November 3, 2011

Page 57: Introducing Ext GWT 3.0

Release Timeline

Thursday, November 3, 2011

Page 58: Introducing Ext GWT 3.0

Release Timeline3.0 Beta 1 Q4 20113.0 GA early 2012

Thursday, November 3, 2011

Page 59: Introducing Ext GWT 3.0

Road to 3.0Weekly snapshot builds to MavenActively helping with 3.0 issue and bugs in forums

Thursday, November 3, 2011

Page 60: Introducing Ext GWT 3.0

Post 3.0ThemeBuilderMobile support

Thursday, November 3, 2011

Page 61: Introducing Ext GWT 3.0

Questions?

Thursday, November 3, 2011