List of usage examples for com.google.gwt.gen2.table.client AbstractScrollTable setScrollPolicy
public void setScrollPolicy(ScrollPolicy scrollPolicy)
From source file:com.google.gwt.gen2.demo.scrolltable.client.option.setup.ScrollPolicyOption.java
License:Apache License
@Override protected Widget onInitialize() { CustomForm form = new CustomForm(); // Add the policy scrollPolicyBox = new ListBox(); scrollPolicyBox.addItem("both"); scrollPolicyBox.addItem("horizontal"); scrollPolicyBox.addItem("disabled"); form.addLabeledWidget("Scroll Policy:", scrollPolicyBox); refreshPolicy();/* w w w . j ava 2s . c om*/ // Add button to change status { Button button = new Button("Set Scroll Policy", new ClickHandler() { public void onClick(ClickEvent event) { AbstractScrollTable scrollTable = ScrollTableDemo.get().getScrollTable(); switch (scrollPolicyBox.getSelectedIndex()) { case 0: scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.BOTH); break; case 1: scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.HORIZONTAL); break; case 2: scrollTable.setScrollPolicy(ScrollTable.ScrollPolicy.DISABLED); break; } } }); form.addButton(button); } return form; }