当前位置: 首页>>代码示例>>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;未经允许,请勿转载。