本文整理汇总了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));
}
示例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;
}
示例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;
}