本文整理汇总了Java中org.primefaces.event.TabChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java TabChangeEvent类的具体用法?Java TabChangeEvent怎么用?Java TabChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TabChangeEvent类属于org.primefaces.event包,在下文中一共展示了TabChangeEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTabChange
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
/**
* Method called when the tab is changed.
* @param event The PrimeFaces tabChange event.
*/
public void onTabChange(TabChangeEvent event) {
if (event == null || !(event.getComponent() instanceof TabView)) {
throw new IllegalArgumentException("The event cant be null.");
}
TabView tv = (TabView) event.getComponent();
this.activeTabIndex = tv.getActiveIndex();
}
示例2: testOnTabChangedComponentNull
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
/**
* Tests if an IllegalArgumentException gets thrown if the tab change
* ui callback has no TabView component
*/
@Test(expected = IllegalArgumentException.class)
public void testOnTabChangedComponentNull() {
TabChangeEvent eventMock = mock(TabChangeEvent.class);
when(eventMock.getComponent()).thenReturn(null);
scriptController.onTabChange(eventMock);
}
示例3: testOnTabChanged
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
/**
* Tests if an IllegalArgumentException gets thrown if the tab change
* ui callback has no TabView component
*/
@Test
public void testOnTabChanged() {
int newTabIdx = 1;
TabChangeEvent eventMock = mock(TabChangeEvent.class);
TabView tabViewMock = mock(TabView.class);
when(tabViewMock.getActiveIndex()).thenReturn(newTabIdx);
when(eventMock.getComponent()).thenReturn(tabViewMock);
scriptController.onTabChange(eventMock);
assertTrue(scriptController.getActiveTabIndex() == newTabIdx);
assertSame(scriptController.getActiveParticipationType(),
(course.getParticipationTypes().get(newTabIdx)));
}
示例4: onTabChange
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
public void onTabChange(TabChangeEvent event) {
if (event.getTab().getId().equals("notifications")) {
displayNotification();
}
}
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:6,代码来源:BuiltinUserPage.java
示例5: onChange
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
public void onChange(TabChangeEvent event) {
TabView parent = (TabView) event.getTab().getParent();
this.tabIndex = parent.getActiveIndex();
this.currentTestPlan = projectBean.getWorkload().getTestPlans().get(tabIndex);
}
示例6: onTabChange
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
public void onTabChange(TabChangeEvent event)
{
TabView tabView = (TabView) event.getComponent();
activeTabIndex= tabView.getChildren().indexOf(event.getTab());
}
示例7: onTabChange
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
public void onTabChange(TabChangeEvent event) {
FacesMessage msg = new FacesMessage("Tab Changed", "Active Tab: " + event.getTab().getTitle());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
示例8: onPlayerChange
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
public void onPlayerChange(TabChangeEvent event) {
FacesMessage msg = new FacesMessage("Tab Changed", "Active Player: " + ((Player) event.getData()).getName());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
示例9: tabChanged
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
/**
* Track that the currently selected tab has changed.
* @param event
*/
public void tabChanged(TabChangeEvent event){
TabView tv = (TabView)event.getTab().getParent();
activeTabId = tv.getActiveIndex();
}
示例10: groupChangeEvent
import org.primefaces.event.TabChangeEvent; //导入依赖的package包/类
/**
*
*
* @param event
*/
public void groupChangeEvent(TabChangeEvent event) {
// ..
}