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


Java Tab.setClosable方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:21,代码来源:QueryPanel.java

示例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");
	}
}
 
开发者ID:frincon,项目名称:openeos,代码行数:27,代码来源:UsertaskNotification.java

示例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);
			
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:18,代码来源:WorkbenchPanel.java

示例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;
}
 
开发者ID:KeDevServices,项目名称:vaadin-with-rxjava,代码行数:11,代码来源:ProjectUI.java

示例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);
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:30,代码来源:DevelopmentView.java

示例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);
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:DevelopmentView.java

示例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);
    }

}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:14,代码来源:DocumentView.java

示例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;
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:12,代码来源:SqlExplorer.java

示例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);
}
 
开发者ID:frincon,项目名称:openeos,代码行数:23,代码来源:OpenWindowCommand.java

示例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);
	}
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:39,代码来源:MDIWindow.java

示例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);
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:7,代码来源:SqlExplorer.java


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