当前位置: 首页>>代码示例>>Java>>正文


Java TabBar类代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.TabBar的典型用法代码示例。如果您正苦于以下问题:Java TabBar类的具体用法?Java TabBar怎么用?Java TabBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TabBar类属于com.google.gwt.user.client.ui包,在下文中一共展示了TabBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSelection

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public void onSelection(SelectionEvent<Integer> ise) {
    TabBar tb = (TabBar) ise.getSource();
    int idx = tb.getSelectedTab();
    if (idx == cSelIdx) {
        tb.selectTab(-1, false);
        dropdown.close();
    } else {
        if (!tb.equals(leftToolbar)) {
            leftToolbar.selectTab(-1, false);
        }
        if (!tb.equals(centerToolbar)) {
            centerToolbar.selectTab(-1, false);
        }
        if (!tb.equals(rightToolbar)) {
            rightToolbar.selectTab(-1, false);
        }

        TabHolder th = findTab(idx, tb);
        if (th != null) {
            th.button.activate();
        }
    }
    buttonClicked = false;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:25,代码来源:Toolbar.java

示例2: addButton

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public void addButton(Button button, Align align, int idx, String width) {
    TTabBar tb = align == Align.LEFT ? leftToolbar : align == Align.CENTER ? centerToolbar : rightToolbar;
    idx = idx < 0 || idx > tb.getTabCount() ? tb.getTabCount() : idx;
    tb.insertTab(button.asWidget(), idx);
    TabBar.Tab t = tb.getTab(idx);
    tabs.put(button.getName(), new TabHolder(t, button, tb));
    width = StringUtils.isEmpty(width) ? defaultWidth : width;
    GwtUtil.setStyle(button.asWidget(), "minWidth", width);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:10,代码来源:Toolbar.java

示例3: getSelectedCommand

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public String getSelectedCommand() {
    String retval= null;
    for (Map.Entry<String,TabHolder> entry : tabs.entrySet()) {
        TabHolder th= entry.getValue();
        int idx= th.tabBar.getSelectedTab();
        if (idx>-1) {
            TabBar.Tab testTab= th.tabBar.getTab(idx);
            if (testTab==th.tab)  retval= entry.getKey();
        }
    }
    return retval;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:13,代码来源:Toolbar.java

示例4: indexOf

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
private int indexOf(TabBar bar, TabBar.Tab tab) {
    if (bar != null) {
        for (int i = 0; i < bar.getTabCount(); i++) {
            if (bar.getTab(i).equals(tab)) {
                return i;
            }
        }
    }
    return -1;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:11,代码来源:Toolbar.java

示例5: findTab

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
private TabHolder findTab(int idx, TabBar tb) {
    TabBar.Tab tab = tb.getTab(idx);
    if (tab != null) {
        for (TabHolder th : tabs.values()) {
            if (th.tab.equals(tab)) {
                return th;
            }
        }
    }
    return null;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:12,代码来源:Toolbar.java

示例6: onBeforeSelection

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public void onBeforeSelection(BeforeSelectionEvent<Integer> bse) {
    buttonClicked = true;
    TabBar tb = (TabBar) bse.getSource();
    cSelIdx = tb.getSelectedTab();
    int selIdx = bse.getItem();
    TabHolder th = findTab(selIdx, tb);
    if (!th.button.isUseDropdown()) {
        th.button.activate();
        bse.cancel();
    } else {
        dropdown.clearHeaderBar();
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:14,代码来源:Toolbar.java

示例7: initTabBar

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
private void initTabBar() {
  TabBar tabBar = getTabBar();
  tabBar.addSelectionHandler(
      new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
          if (selectedTab >= 0) {
            tabs.get(selectedTab).registerKeys(false);
          }
          selectedTab = event.getSelectedItem();
          tabs.get(selectedTab).registerKeys(true);
        }
      });

  for (Tab tabInfo : Tab.values()) {
    RelatedChangesTab panel = new RelatedChangesTab(tabInfo);
    add(panel, tabInfo.defaultTitle);
    tabs.add(panel);

    TabBar.Tab tab = tabBar.getTab(tabInfo.ordinal());
    tab.setWordWrap(false);
    ((Composite) tab).setTitle(tabInfo.tooltip);

    setTabEnabled(tabInfo, false);
  }
  getTab(Tab.RELATED_CHANGES).setShowIndirectAncestors(true);
  getTab(Tab.CHERRY_PICKS).setShowBranches(true);
  getTab(Tab.SAME_TOPIC).setShowBranches(true);
  getTab(Tab.SAME_TOPIC).setShowProjects(true);
  getTab(Tab.SAME_TOPIC).setShowSubmittable(true);
  getTab(Tab.SUBMITTED_TOGETHER).setShowBranches(true);
  getTab(Tab.SUBMITTED_TOGETHER).setShowProjects(true);
  getTab(Tab.SUBMITTED_TOGETHER).setShowSubmittable(true);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:35,代码来源:RelatedChanges.java

示例8: handleDisplayName

import com.google.gwt.user.client.ui.TabBar; //导入依赖的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);
    }
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:38,代码来源:SetPropertyHandler.java

示例9: TabBar

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public TabBar( Callback callback )
{
	this.callback = callback;

	Element div = DOM.createDiv();

	setElement( div );

	setStylePrimaryName( "RibbonTab" );

	clear = DOM.createDiv();
	clear.getStyle().setProperty( "clear", "both" );
	div.appendChild( clear );

	addDomHandler( new ClickHandler()
	{
		@Override
		public void onClick( ClickEvent event )
		{
			Element tgt = event.getNativeEvent().getEventTarget().cast();
			if( tgt.getParentElement() != getElement() )
				return;

			int index = DOM.getChildIndex( getElement(), tgt );
			if( index >= getTabCount() )
				return;

			selectTab( index );
		}
	}, ClickEvent.getType() );
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:32,代码来源:Ribbon.java

示例10: setTab

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
@Override
public void setTab(TabBar tabBar, int tabIndex) {
	// TODO Auto-generated method stub

}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:6,代码来源:TabWorkspaceExample.java

示例11: setTab

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
@Override
public void setTab(TabBar tabBar, int tabIndex) {
	this.tabBar = tabBar;
	this.tabIndex = tabIndex;
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:6,代码来源:TabWorkspace.java

示例12: TabWorkspace

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
/**
 * Tab Workspace
 */
public TabWorkspace() {
	widgetExtensionList = new ArrayList<TabWorkspaceExtension>();
	workHandlerExtensionList = new ArrayList<WorkspaceHandlerExtension>();
	tabBar = new TabBar();
	tabBar.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			int index = indexCorrectedChangeViewIndex(event.getSelectedItem().intValue());

			switch (index) {
				case UIDockPanelConstants.DESKTOP:
					Main.get().mainPanel.setView(UIDockPanelConstants.DESKTOP);
					if (Main.get().activeFolderTree != null) { // On start up is null
						Main.get().activeFolderTree.centerActulItemOnScroll(); // Center the actual item every time
					}
					break;

				case UIDockPanelConstants.SEARCH:
					Main.get().mainPanel.setView(UIDockPanelConstants.SEARCH);
					break;

				case UIDockPanelConstants.DASHBOARD:
					Main.get().mainPanel.setView(UIDockPanelConstants.DASHBOARD);
					break;

				case UIDockPanelConstants.ADMINISTRATION:
					Main.get().mainPanel.setView(UIDockPanelConstants.ADMINISTRATION);
					break;

				default:
					Main.get().mainPanel.setView(index);
					break;
			}

			fireEvent(HasWorkspaceEvent.STACK_CHANGED);
			tabVisited[index] = true;
		}
	});

	initWidget(tabBar);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:45,代码来源:TabWorkspace.java

示例13: getTabBar

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public TabBar getTabBar() {
	return this.tabBar;
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:4,代码来源:Header.java

示例14: TabHolder

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
TabHolder(TabBar.Tab tab, Button button, TTabBar tabBar) {
    this.tab = tab;
    this.button = button;
    this.tabBar = tabBar;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:6,代码来源:Toolbar.java

示例15: Ribbon

import com.google.gwt.user.client.ui.TabBar; //导入依赖的package包/类
public Ribbon( RibbonDef conf, final RibbonCallback callback )
{
	this.callback = callback;
	m_conf = conf;

	FlowPanel panel = new FlowPanel();

	m_tabBar = new TabBar( new TabBar.Callback()
	{
		@Override
		public void onSelection( int index )
		{
			m_tabPanel.setWidget( m_tabs.get( index ) );
		}
	} );
	panel.add( m_tabBar );

	m_tabPanel = new SimplePanel();
	panel.add( m_tabPanel );

	/*
	 * Definition of the Ribbon
	 */

	m_tabs = new ArrayList<Widget>();
	for( int i = 0; i < conf.tabs.size(); i++ )
	{
		m_tabBar.addTab( conf.tabs.get( i ).name );

		final ButtonBar bar = new ButtonBar();
		for( int j = 0; j < conf.tabs.get( i ).buttons.size(); j++ )
		{
			final Object obj = conf.tabs.get( i ).buttons.get( j ).obj;

			Button button = new Button( conf.tabs.get( i ).buttons.get( j ).name, new ClickHandler()
			{
				@Override
				public void onClick( ClickEvent event )
				{
					callback.onRibbonChange( obj );
				}
			} );

			bar.addButton( button, obj );
		}
		m_tabs.add( bar );
	}

	initWidget( panel );
	panel.setSize( "100%", "100%" );

	setStyleName( "Ribbon" );
	m_tabPanel.setStyleName( "RibbonPanel" );

	if( m_tabBar.getTabCount() > 0 )
		m_tabBar.selectTab( 0 );
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:58,代码来源:Ribbon.java


注:本文中的com.google.gwt.user.client.ui.TabBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。