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


Java CTabItem.getControl方法代碼示例

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


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

示例1: closeView

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
public void closeView() {
	try {

		// In theory mdi.closeEntry will dispose of the swtItem (ctabitem or other)
		// via #close(false).  Not sure what happens to composite though,
		// so I don't know fi that TYPE_DESTROY actually gets called
		// The CTabItem scan seems pointless now, though

		Composite c = getComposite();

		if (c != null && !c.isDisposed()) {

			Composite parent = c.getParent();

			triggerEvent(UISWTViewEvent.TYPE_DESTROY, null);

			if (parent instanceof CTabFolder) {

				for (CTabItem item : ((CTabFolder) parent).getItems()) {

					if (item.getControl() == c) {

						item.dispose();
					}
				}
			}
		}
	} catch (Throwable e) {
		Debug.out(e);
	}

}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:34,代碼來源:UISWTViewImpl.java

示例2: findControl

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public TGControl findControl(int index) {
	CTabItem tabItem = this.findTabItem(index);
	if( tabItem != null ) {
		return (TGControl) tabItem.getControl();
	}
	return null;
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:8,代碼來源:TGTabFolder.java

示例3: saveConfFromTabs

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void saveConfFromTabs() throws ConfigurationException {
	for (CTabItem i : getItems()) {
		if (!(i.getControl() instanceof VirtualKeyboard))
			continue;
			
		VirtualKeyboard vk = (VirtualKeyboard) i.getControl();	
		
		setConfProperrty(vk.getVirtualKeyboardName(), vk.getUnicodeHexRange(), false);
	}
	saveConf();
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:12,代碼來源:TrpVirtualKeyboardsTabWidget.java

示例4: insertScript

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public static boolean insertScript(String str) {
    CTabItem ti = getCurrentTab();
    if (ti != null) {
        Control control = (Control) ti.getControl();
        if (control != null) {
            if (control instanceof StyledText) {
                StyledText text = (StyledText) control;
                int offset = text.getCaretOffset();

                String previousText = text.getLine(text.getLineAtOffset(offset));
                String countSpace = getFrontSpace(previousText);

                //offset = next line
                text.insert(str + "\n");
                //System.out.println(text.getLineCount());
                text.setSelection(offset + str.length() + 1);

                //add space
                if (countSpace.length() > 0) {
                    text.insert(countSpace);
                    text.setCaretOffset(text.getCaretOffset() + countSpace.length());

                }
            }
        }
        return true;
    }
    return false;
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:30,代碼來源:AndroidRobot.java

示例5: exitPrompt

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static boolean exitPrompt() {
    for (int i = 0; i < tabContent.getItemCount(); i++) {
        CTabItem item = tabContent.getItem(i);
        String name = item.getText();
        if (name.contains("*")) {
            int iChoice = showNotification("是否保存?", SWT.ICON_QUESTION | SWT.YES | SWT.NO
                                                    | SWT.CANCEL);
            if (iChoice == SWT.YES) {
                StyledText text = (StyledText) item.getControl();
                name = name.substring(1, name.length());
                try {
                    FileUtility.saveAllScripts((String) item.getData(name), item.getText(),
                        text.getText());
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return true;
            } else if (iChoice == SWT.CANCEL) {
                return false;
            }

        }
    }

    //if(htLog.size()>0)
    //	return false;

    if (isRecording) {
        showNotification("請關閉錄製功能!", SWT.ICON_WARNING | SWT.YES);
        return false;
    }
    return true;
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:35,代碼來源:AndroidRobot.java

示例6: removeItem

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
public void removeItem(final int index) {
    final CTabItem item = getUiReference().getItem(index);
    items.remove(item);
    final Control control = item.getControl();
    if (control != null && !control.isDisposed()) {
        control.dispose();
    }
    item.dispose();
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:11,代碼來源:TabFolderImpl.java

示例7: 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

示例8: 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

示例9: selectDefault

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void selectDefault() {
	for (final CTabItem item : tabFolder.getItems()) {
		final WorkbenchApplicationTree tree = (WorkbenchApplicationTree) item.getControl();
		if (tree.selectDefault()) {
			updateTopRightComposite(tree.getFolderComposite());
			tabFolder.setSelection(item);
			break;
		}
	}
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:11,代碼來源:WorkbenchApplicationFolder.java

示例10: 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

示例11: getRefreshable

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public Refreshable getRefreshable(CTabItem item) {
	return (Refreshable)item.getControl();
}
 
開發者ID:chfoo,項目名稱:areca-backup-release-mirror,代碼行數:4,代碼來源:CTabFolderManager.java


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