本文整理匯總了Java中org.eclipse.swt.custom.CTabItem.getData方法的典型用法代碼示例。如果您正苦於以下問題:Java CTabItem.getData方法的具體用法?Java CTabItem.getData怎麽用?Java CTabItem.getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.CTabItem
的用法示例。
在下文中一共展示了CTabItem.getData方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findIndex
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private int findIndex ( final int index )
{
final CTabItem[] items = this.folder.getItems ();
for ( int i = 0; i < items.length; i++ )
{
final CTabItem item = items[i];
final int order = (Integer)item.getData ( "order" );
if ( order > index )
{
return i;
}
}
return -1;
}
示例2: getActiveStructuredViewer
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
public StructuredViewer getActiveStructuredViewer() {
CTabItem item = tabFolder.getSelection();
if (item != null)
{
Object o = item.getData("tv");
if (o instanceof StructuredViewer)
{
return (StructuredViewer) o;
}
}
return null;
}
示例3: removeApplication
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void removeApplication(final IWorkbenchApplication app) {
for (final CTabItem item : tabFolder.getItems()) {
if (item.getData() == app) {
// unselect to clear perspective
final WorkbenchApplicationTree tree = (WorkbenchApplicationTree) item.getControl();
tree.clearSelection(true);
tree.dispose();
item.dispose();
break;
}
}
}
示例4: selectTreeNode
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void selectTreeNode(final String[] selectedTreeNode) {
if (selectedTreeNode != null && selectedTreeNode.length > 0) {
final String appId = selectedTreeNode[0];
for (final CTabItem item : tabFolder.getItems()) {
final IWorkbenchApplication app = (IWorkbenchApplication) item.getData();
if (app.getId().equals(appId)) {
final WorkbenchApplicationTree tree = (WorkbenchApplicationTree) item.getControl();
tree.selectTreeNode(Arrays.asList(selectedTreeNode).subList(1, selectedTreeNode.length));
updateTopRightComposite(tree.getFolderComposite());
tabFolder.setSelection(item);
break;
}
}
}
}
示例5: tabSelected
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void tabSelected(CTabItem item) {
if (item.getData() instanceof IConfigurationElement) {
final IConfigurationElement element = (IConfigurationElement) item
.getData();
Composite pageComposite = (Composite) item.getControl();
try {
final InstallationPage page = (InstallationPage) element
.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS);
page.createControl(pageComposite);
// new controls created since the dialog font was applied, so
// apply again.
Dialog.applyDialogFont(pageComposite);
page.setPageContainer(this);
// Must be done before creating the buttons because the control
// button creation methods
// use this map.
pageToId.put(page, element
.getAttribute(IWorkbenchRegistryConstants.ATT_ID));
createButtons(page);
item.setData(page);
item.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
page.dispose();
}
});
pageComposite.layout(true, true);
} catch (CoreException e1) {
Label label = new Label(pageComposite, SWT.NONE);
label.setText(e1.getMessage());
item.setData(null);
}
}
String id = (String) item.getData(ID);
rememberSelectedTab(id);
buttonManager.update(id);
Button button = createButton(buttonManager.getParent(),
IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
GridData gd = (GridData) button.getLayoutData();
gd.horizontalAlignment = SWT.BEGINNING;
gd.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH) / 2;
// Layout the button bar's parent and all of its children. We must
// cascade through all children because the buttons have changed and
// because tray dialog inserts an extra composite in the button bar
// hierarchy.
getButtonBar().getParent().layout(true, true);
}