Adding icon to tab bar (Ext GWT) : Tab « 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 » TabScreenshots 
Adding icon to tab bar (Ext GWT)
Adding icon to tab bar (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.Scroll;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;

public class Hello implements EntryPoint {
  public void onModuleLoad() {
    RootPanel.get().add(new BasicTabExample());
  }
}
class BasicTabExample extends LayoutContainer {

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

    String txt = "SHORT";

    TabPanel folder = new TabPanel();
    folder.setWidth(450);
    folder.setAutoHeight(true);

    TabItem shortText = new TabItem("Short Text");
    shortText.addStyleName("pad-text");
    shortText.addText(txt);
    folder.add(shortText);

    TabItem longText = new TabItem("Long Text");
    longText.addStyleName("pad-text");
    longText.addText(txt + "<br>" + txt);
    folder.add(longText);

    TabPanel panel = new TabPanel();
    panel.setPlain(true);
    panel.setSize(450250);

    TabItem normal = new TabItem("Normal");
    normal.addStyleName("pad-text");
    normal.addText("Just a plain old tab");
    panel.add(normal);

    TabItem iconTab = new TabItem("Icon Tab");
    //iconTab.setIcon(Resources.ICONS.table());
    iconTab.addStyleName("pad-text");
    iconTab.addText("Just a plain old tab with an icon");
    panel.add(iconTab);

    TabItem ajax1 = new TabItem("Ajax Tab");
    ajax1.setScrollMode(Scroll.AUTO);
    ajax1.addStyleName("pad-text");
    ajax1.setAutoLoad(new RequestBuilder(RequestBuilder.GET, GWT.getHostPageBaseURL() "data/ajax1.html"));
    panel.add(ajax1);

    TabItem eventTab = new TabItem("Event Tab");
    eventTab.addListener(Events.Select, new Listener<ComponentEvent>() {
      public void handleEvent(ComponentEvent be) {
        Window.alert("Event Tab Was Selected");
      }
    });
    eventTab.addStyleName("pad-text");
    eventTab.addText("I am tab 4's content. I also have an event listener attached.");
    panel.add(eventTab);

    TabItem disabled = new TabItem("Disabled");
    disabled.setEnabled(false);
    panel.add(disabled);

    vp.add(folder);
    vp.add(panel);
    add(vp);
  }

}

   
  
Ext-GWT.zip( 4,297 k)
Related examples in the same category
1.Tab orientation (Smart GWT)Tab orientation (Smart GWT)
2.Set tab alignment (Smart GWT)Set tab alignment (Smart GWT)
3.Add a tab, remove a tab (Smart GWT)Add a tab, remove a tab (Smart GWT)
4.Closable tab (Smart GWT)Closable tab (Smart GWT)
5.Tabs Custom Control Sample (Smart GWT)Tabs Custom Control Sample (Smart GWT)
6.Change Tab title dynamically (Smart GWT)Change Tab title dynamically (Smart GWT)
7.Add controls to Tab page (Smart GWT)Add controls to Tab page (Smart GWT)
8.Set URL view for Tab (Smart GWT)Set URL view for Tab (Smart GWT)
9.Scrollable tab header line (Smart GWT)Scrollable tab header line (Smart GWT)
10.Basic Focus Tabbing Sample (Smart GWT)Basic Focus Tabbing Sample (Smart GWT)
11.Using tab to hold form (Smart GWT)Using tab to hold form (Smart GWT)
12.Click on the resizebar next to the Navigation tree to hide it (Smart GWT)Click on the resizebar next to the Navigation tree to hide it (Smart GWT)
13.Adding text to tab panel (Ext GWT)Adding text to tab panel (Ext GWT)
14.Adding Autoload ajax content to tab panel (Ext GWT)Adding Autoload ajax content to tab panel (Ext GWT)
15.Listen to tab selection event (Ext GWT)Listen to tab selection event (Ext GWT)
16.Diable a tab item (Ext GWT)Diable a tab item (Ext GWT)
17.Using VerticalPanel to hold tab panel (Ext GWT)Using VerticalPanel to hold tab panel (Ext GWT)
18.Adding HTML content to a tab panel (Ext GWT)Adding HTML content to a tab panel (Ext GWT)
19.Adding new tab dynamically (Ext GWT)Adding new tab dynamically (Ext GWT)
20.Closable tab (Ext GWT)Closable tab (Ext GWT)
21.Enable tab context menu (Ext GWT)Enable tab context menu (Ext GWT)
22.Make tab scrollable (Ext GWT)Make tab scrollable (Ext GWT)
23.Set selected tab (Ext GWT)Set selected tab (Ext GWT)
24.Tabbed Form (Ext GWT)Tabbed Form (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.