List of usage examples for com.google.gwt.user.client.ui Tree Tree
public Tree()
From source file:asquare.gwt.tests.focus.client.Demo.java
License:Apache License
private Widget createFocusPanel() { Table outer = new Table(); outer.add(new FocusPanel(new Label("Label in a FocusPanel"))); outer.add(new Button("Button")); outer.add(new CheckBox("CheckBox")); outer.add(new TextBox()); outer.add(new PasswordTextBox()); outer.add(new TextArea()); outer.add(new RadioButton("group1", "RadioButton1")); outer.add(new RadioButton("group1", "RadioButton2")); ListBox listBox1 = new ListBox(); listBox1.addItem("ListBox1"); listBox1.addItem("item2"); listBox1.addItem("item3"); outer.add(listBox1);/*w ww . j av a 2 s .co m*/ ListBox listBox2 = new ListBox(true); listBox2.setVisibleItemCount(3); listBox2.addItem("ListBox2"); listBox2.addItem("item2"); listBox2.addItem("item3"); outer.add(listBox2); Tree tree = new Tree(); tree.addItem("Tree"); tree.addItem("item2"); tree.addItem("item3"); outer.add(tree); return outer; }
From source file:asquare.gwt.tests.focusevent.client.Demo.java
License:Apache License
private Widget createDemoPanel() { TestPanel outer = new TestPanel(); outer.add(new Label("GWT onfocus Event Handler")); outer.add(new Button("Button"), "Button"); outer.add(new CheckBox("CheckBox"), "CheckBox"); outer.add(new RadioButton("group1", "RadioButton1"), "RadioButton1"); TextBox textBox = new TextBox(); textBox.setText("TextBox"); outer.add(textBox, "TextBox"); PasswordTextBox passwordTextBox = new PasswordTextBox(); passwordTextBox.setText("PasswordTextBox"); outer.add(passwordTextBox, "PasswordTextBox"); TextArea textArea = new TextArea(); textArea.setText("TextArea"); outer.add(textArea, "TextArea"); ListBox listBox = new ListBox(); listBox.addItem("ListBox"); listBox.addItem("item2"); listBox.addItem("item3"); outer.add(listBox, "ListBox"); outer.add(new FocusPanel(new Label("Label in a FocusPanel")), "FocusPanel"); Tree tree = new Tree(); tree.addItem("item1"); tree.addItem("item2"); tree.addItem("item3"); outer.add(tree, "Tree"); return outer; }
From source file:asquare.gwt.tests.selecttreeitem.client.Demo.java
License:Apache License
public void onModuleLoad() { Debug.enableSilently();//from ww w. jav a2 s .c o m TreeItem treeRoot = new TreeItem("Tree"); final TreeItem treeItem = new TreeItem("foo"); treeRoot.addItem(treeItem); treeRoot.addItem("bar"); treeRoot.addItem("baz"); final Tree tree = new Tree(); tree.addItem(treeRoot); // DeferredCommand.addCommand(new Command() // { // public void execute() // { tree.setSelectedItem(treeItem); tree.ensureSelectedItemVisible(); // } // }); // RootPanel.get().add(tree); // this is not reached in Opera RootPanel.get().add(new Label("Entry point was sucessfully executed")); }
From source file:asquare.gwt.tk.demo.client.DebugPanel.java
License:Apache License
private Widget createWidgetPanel() { BasicPanel widgets = new BasicPanel(); DOM.setAttribute(widgets.getElement(), "id", "debug-widgets"); TextArea textArea = new TextArea(); textArea.setText("Enable event tracing then type in here"); widgets.add(textArea);//from w w w .j av a 2 s. c o m ListBox listBox = new ListBox(); listBox.addItem("List Box"); listBox.addItem("foo"); listBox.addItem("bar"); listBox.addItem("baz"); widgets.add(listBox); TreeItem treeRoot = new TreeItem("Tree"); TreeItem treeItem = new TreeItem("foo"); treeRoot.addItem(treeItem); treeRoot.addItem("bar"); treeRoot.addItem("baz"); Tree tree = new Tree(); tree.addItem(treeRoot); tree.setSelectedItem(treeItem); tree.ensureSelectedItemVisible(); widgets.add(tree); Image image = new Image("icecube.jpg"); ScrollPanel scrollPanel = new ScrollPanel(image); scrollPanel.setSize("200px", "200px"); widgets.add(scrollPanel); return widgets; }
From source file:asquare.gwt.tkdemo.client.demos.DebugPanel.java
License:Apache License
private Widget createWidgetPanel() { BasicPanel widgets = new BasicPanel(); TextArea textArea = new TextArea(); textArea.setText("Enable event tracing then type in here"); widgets.add(textArea);//from w w w . j ava 2s . c o m ListBox listBox = new ListBox(); listBox.addItem("List Box"); listBox.addItem("foo"); listBox.addItem("bar"); listBox.addItem("baz"); widgets.add(listBox); TreeItem treeRoot = new TreeItem("Tree"); final TreeItem treeItem = new TreeItem("foo"); treeRoot.addItem(treeItem); treeRoot.addItem("bar"); treeRoot.addItem("baz"); final Tree tree = new Tree(); tree.addItem(treeRoot); /* * This crashes the hosted shell * http://code.google.com/p/google-web-toolkit/issues/detail?id=1785 */ // /* // * Defer selection so that Tree does not break Opera // * http://code.google.com/p/google-web-toolkit/issues/detail?id=1784 // */ // DeferredCommand.addCommand(new Command() // { // public void execute() // { // tree.setSelectedItem(treeItem); // tree.ensureSelectedItemVisible(); // } // }); widgets.add(tree); Image image = new Image("icecube.jpg"); ScrollPanel scrollPanel = new ScrollPanel(image); scrollPanel.setSize("200px", "200px"); widgets.add(scrollPanel); return widgets; }
From source file:asquare.gwt.tkdemo.client.demos.FocusCycleDemo.java
License:Apache License
private Widget createFocusCycle1() { FocusCyclePanel cycle1 = new FocusCyclePanel("div", "block"); cycle1.add(new Label("Cycle 1")); cycle1.add(new FocusStyleDecorator(new Button("Button"))); Button buttonDisabled = new Button("disabled"); buttonDisabled.setEnabled(false);//from w w w. j a v a 2 s. c o m cycle1.add(new FocusStyleDecorator(buttonDisabled)); Button buttonNegativeTabIndex = new Button("tabIndex = -1"); buttonNegativeTabIndex.setTabIndex(-1); cycle1.add(new FocusStyleDecorator(buttonNegativeTabIndex)); cycle1.add(new FocusStyleDecorator(new CheckBox("CheckBox"))); cycle1.add(new FocusStyleDecorator(new FocusPanel(new Label("FocusPanel")))); ListBox listBox = new ListBox(); listBox.addItem("ListBox"); listBox.addItem("Item 1"); listBox.addItem("Item 2"); listBox.addItem("Item 3"); cycle1.add(new FocusStyleDecorator(listBox)); TextBox textBox = new TextBox(); textBox.setText("TextBox"); cycle1.add(new FocusStyleDecorator(textBox)); PasswordTextBox pwBox = new PasswordTextBox(); pwBox.setText("PasswordTextBox"); cycle1.add(new FocusStyleDecorator(pwBox)); TextArea textArea = new TextArea(); textArea.setText("TextArea"); cycle1.add(new FocusStyleDecorator(textArea)); Tree tree = new Tree(); TreeItem treeRoot = new TreeItem("Tree"); for (int branchNum = 1; branchNum < 4; branchNum++) { TreeItem branch = new TreeItem("Branch " + branchNum); for (int item = 1; item < 4; item++) { branch.addItem("Item " + item); } treeRoot.addItem(branch); } tree.addItem(treeRoot); cycle1.add(new FocusStyleDecorator(tree)); new WidgetFocusStyleController(cycle1.getFocusModel()); return cycle1; }
From source file:com.arondor.common.reflection.gwt.client.view.ObjectConfigurationMapView.java
License:Apache License
public ObjectConfigurationMapView() { super(new Tree()); }
From source file:com.audata.client.classification.ClassBrowser.java
License:Open Source License
public ClassBrowser(AuDoc audoc, String width, String height) { this.audoc = audoc; this.setSize(width, height); this.sp = new ScrollPanel(); this.classes = new Tree(); this.classes.setImageBase("images/16x16/"); this.classes.addTreeListener(this); this.classes.addStyleName("audoc-tree"); //this.classes.setSize("1000px", "1000px"); this.selected = null; this.sp.setSize(width, height); this.add(this.sp); }
From source file:com.audata.client.Keyword.KeywordBrowser.java
License:Open Source License
public KeywordBrowser(String width, String height) { this.setSize(width, height); this.sp = new ScrollPanel(); this.keywords = new Tree(); this.keywords.setImageBase("images/16x16/"); this.keywords.addTreeListener(this); this.keywords.addStyleName("audoc-tree"); //this.classes.setSize("1000px", "1000px"); this.selected = null; this.sp.setSize(width, height); this.add(this.sp); }
From source file:com.audata.client.search.SearchPanel.java
License:Open Source License
public SearchPanel(AuDoc audoc, ArrayList criteria) { this.audoc = audoc; if (criteria != null) { this.searchTerms = criteria; } else {//from w w w . jav a 2 s . c om if (AuDoc.state.containsKey("Search")) { this.searchTerms = (ArrayList) AuDoc.state.getItem("Search"); } else { this.searchTerms = new ArrayList(); } } this.setSize("100%", "100%"); this.setSpacing(4); Label title = new Label(LANG.search_Text()); title.addStyleName("audoc-sectionTitle"); this.add(title); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(4); hp.setSize("100%", "100%"); this.fieldsTree = new Tree(); this.fieldsTree.addTreeListener(this); //this.fieldsTree.setSize("100%", "100%"); this.fieldsTree.setHeight("90%"); this.fieldsTree.addStyleName("audoc-fieldTree"); hp.add(this.fieldsTree); this.buildSections(); this.getUDFs(); this.addStdFields(); VerticalPanel form = new VerticalPanel(); form.addStyleName("audoc-searchForm"); //form.setSize("100%","100%"); form.setWidth("250px"); form.setSpacing(4); HorizontalPanel fieldRow = new HorizontalPanel(); fieldRow.setSpacing(4); Label fieldLabel = new Label(LANG.field_Text()); this.fieldName = new Label(); this.fieldName.addStyleName("bold"); fieldRow.add(fieldLabel); fieldRow.add(this.fieldName); fieldRow.setCellWidth(fieldLabel, "100px"); fieldRow.setCellHorizontalAlignment(fieldLabel, HasAlignment.ALIGN_LEFT); form.add(fieldRow); this.valuePanel = new HorizontalPanel(); this.valuePanel.setSpacing(4); Label valueLabel = new Label(LANG.criteria_Text()); TextBox value = new TextBox(); this.valuePanel.add(valueLabel); this.valuePanel.add(value); this.valuePanel.setCellWidth(valueLabel, "100px"); this.valuePanel.setCellHorizontalAlignment(valueLabel, HasAlignment.ALIGN_LEFT); form.add(this.valuePanel); HorizontalPanel andOr = new HorizontalPanel(); andOr.setSpacing(4); this.and = new RadioButton("andOr", LANG.and_Text()); this.and.setChecked(true); this.or = new RadioButton("andOr", LANG.or_Text()); andOr.add(this.and); andOr.add(this.or); form.add(andOr); HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(4); this.add = new Button(LANG.add_Text()); this.add.addClickListener(this); buttons.add(this.add); this.clear = new Button(LANG.clear_Text()); this.clear.addClickListener(this); buttons.add(this.clear); form.add(buttons); this.criteria = new ListBox(); this.criteria.setVisibleItemCount(10); this.criteria.setWidth("100%"); form.add(this.criteria); HorizontalPanel buttons2 = new HorizontalPanel(); buttons2.setSpacing(4); this.search = new Button(LANG.search_Text()); this.search.addClickListener(this); buttons2.add(this.search); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); buttons2.add(this.save); form.add(buttons2); hp.add(form); hp.setCellHeight(this.fieldsTree, "100%"); this.add(hp); this.paintCriteria(); }