本文整理汇总了Java中com.google.gwt.user.client.ui.TabPanel类的典型用法代码示例。如果您正苦于以下问题:Java TabPanel类的具体用法?Java TabPanel怎么用?Java TabPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TabPanel类属于com.google.gwt.user.client.ui包,在下文中一共展示了TabPanel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NumberNetUI
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
/**
* Instantiates a new number net ui.
*/
public NumberNetUI()
{
super();
sharedInstance = this;
tabPanel = new TabPanel();
TableManager tableManagerTab = new TableManager();
tabPanel.add(tableManagerTab, tableManagerTab.getTitle(), false);
TargetSetterPanel targetSetterPanel = new TargetSetterPanel();
tabPanel.add(targetSetterPanel, targetSetterPanel.getTitle(), false);
// ProjectionControl projectionControlPanel = new ProjectionControl();
// tabPanel.add(projectionControlPanel,
// projectionControlPanel.getTitle(), false);
ExpressionView ev = new ExpressionView();
tabPanel.add(ev, ev.getTitle(), false);
tabPanel.selectTab(0);
add(tabPanel);
}
示例2: DatabaseControlUI
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
/**
* Instantiates a new database control ui.
*/
public DatabaseControlUI()
{
super();
sharedInstance = this;
tabPanel = new TabPanel();
tabPanel.setWidth("270px");
studentAdminPanel = new StudentAdministationPanel();
tabPanel.add(studentAdminPanel, studentAdminPanel.getTitle(), false);
classSelectionPanel = new ClassSelectionPanel();
tabPanel.add(classSelectionPanel, classSelectionPanel.getTitle(), false);
tabPanel.selectTab(0);
add(tabPanel);
}
示例3: asWidget
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
/**
* @return this editor as a Widget.
*/
public Widget asWidget() {
VerticalPanel panel = new VerticalPanel();
panel.add(new ContentGroupLabel(Singleton.MESSAGES.label_serviceDetails()));
panel.add(new ContentDescription(Singleton.MESSAGES.description_serviceDetails()));
panel.add(createImplementationDetailsPanel());
TabPanel tabs = new TabPanel();
tabs.setStyleName("default-tabpanel"); //$NON-NLS-1$
tabs.getElement().setAttribute("style", "margin-top:15px;"); //$NON-NLS-1$ //$NON-NLS-2$
tabs.add(createGatewayDetailsPanel(), Singleton.MESSAGES.label_gateways());
tabs.add(createThrottlingDetailsPanel(), Singleton.MESSAGES.label_throttling());
tabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
@Override
public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
_toolstrip.doCancel();
}
});
panel.add(tabs);
tabs.selectTab(0);
return panel;
}
示例4: setTabVisibility
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
public static void setTabVisibility(TabPanel tabs, int index, boolean visible, UIObject tabUI) {
try {
if (index >= tabs.getTabBar().getTabCount() || index < 0)
return;
// Native Google implementation of TabBar uses an HorizontalPanel,
// so, the DOM primary element is a table element (with just one tr)
Element table = tabs.getTabBar().getElement();
Element tr = DOM.getFirstChild(DOM.getFirstChild(table));
// (index + 1) to account for 'first' placeholder td.
Element td = DOM.getChild(tr, index + 1);
UIObject.setVisible(td, visible);
tabUI.setVisible(visible);
} catch (Exception e) {
LOG.log(Level.WARNING,
"Not sure what can go wrong, but setting tab visibility might have failed", e);
}
}
示例5: makeParentVisible
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
private void makeParentVisible(Widget widget) {
if (widget == null) {
return;
}
Widget parent = widget.getParent();
if (parent == null) {
return;
}
makeParentVisible(parent);
if (parent instanceof DeckPanel) {
DeckPanel deckPanel = (DeckPanel) parent;
int widgetIndex = deckPanel.getWidgetIndex(widget);
deckPanel.showWidget(widgetIndex);
TabPanel tabPanel = (TabPanel) deckPanel.getParent().getParent();
tabPanel.selectTab(widgetIndex);
}
}
示例6: PanelChat
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
public PanelChat() {
setWidth("800px");
add(new Label("簡易チャット(設定画面から表示をON/OFFできます)"));
if (SharedData.get().isAdministoratorMode()) {
final TabPanel panel = new TabPanel();
panel.setAnimationEnabled(true);
panel.add(new LazyPanel() {
@Override
protected Widget createWidget() {
return new PanelRealtime();
}
}, "リアルタイム");
panel.add(new LazyPanel() {
@Override
protected Widget createWidget() {
return new PanelPast();
}
}, "過去ログ");
panel.selectTab(0);
add(panel);
} else {
add(new PanelRealtime());
}
}
示例7: initComponents
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize ui components
*/
private void initComponents() {
// Initialize UI
panel = new VerticalPanel();
panel.setWidth("100%");
galleryGUI = new FlowPanel();
appSingle = new FlowPanel();
appDetails = new FlowPanel();
appHeader = new FlowPanel();
appInfo = new FlowPanel();
appAction = new FlowPanel();
appAuthor = new FlowPanel();
appMeta = new FlowPanel();
appDates = new FlowPanel();
appPrimaryWrapper = new FlowPanel();
appSecondaryWrapper = new FlowPanel();
appDescPanel = new FlowPanel();
appReportPanel = new FlowPanel();
appSharePanel = new FlowPanel();
appActionTabs = new TabPanel();
sidebarTabs = new TabPanel();
appComments = new FlowPanel();
appCommentsList = new FlowPanel();
appsByAuthor = new FlowPanel();
appsByTags = new FlowPanel();
appsRemixes = new FlowPanel();
returnToGallery = new FlowPanel();
// tagSelected = "";
appCreated = new Label();
appChanged = new Label();
descBox = new FlowPanel();
titleBox = new FlowPanel();
desc = new TextArea();
titleText = new TextArea();
moreInfoText = new TextArea();
creditText = new TextArea();
ccLicenseRef = new HTML(MESSAGES.galleryCcLicenseRef());
ccLicenseRef.addStyleName("app-action-html");
}
示例8: createTabPanelListener
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
public static SelectionHandler<Integer> createTabPanelListener(final TabPanel tabPanel, final EventListenerGVO ev, final List<InputVariableGVO> input) {
return new SelectionHandler<Integer>() {
public void onSelection(SelectionEvent<Integer> event) {
CallbackHandler.createCallBack(event.getSelectedItem(), QAMLConstants.EVENT_ONCLICK, ev, input);
}
};
}
示例9: handleDisplayName
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
private void handleDisplayName(UIObject uiObject, BuiltInComponentGVO builtInComponentGVO,
String value) {
if (uiObject instanceof HasDataGridMethods) {
HasDataGridMethods hasDataGridMethods = (HasDataGridMethods)uiObject;
String uuid = builtInComponentGVO.getComponentIdUUID();
if (uuid != null) {
boolean containsColumn = uuid.contains(".");
if (containsColumn) {
String columnId = uuid.replaceFirst(".+\\.", "").replaceFirst("\\|.+", "");
hasDataGridMethods.setColumnLabel(columnId, value);
}
}
} else if (uiObject instanceof PushButton) {
((PushButton)uiObject).getUpFace().setText(value);
((PushButton)uiObject).getDownFace().setText(value);
} else if (uiObject instanceof HasText) {
HasText t = (HasText)uiObject;
t.setText(value);
} else if (uiObject instanceof VerticalPanel) {
VerticalPanel vp = (VerticalPanel)uiObject;
Widget tabPanelWidget = vp.getParent().getParent().getParent();
if (tabPanelWidget instanceof TabPanel) {
TabPanel tp = (TabPanel)tabPanelWidget;
TabBar tb = tp.getTabBar();
int tabCount =tp.getWidgetCount();
for (int i=0;i < tabCount;i++){
Widget w = tp.getWidget(i);
if (w == vp){
tb.setTabText(i, value);
}
}
}
} else if (uiObject instanceof QWindowPanel) {
QWindowPanel p = (QWindowPanel) uiObject;
p.setCaption(value);
}
}
示例10: handleVisible
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
private void handleVisible(UIObject uiObject, BuiltInComponentGVO builtInComponentGVO,
String setPropertyValue) {
boolean value = Boolean.valueOf(setPropertyValue).booleanValue();
if(uiObject instanceof HasVisible) {
((HasVisible)uiObject).processVisible(value);
} else if (uiObject instanceof HasDataGridMethods) {
HasDataGridMethods hasDataGridMethods = (HasDataGridMethods)uiObject;
boolean resolved = false;
String uuid = builtInComponentGVO.getComponentIdUUID();
if (uuid != null) {
boolean containsColumn = uuid.contains(".");
if (containsColumn) {
String columnId = uuid.replaceFirst(".+\\.", "").replaceFirst("\\|.+", "");
hasDataGridMethods.setColumnVisible(columnId, value);
resolved = true;
}
}
if (!resolved) {
uiObject.setVisible(value);
hasDataGridMethods.redraw();
}
} else {
uiObject.setVisible(value);
if (uiObject instanceof Panel) {
Panel p = (Panel) uiObject;
Widget parent = p.getParent();
if (parent != null && parent instanceof DeckPanel) {
DeckPanel deckPanel = (DeckPanel) parent;
int widgetIndex = deckPanel.getWidgetIndex(p);
if (widgetIndex != -1) {
if (deckPanel.getParent() != null && deckPanel.getParent().getParent() != null && deckPanel.getParent().getParent() instanceof TabPanel) {
TabPanel tabs = ((TabPanel) (deckPanel.getParent().getParent()));
TabPanelRenderer.setTabVisibility(tabs, widgetIndex, value, uiObject);
}
}
}
}
}
}
示例11: makeParentsVisible
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
private void makeParentsVisible(Widget w) {
if (w.getParent() != null) {
Widget parent = w.getParent();
makeParentsVisible(parent);
if (parent instanceof DeckPanel) {
DeckPanel dp = (DeckPanel) parent;
dp.showWidget(dp.getWidgetIndex(w));
((TabPanel) dp.getParent().getParent()).selectTab(dp.getWidgetIndex(w));
}
}
}
示例12: TabPanelExample
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
public TabPanelExample() {
super("Tab Panel");
TabPanel tabs = new TabPanel();
tabs.add(new Button("One"), "One");
tabs.add(new Button("Two"), "Two");
tabs.add(new Button("Three"), "Three");
tabs.add(new Button("Four"), "Four");
tabs.selectTab(0);
add(tabs);
}
示例13: getTabPanel
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
@Override
public TabPanel getTabPanel(){
return tabPanel;
}
示例14: GalleryList
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
/**
* Creates a new GalleryList
*/
public GalleryList() {
gallery = GalleryClient.getInstance();
gallery.addListener(this);
galleryGF = new GalleryGuiFactory();
selectedApps = new ArrayList<GalleryApp>();
// Initialize UI
galleryGUI = new FlowPanel();
galleryGUI.addStyleName("gallery");
appTabs = new TabPanel();
appRecent = new FlowPanel();
appFeatured = new FlowPanel();
appPopular = new FlowPanel();
appSearch = new FlowPanel();
appTutorial = new FlowPanel();
appRecentContent = new FlowPanel();
appFeaturedContent = new FlowPanel();
appPopularContent = new FlowPanel();
appSearchContent = new FlowPanel();
appTutorialContent = new FlowPanel();
searchText = new TextBox();
// HTML segment for gallery typeface
HTML headerExtra = new HTML(
"<link href='http://fonts.googleapis.com/css?" +
"family=Roboto:400,300,100' rel='stylesheet' type='text/css'>");
galleryGUI.add(headerExtra);
// Add content to panels
appFeaturedTab = new GalleryAppTab(appFeatured, appFeaturedContent, REQUEST_FEATURED);
appRecentTab = new GalleryAppTab(appRecent, appRecentContent, REQUEST_RECENT);
appSearchTab = new GalleryAppTab(appSearch, appSearchContent, REQUEST_SEARCH);
appPopularTab = new GalleryAppTab(appPopular, appPopularContent, REQUEST_MOSTLIKED);
appTutorialTab = new GalleryAppTab(appTutorial, appTutorialContent, REQUEST_TUTORIAL);
// don't think we need because in regular addgallerytab below
// Add panels to main tabPanel
appTabs.add(appRecent, "Recent");
appTabs.add(appTutorial,"Tutorials");
appTabs.add(appFeatured, "Featured");
appTabs.add(appPopular, "Popular");
appTabs.add(appSearch, "Search");
appTabs.selectTab(0);
appTabs.addStyleName("gallery-app-tabs");
galleryGUI.add(appTabs);
// Initialize top-level GUI
VerticalPanel panel = new VerticalPanel();
panel.setWidth("100%");
panel.add(galleryGUI);
initWidget(panel);
}
示例15: onModuleLoad
import com.google.gwt.user.client.ui.TabPanel; //导入依赖的package包/类
@Override
public void onModuleLoad()
{
Map<String, String> availableAppNamesToClassName = new HashMap<String, String>();
availableAppNamesToClassName.put("Number Net", "synergynet3.apps.numbernet.NumberNet");
availableAppNamesToClassName.put("Gravity Sim", "synergynet3.activitypack1.table.gravitysim.GravitySim");
availableAppNamesToClassName.put("Early Years", "synergynet3.apps.earlyyears.applications.stickerbook.StickerbookApp");
SynergyNetAppSystemUI appSystemUI = new SynergyNetAppSystemUI();
appSystemUI.setDelegate(this);
appSystemUI.setKnownApplicationNamesWithClasses(availableAppNamesToClassName);
ProjectorControlPanel projectorControlUI = new ProjectorControlPanel();
DatabaseControlUI databaseControlUI = new DatabaseControlUI();
databaseControlUI.setDelegate(this);
MediaControlUI mediaControlUI = new MediaControlUI();
final RootPanel rootPanel = RootPanel.get();
tabPanel = new TabPanel();
tabPanel.add(appSystemUI, "Apps");
tabPanel.add(projectorControlUI, "Projectors");
tabPanel.add(mediaControlUI, "Tables");
tabPanel.add(databaseControlUI, "Students");
rootPanel.add(tabPanel);
tabPanel.selectTab(0);
SynergyNetWebService.Util.getInstance().test("", new AsyncCallback<Void>()
{
@Override
public void onFailure(Throwable caught)
{
// System.out.println("unwoot");
}
@Override
public void onSuccess(Void result)
{
// System.out.println("woot");
}
});
}