10.07.2015 Views

Tutorial section in PDF - Custom Training Courses - Coreservlets.com

Tutorial section in PDF - Custom Training Courses - Coreservlets.com

Tutorial section in PDF - Custom Training Courses - Coreservlets.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example: InStyle1.ui.xml (cont)User ControlResultShow Random NumberNum will go hereN/AHurts your eyes,doesn't it?CSS classes can be applied to regular HTMLelements just like a regular CSS class.Multiple classes are separated by space.Adds another class to the exist<strong>in</strong>g CSSclasses assigned to this widget. Note theplural addStyleNames.41Example: InStyle1.java...public class InStyle1 extends Composite {private static InStyle1UiB<strong>in</strong>der uiB<strong>in</strong>der =GWT.create(InStyle1UiB<strong>in</strong>der.class);<strong>in</strong>terface InStyle1UiB<strong>in</strong>derextends UiB<strong>in</strong>der {}@UiField Button numberButton;@UiField HTML numberResult;public InStyle1() {<strong>in</strong>itWidget(uiB<strong>in</strong>der.createAndB<strong>in</strong>dUi(this));}42}@UiHandler("numberButton")void displayRandomNumber(ClickEvent event) {numberResult.setText("Number: " + Math.random() * 10);}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!