All pastes #637515 Raw Edit

Stuff

public text v1 · immutable
#637515 ·published 2007-07-28 22:56 UTC
rendered paste body
package com.ogsd.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.TabBar;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.TabListener;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SourcesTabEvents;
import com.google.gwt.user.client.Window;
/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Stethoscope implements EntryPoint {
    public void onModuleLoad() {
	// Create a tab bar with three items.
	TabBar bar = new TabBar();
	TabListener listener = new TabListener() {
		public void onTabSelected(SourcesTabEvents sender, int tabIndex) {
		    // Let the user know what they just did.
		      Window.alert("You clicked tab " + tabIndex);
		}
		
		public boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex) {
		    // Just for fun, let's disallow selection of 'bar'.
		    if (tabIndex == 1)
			return false;
		    return true;
		}
	    };
	bar.addTab("Help");
	bar.addTab("Please");
	bar.addTab("I");
	bar.addTab("Need");
	bar.addTab("Somebody");	
	// Hook up a tab listener to do something when the user selects a tab.
	bar.addTabListener(listener);
	
	// Add it to the root panel.
	RootPanel.get().add(bar);
    }
}