本文整理匯總了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();
}
}
示例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();
}
示例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;
}
示例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);
}
示例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);
}