ToolBar with Dropdown menu (Ext GWT) : ToolBar « GWT « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JDK 6
25.JNDI LDAP
26.JPA
27.JSP
28.JSTL
29.Language Basics
30.Network Protocol
31.PDF RTF
32.Reflection
33.Regular Expressions
34.Scripting
35.Security
36.Servlets
37.Spring
38.Swing Components
39.Swing JFC
40.SWT JFace Eclipse
41.Threads
42.Tiny Application
43.Velocity
44.Web Services SOA
45.XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Java » GWT » ToolBarScreenshots 
ToolBar with Dropdown menu (Ext GWT)
ToolBar with Dropdown menu (Ext GWT)
 

/*
 * Ext GWT - Ext for GWT
 * Copyright(c) 2007-2009, Ext JS, LLC.
 * licensing@extjs.com
 
 * http://extjs.com/license
 */
 
package com.google.gwt.sample.hello.client;

import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.Style.IconAlign;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.IconHelper;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonGroup;
import com.extjs.gxt.ui.client.widget.button.ToggleButton;
import com.extjs.gxt.ui.client.widget.layout.TableData;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.RootPanel;

public class Hello implements EntryPoint {

  public void onModuleLoad() {

    RootPanel.get().add(new AdvancedToolBarExample());

  }
}
class AdvancedToolBarExample extends LayoutContainer {

  class SamplePanel extends ContentPanel {

    public SamplePanel() {
      setSize(500250);
      setBodyStyle("padding: 6px");
      setScrollMode(Scroll.AUTOY);
      addText("DUMMY_TEXT_LONG");
    }
  }

  @Override
  protected void onRender(Element parent, int pos) {
    super.onRender(parent, pos);
    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(10);

    vp.add(createStandard());

    add(vp);

  };

  private ContentPanel createStandard() {
    ContentPanel panel = new SamplePanel();
    panel.setHeading("Standard");

    ToolBar toolBar = new ToolBar();

    Button btn = new Button("Cool", IconHelper.createStyle("add16"));
    toolBar.add(btn);
    Menu menu = new Menu();
    menu.add(new MenuItem("Ribbons are cool"));
    btn.setMenu(menu);
    toolBar.add(new SeparatorToolItem());

    btn = new Button("Cut", IconHelper.createStyle("add16"));
    menu = new Menu();
    menu.add(new MenuItem("Copy me"));
    toolBar.add(btn);

    btn = new Button("Copy", IconHelper.createStyle("add16"));
    toolBar.add(btn);

    btn = new Button("Paste", IconHelper.createStyle("add16"));
    toolBar.add(btn);
    menu = new Menu();
    menu.add(new MenuItem("Ribbons are cool"));
    btn.setMenu(menu);
    toolBar.add(new SeparatorToolItem());

    ToggleButton toggleBtn = new ToggleButton("Format");
    toggleBtn.toggle(true);
    toolBar.add(toggleBtn);

    panel.setTopComponent(toolBar);

    return panel;
  }


}

   
  
Ext-GWT.zip( 4,297 k)
Related examples in the same category
1.Tool Strips Sample (Smart GWT)Tool Strips Sample (Smart GWT)
2.Adding ComboBox to ToolBar (Ext GWT)Adding ComboBox to ToolBar (Ext GWT)
3.ToolBar overflow (Ext GWT)
4.Ribbon like ToolBar (Ext GWT)Ribbon like ToolBar (Ext GWT)
5.Multi-column no-title ToolBar (Ext GWT)Multi-column no-title ToolBar (Ext GWT)
6.ToolBar with grouped buttons (Ext GWT)ToolBar with grouped buttons (Ext GWT)
7.Office 2007 style toolbar (Ext GWT)Office 2007 style toolbar (Ext GWT)
8.Adding menu bar to ContentPanel (Ext GWT)Adding menu bar to ContentPanel (Ext GWT)
9.Adding Status to ToolBar (Ext GWT)Adding Status to ToolBar (Ext GWT)
10.Add ToolBar to the bottom of a FormPanel (Ext GWT)Add ToolBar to the bottom of a FormPanel (Ext GWT)
11.Adding ToolBar to ContentPanel (Ext GWT)Adding ToolBar to ContentPanel (Ext GWT)
12.Using ButtonBar to hold buttons (Ext GWT)Using ButtonBar to hold buttons (Ext GWT)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.