本文整理汇总了Java中com.vaadin.ui.TabSheet.Tab.setClosable方法的典型用法代码示例。如果您正苦于以下问题:Java Tab.setClosable方法的具体用法?Java Tab.setClosable怎么用?Java Tab.setClosable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.TabSheet.Tab
的用法示例。
在下文中一共展示了Tab.setClosable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addResultsTab
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
public void addResultsTab(Component resultComponent, String title, Resource icon, int position) {
Tab tab = resultsTabs.addTab(resultComponent, title, icon, position);
tab.setClosable(true);
resultsTabs.setSelectedTab(tab.getComponent());
if (errorTab != null) {
resultsTabs.removeTab(errorTab);
errorTab = null;
}
if (maxNumberOfResultTabs > 0 && resultsTabs.getComponentCount() > maxNumberOfResultTabs) {
resultsTabs.removeTab(resultsTabs.getTab(resultsTabs.getComponentCount() - 1));
}
if (icon == FontAwesome.STOP) {
errorTab = tab;
}
}
示例2: onClick
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
@Override
public void onClick(UIApplication<?> application) {
if (IUnoVaadinApplication.class.isAssignableFrom(application.getConcreteApplicationClass())) {
final IUnoVaadinApplication vaadinApp = (IUnoVaadinApplication) application.getConcreteApplication();
@SuppressWarnings("unchecked")
final Component windowComponent = vaadinComponentManager.getComponent(this,
(UIApplication<IUnoVaadinApplication>) application);
final Tab tab = vaadinApp.getMainTabSheet().addTab(windowComponent, "Tasks");
tab.setClosable(true);
vaadinApp.getMainTabSheet().addListener(new ComponentDetachListener() {
private static final long serialVersionUID = 703653779132116478L;
@Override
public void componentDetachedFromContainer(ComponentDetachEvent event) {
if (event.getDetachedComponent() == windowComponent) {
vaadinComponentManager.disposeComponent(UsertaskNotification.this);
vaadinApp.getMainTabSheet().removeListener(this);
}
}
});
vaadinApp.getMainTabSheet().setSelectedTab(tab);
} else {
application.showMessage(MessageType.WARNING, "User task graphical user interface not ready for actual user interface");
}
}
示例3: addModule
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
@Override
public void addModule(String id, String name, IViewContainer viewComponent, boolean closeable, Resource icon, LOCATION location) {
if (tabSheetModule.getComponentCount() == 0)
tabSheetModule.hideTabs(false);
// add module to the list
modules.put(id, viewComponent);
// create new tab for the current module
Tab tab = tabSheetModule.addTab((Component) viewComponent, name, icon);
// set closable flag
tab.setClosable(closeable);
tabSheetModule.setSelectedTab((Component) viewComponent);
}
示例4: createResultTab
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
private VerticalLayout createResultTab(String caption) {
final VerticalLayout vl = new VerticalLayout();
vl.setMargin(true);
final Tab t = tabSheet.addTab(vl, caption);
t.setClosable(true);
tabSheet.setSelectedTab(t);
return vl;
}
示例5: openModuleTab
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
private void openModuleTab(ModuleLinkButton moduleLinkButton) {
Tab tab = getModuleTab(moduleLinkButton.getModule());
if (tab == null) {
switch (moduleLinkButton.getModule().getType()) {
case FORM:
tab = tabSheet.addTab(new FormEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case CONNECTOR:
tab = tabSheet.addTab(new ConnectorEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case DATA:
tab = tabSheet.addTab(new DataEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case PROCESS:
tab = tabSheet.addTab(new ProcessEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case CHART:
tab = tabSheet.addTab(new ChartEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
}
}
tabSheet.setSelectedTab(tab);
}
示例6: openTab
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
public void openTab(Component component, Module Module) {
Tab tab = getTestTab(Module);
if (tab != null) {
tabSheet.removeTab(tab);
}
tab = tabSheet.addTab(component, Module.getName());
tab.setClosable(true);
tabSheet.setSelectedTab(tab);
}
示例7: openDocumentTab
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
private void openDocumentTab(String documentId) {
Tab tab = getTab(documentId);
if (tab == null) {
if (HybridbpmUI.getDocumentAPI().getMyDocumentPermissions(documentId).contains(Permission.PERMISSION.VIEW)) {
tab = tabSheet.addTab(new DocumentLayout(documentId));
tab.setClosable(true);
tabSheet.setSelectedTab(tab);
}
} else {
tabSheet.setSelectedTab(tab);
}
}
示例8: openQueryWindow
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
protected QueryPanel openQueryWindow(IDb db) {
String dbName = db.getName();
DefaultButtonBar buttonBar = new DefaultButtonBar();
QueryPanel panel = new QueryPanel(db, settingsProvider, buttonBar, user);
buttonBar.init(db, settingsProvider, panel, additionalMenuItems);
Tab tab = contentTabs.addTab(panel, getTabName(dbName));
tab.setClosable(true);
tab.setIcon(QUERY_ICON);
selectContentTab(panel);
return panel;
}
示例9: menuSelected
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
@Override
public void menuSelected(MenuItem selectedItem) {
if (windowComponent == null)
windowComponent = windowFactory.createWindowComponent(window, application);
final TabSheet tabSheet = application.getConcreteApplication().getMainTabSheet();
tabSheet.addListener(new ComponentContainer.ComponentDetachListener() {
private static final long serialVersionUID = 1L;
@Override
public void componentDetachedFromContainer(ComponentDetachEvent event) {
if (event.getDetachedComponent() == windowComponent) {
windowComponent = null;
tabSheet.removeListener(this);
}
}
});
Tab tab = tabSheet.addTab(windowComponent, window.getName());
tab.setClosable(true);
tab.setDescription(window.getDescription());
tabSheet.setSelectedTab(tab);
}
示例10: addWorkbenchContent
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
/**
* Adds the given component as a tab or window acordingly to current visualizacion settings.
* @param component component to add.
* @param caption Tab or Window caption.
* @param icon Tab or Window icon.
* @param closable true if the user can close the tab or window.
* @param confirmClosing true to show a confirmation dialog before closing the tab or window.
*/
public void addWorkbenchContent(Component component, String caption, Resource icon, boolean closable, boolean confirmClosing) {
component.setSizeFull();
if(windowsMenuItem != null && !windowsMenuItem.isVisible()) {
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
layout.setMargin(false);
layout.addComponent(component);
Window window = new Window(caption);
window.setIcon(icon);
window.setClosable(closable);
window.setContent(layout);
window.setWidth("80%");
window.setHeight("80%");
window.getContent().setSizeFull();
placeWindow(window);
UI.getCurrent().addWindow(window);
} else {
Tab tab = tabsheet.addTab(component, caption, icon);
tab.setClosable(closable);
tabsheet.setSelectedTab(component);
}
if(confirmClosing) {
confirmClosingComponents.add(component);
}
}
示例11: addResultsTab
import com.vaadin.ui.TabSheet.Tab; //导入方法依赖的package包/类
public void addResultsTab(String caption, Resource icon, IContentTab panel) {
Tab tab = contentTabs.addTab(panel, caption);
tab.setClosable(true);
tab.setIcon(icon);
selectContentTab(panel);
}