當前位置: 首頁>>代碼示例>>Java>>正文


Java CTabItem.setShowClose方法代碼示例

本文整理匯總了Java中org.eclipse.swt.custom.CTabItem.setShowClose方法的典型用法代碼示例。如果您正苦於以下問題:Java CTabItem.setShowClose方法的具體用法?Java CTabItem.setShowClose怎麽用?Java CTabItem.setShowClose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.custom.CTabItem的用法示例。


在下文中一共展示了CTabItem.setShowClose方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setSwtItem

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void setSwtItem(CTabItem swtItem) {
	this.swtItem = swtItem;
	if (swtItem == null) {
		setDisposed(true);
		return;
	}
	setDisposed(false);

	swtItem.addDisposeListener(this);
	String title = getTitle();
	if (title != null) {
		swtItem.setText(escapeAccelerators(title));
	}

	updateLeftImage();

	swtItem.setShowClose(isCloseable());

	if (buildonSWTItemSet) {
		build();
	}
	if (showonSWTItemSet) {
		show();
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:26,代碼來源:TabbedEntry.java

示例2: buildContents

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void buildContents() {
	tabFolder = new CTabFolder(shell, SWT.TOP | SWT.NO_TRIM);
	tabFolder.setBorderVisible(true);
	tabFolder.setBackgroundMode(SWT.INHERIT_DEFAULT);
	tabFolder.setMRUVisible(true);
	tabFolder.setSimple(false); // rounded tabs
	tabFolder.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
	final Map<String, Map<String, List<Pref>>> prefs = GamaPreferences.organizePrefs();
	for (final String tabName : prefs.keySet()) {
		final CTabItem item = new CTabItem(tabFolder, SWT.NONE);
		item.setFont(GamaFonts.getNavigHeaderFont());
		item.setText(tabName);
		item.setImage(prefs_images.get(tabName));
		item.setShowClose(false);
		buildContentsFor(item, prefs.get(tabName));
	}
	buildButtons();
	shell.layout();
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:20,代碼來源:GamaPreferencesView.java

示例3: findTabItem

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public CTabItem findTabItem(int index) {
	if(!this.isDisposed()) {
		if( index >= 0 ) {
			while( this.tabItems.size() <= index ) {
				CTabItem cTabItem = new CTabItem(this.tabFolder, SWT.NONE);
				cTabItem.setControl(new TGControl(this.context, this.tabFolder));
				cTabItem.setShowClose(true);
				
				this.tabItems.add(cTabItem);
			}
			return this.tabItems.get(index);
		}
	}
	return null;
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:16,代碼來源:TGTabFolder.java

示例4: createNewSearchTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void createNewSearchTab(BTSQueryRequest query, String queryName) {
	// create main tab item
	CTabItem searchTab = new CTabItem(tabFolder, SWT.NONE);
	searchTab.setShowClose(true);
	searchTab.setImage(resourceProvider.getImage(Display.getCurrent(), BTSResourceProvider.IMG_SEARCH));
	if (queryName != null && queryName.trim().length() > 0)
	{
		searchTab.setText(queryName);
	}
	else
	{
		searchTab.setText(new Integer(tabFolder.getChildren().length - 2).toString());
	}
	searchTab.setData("key", query.getQueryId());

	Composite searchTabItemComp = new Composite(tabFolder, SWT.NONE);
	searchTabItemComp.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTabItemComp.setLayout(new GridLayout());
	((GridLayout) searchTabItemComp.getLayout()).marginHeight = 0;
	((GridLayout) searchTabItemComp.getLayout()).marginWidth = 0;

	searchTab.setControl(searchTabItemComp);

	TreeViewer searchTreeViewer = new TreeViewer(searchTabItemComp);
	searchTreeViewer.getTree()
			.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTreeViewer.getTree().setLayout(new GridLayout());
	searchTab.setData("tv", searchTreeViewer);
	searchTabItemComp.layout();
	tabFolder.setSelection(searchTab);
	
	TreeNodeWrapper searchRootNode = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
	prepareTreeViewer(searchTreeViewer, searchTabItemComp);
	
	// search
	searchInput(searchTabItemComp, searchTreeViewer, searchRootNode, query, searchTab);

}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:39,代碼來源:ThsNavigator.java

示例5: createNewSearchTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void createNewSearchTab(BTSQueryRequest query, String queryName, List<BTSCorpusObject> objects) {
	// create main tab item
	CTabItem searchTab = new CTabItem(tabFolder, SWT.NONE);
	searchTab.setShowClose(true);
	searchTab.setImage(resourceProvider.getImage(Display.getCurrent(), BTSResourceProvider.IMG_SEARCH));
	if (queryName != null && queryName.trim().length() > 0)
	{
		searchTab.setText(queryName);
	}
	else
	{
		searchTab.setText(new Integer(tabFolder.getChildren().length - 2).toString());
	}
	if (query != null)
	{
		searchTab.setData("key", query.getQueryId());
	}

	Composite searchTabItemComp = new Composite(tabFolder, SWT.NONE);
	searchTabItemComp.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTabItemComp.setLayout(new GridLayout());
	((GridLayout) searchTabItemComp.getLayout()).marginHeight = 0;
	((GridLayout) searchTabItemComp.getLayout()).marginWidth = 0;

	searchTab.setControl(searchTabItemComp);

	TreeViewer searchTreeViewer = new TreeViewer(searchTabItemComp);
	searchTreeViewer.getTree()
			.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTreeViewer.getTree().setLayout(new GridLayout());
	searchTab.setData("tv", searchTreeViewer);
	searchTabItemComp.layout();
	tabFolder.setSelection(searchTab);
	
	TreeNodeWrapper searchRootNode = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
	prepareTreeViewer(searchTreeViewer, searchTabItemComp);
	
	// search
	searchInput(searchTabItemComp, searchTreeViewer, searchRootNode, query, objects, searchTab);

}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:42,代碼來源:LemmaNavigator.java


注:本文中的org.eclipse.swt.custom.CTabItem.setShowClose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。