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


Java CTabFolder.addSelectionListener方法代碼示例

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


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

示例1: DiskInfoTab

import org.eclipse.swt.custom.CTabFolder; //導入方法依賴的package包/類
/**
 * Create the DISK INFO tab.
 */
public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) {
	this.formattedDisks = disks;
	
	CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL);
	ctabitem.setText(textBundle.get("DiskInfoTab.Title")); //$NON-NLS-1$
	
	tabFolder.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent event) {
			getInfoTable().removeAll();
			buildDiskInfoTable(getFormattedDisk(0));	// FIXME!
		}
	});
	
	ScrolledComposite scrolledComposite = new ScrolledComposite(
		tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	scrolledComposite.setExpandHorizontal(true);
	scrolledComposite.setExpandVertical(true);
	ctabitem.setControl(scrolledComposite);
	
	composite = new Composite(scrolledComposite, SWT.NONE);
	createDiskInfoTable();
	if (disks.length > 1) {
		RowLayout layout = new RowLayout(SWT.VERTICAL);
		layout.wrap = false;
		composite.setLayout(layout);
		for (int i=0; i<disks.length; i++) {
			Label label = new Label(composite, SWT.NULL);
			label.setText(disks[i].getDiskName());
			buildDiskInfoTable(disks[i]);
		}
	} else {
		composite.setLayout(new FillLayout());
		buildDiskInfoTable(disks[0]);
	}
	composite.pack();
	scrolledComposite.setContent(composite);
	scrolledComposite.setMinSize(
		composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:43,代碼來源:DiskInfoTab.java

示例2: createDialogArea

import org.eclipse.swt.custom.CTabFolder; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
	Composite composite = (Composite) super.createDialogArea(parent);
	composite.getShell().setMinimumSize(950, 500);
	folder = new CTabFolder(composite, SWT.NONE);
	configureFolder();
	createFolderItems(folder);

	GridData folderData = new GridData(SWT.FILL, SWT.FILL, true, true);
	folderData.widthHint = convertHorizontalDLUsToPixels(TAB_WIDTH_IN_DLUS);
	folderData.heightHint = convertVerticalDLUsToPixels(TAB_HEIGHT_IN_DLUS);
	folder.setLayoutData(folderData);
	folder.addSelectionListener(createFolderSelectionListener());
	folder.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			releaseContributions();
		}
	});
	return composite;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:22,代碼來源:HydrographInstallationDialog.java

示例3: createDialogArea

import org.eclipse.swt.custom.CTabFolder; //導入方法依賴的package包/類
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(final Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	parent.getShell().setText(Messages.DATA_VIEWER + " " + Messages.FILTER);
	container.setLayout(new GridLayout(1, false));
	container.getShell().setMinimumSize(800,355);
	Composite mainComposite = new Composite(container, SWT.NONE);
	mainComposite.setLayout(new GridLayout(1, false));
	GridData gdMainComposite = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gdMainComposite.heightHint = 355;
	gdMainComposite.widthHint = 832;
	mainComposite.setLayoutData(gdMainComposite);
	
	CTabFolder tabFolder = new CTabFolder(mainComposite, SWT.NONE);
	tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	createRemoteTabItem(tabFolder, remoteTableViewer);
	createLocalTabItem(tabFolder, localTableViewer);
	parent.getShell().setDefaultButton(remoteSaveButton);
	 tabFolder.addSelectionListener(new SelectionAdapter() {

           @Override
           public void widgetSelected(SelectionEvent e) {
                 CTabItem tabItem = (CTabItem) e.item;
                 if (StringUtils.equalsIgnoreCase(tabItem.getText(),Messages.ORIGINAL_DATASET)) {
                       parent.getShell().setDefaultButton(remoteSaveButton);
                 } else if(StringUtils.equalsIgnoreCase(tabItem.getText(),Messages.DOWNLOADED_DATASET)){
                       parent.getShell().setDefaultButton(localSaveButton);
                 }
           }
     });

	FilterHelper.INSTANCE.setDataViewerAdapter(dataViewerAdapter,this);
	FilterHelper.INSTANCE.setDebugDataViewer(debugDataViewer);
	return container;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:41,代碼來源:FilterConditionsDialog.java


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