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


Java CTabItem.getData方法代碼示例

本文整理匯總了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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:15,代碼來源:EclipseTabProvider.java

示例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;
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:14,代碼來源:LemmaNavigator.java

示例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;
		}
	}
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:13,代碼來源:WorkbenchApplicationFolder.java

示例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;
			}
		}
	}
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:16,代碼來源:WorkbenchApplicationFolder.java

示例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);

}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:53,代碼來源:HydrographInstallationDialog.java


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