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


Java CTabItem.setImage方法代碼示例

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


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

示例1: addCustomWidgetsToGroupWidget

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void addCustomWidgetsToGroupWidget(
		LinkedHashMap<String, ArrayList<Property>> subgroupTree,
		String subgroupName, AbstractELTContainerWidget subGroupContainer) {
	boolean isError=false;
	for(final Property property: subgroupTree.get(subgroupName)){
		AbstractWidget eltWidget = addCustomWidgetInGroupWidget(
				subGroupContainer, property);	
		eltWidgetList.add(eltWidget);
		
		if(!eltWidget.isWidgetValid())
		{	
			isError=true;
		}
	}
	
	if (isError) {
		for (CTabItem item : tabFolder.getItems()) {
			if (StringUtils.equalsIgnoreCase(StringUtils.trim(item.getText()), subgroupTree
					.get(subgroupName).get(0).getPropertyGroup())) {
				item.setImage(ImagePathConstant.COMPONENT_ERROR_ICON.getImageFromRegistry());
			}
		}
	}
	
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:26,代碼來源:PropertyDialogBuilder.java

示例2: loadCompareViewers

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
protected void loadCompareViewers() {
	List<CompareViewerFactory> compareViewerFactories = loadViewerFactories();
	compareViewers = new Vector<CompareViewer>(compareViewerFactories.size());
	for (CompareViewerFactory cvf : compareViewerFactories)
	{
		CTabItem tabItem = new CTabItem(tabFolder, SWT.None);
		tabItem.setText(cvf.getCompareViewerName());
		tabItem.setImage(cvf.getCompareViewerIcon());
		Composite c = new Composite(tabFolder, SWT.NONE);
		tabItem.setControl(c);
		CompareViewer viewer = cvf.createViewer(c, SWT.NONE);
		if (viewer != null)
		{
			compareViewers.add(viewer);
		}
	}
	
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:19,代碼來源:AbstractComparePart.java

示例3: createTableTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private CTabItem createTableTab()
{
  CTabItem tab = new CTabItem(tabs, SWT.NONE);
  tab.setText("Table");
  tab.setImage(ch.ivyteam.swt.icons.IconFactory.get(this).getTable(Size.SIZE_16));
  
  Group grpDecisions = new Group(tabs, SWT.NONE);
  grpDecisions.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
  grpDecisions.setText("Decisions");
  grpDecisions.setLayout(new GridLayout(1, false));
  tab.setControl(grpDecisions);
  
  columnEdit = new ColumnEditActionsComposite(grpDecisions, SWT.NONE);
  columnEdit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
  addDataChooser();
  
  table = new DecisionTableComposite(grpDecisions, SWT.NONE);
  table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
  return tab;
}
 
開發者ID:ivy-supplements,項目名稱:bpm-beans,代碼行數:21,代碼來源:DecisionTableEditor.java

示例4: buildContents

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void buildContents() {
	tabFolder = new CTabFolder(shell, SWT.TOP | SWT.NO_TRIM);
	tabFolder.setBorderVisible(true);
	tabFolder.setBackgroundMode(SWT.INHERIT_DEFAULT);
	tabFolder.setMRUVisible(true);
	tabFolder.setSimple(false); // rounded tabs
	tabFolder.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
	final Map<String, Map<String, List<Pref>>> prefs = GamaPreferences.organizePrefs();
	for (final String tabName : prefs.keySet()) {
		final CTabItem item = new CTabItem(tabFolder, SWT.NONE);
		item.setFont(GamaFonts.getNavigHeaderFont());
		item.setText(tabName);
		item.setImage(prefs_images.get(tabName));
		item.setShowClose(false);
		buildContentsFor(item, prefs.get(tabName));
	}
	buildButtons();
	shell.layout();
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:20,代碼來源:GamaPreferencesView.java

示例5: addApplication

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void addApplication(int index, final IWorkbenchApplication app) {
	if (index < 0) {
		index = 0;
	}
	else if (index > tabFolder.getItemCount()) {
		index = tabFolder.getItemCount();
	}
	final CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE, index);
	tabItem.setText(app.getLabel());
	tabItem.setImage(ImageHelper.getImage(
			app.getIcon(),
			PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT)));
	tabItem.setToolTipText(app.getTooltip());
	final WorkbenchApplicationTree appTree = new WorkbenchApplicationTree(tabFolder, app, this);
	final WorkbenchApplicationContext context = new WorkbenchApplicationContext(workbenchContext, app, appTree);
	tabItem.setControl(appTree);
	tabItem.setData(app);
	tabItem.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(final DisposeEvent e) {
			app.onDispose();
		}
	});
	app.onContextInitialize(context);
}
 
開發者ID:jo-source,項目名稱:jo-widgets,代碼行數:26,代碼來源:WorkbenchApplicationFolder.java

示例6: createNewSearchTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void createNewSearchTab(BTSQueryRequest query, String queryName) {
	// create main tab item
	CTabItem searchTab = new CTabItem(tabFolder, SWT.NONE);
	searchTab.setShowClose(true);
	searchTab.setImage(resourceProvider.getImage(Display.getCurrent(), BTSResourceProvider.IMG_SEARCH));
	if (queryName != null && queryName.trim().length() > 0)
	{
		searchTab.setText(queryName);
	}
	else
	{
		searchTab.setText(new Integer(tabFolder.getChildren().length - 2).toString());
	}
	searchTab.setData("key", query.getQueryId());

	Composite searchTabItemComp = new Composite(tabFolder, SWT.NONE);
	searchTabItemComp.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTabItemComp.setLayout(new GridLayout());
	((GridLayout) searchTabItemComp.getLayout()).marginHeight = 0;
	((GridLayout) searchTabItemComp.getLayout()).marginWidth = 0;

	searchTab.setControl(searchTabItemComp);

	TreeViewer searchTreeViewer = new TreeViewer(searchTabItemComp);
	searchTreeViewer.getTree()
			.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTreeViewer.getTree().setLayout(new GridLayout());
	searchTab.setData("tv", searchTreeViewer);
	searchTabItemComp.layout();
	tabFolder.setSelection(searchTab);
	
	TreeNodeWrapper searchRootNode = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
	prepareTreeViewer(searchTreeViewer, searchTabItemComp);
	
	// search
	searchInput(searchTabItemComp, searchTreeViewer, searchRootNode, query, searchTab);

}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:39,代碼來源:ThsNavigator.java

示例7: showLogTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void showLogTab(String name) {
    CTabItem tabItemLog = new CTabItem(tabLogFolder, SWT.NONE);
    tabItemLog.setText(name);

    tabItemLog.setImage(new Image(display, ClassLoader
        .getSystemResourceAsStream("icons/log.png")));
    //add contorl
    listViewerLog = new ListViewer(tabLogFolder, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
                                                 | SWT.H_SCROLL);
    tabItemLog.setControl(listViewerLog.getList());
    listViewerLog.getList().setFont(new Font(display, "宋體", 10, SWT.NONE));
    //set content provider
    listViewerLog.setContentProvider(new IStructuredContentProvider() {
        public Object[] getElements(Object inputElement) {
            Vector v = (Vector) inputElement;
            return v.toArray();
        }

        public void dispose() {
        }

        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });

    listViewerLog.setInput(vectorLog);
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:28,代碼來源:AndroidRobot.java

示例8: addMachineTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void addMachineTab(final String name) {
    final CTabItem tabItem = new CTabItem(tabHandsetName, SWT.MULTI | SWT.V_SCROLL);
    tabItem.setImage(new Image(display, ClassLoader
        .getSystemResourceAsStream("icons/device.png")));
    tabItem.setText(name);

    listHandsets = new List(tabHandsetName, SWT.BORDER);

    tabItem.setControl(listHandsets);
    listHandsets.setFont(new Font(display, "宋體", 10, SWT.NONE));
    listHandsets.addListener(SWT.MenuDetect, new Listener() {
        public void handleEvent(Event event) {
            if (event.detail == 0) {
                //select handset
                if (listHandsets.getSelectionIndex() >= 0) {
                    device = findDevices.getDevices()[listHandsets.getSelectionIndex()];
                    //get device node from tree
                    listHandsets.setMenu(null);
                    createHandsetRightClickRecord();
                    listHandsets.setMenu(handsetMenu);

                }
            }
        }
    });
    //show it
    tabHandsetName.setSelection(tabItem);
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:29,代碼來源:AndroidRobot.java

示例9: addEmulator

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void addEmulator() {
    final CTabItem tabItemEmulator = new CTabItem(tabProgress, SWT.V_SCROLL | SWT.H_SCROLL);
    tabItemEmulator.setText("手機視圖");
    tabItemEmulator.setImage(new Image(display, ClassLoader
        .getSystemResourceAsStream("icons/view.png")));

    addDisplay(tabItemEmulator);
    //show it
    tabProgress.setSelection(tabItemEmulator);
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:11,代碼來源:AndroidRobot.java

示例10: addRemoteHandsetsList

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void addRemoteHandsetsList() {
    final CTabItem cloudHandsetsTabItem = new CTabItem(tabHandsetName, SWT.V_SCROLL
                                                                       | SWT.H_SCROLL);
    cloudHandsetsTabItem.setText("雲端設備");
    cloudHandsetsTabItem.setImage(new Image(display, ".\\icons\\view.png"));

    cloudHandsetsList = new List(tabHandsetName, SWT.BORDER);
    cloudHandsetsTabItem.setControl(cloudHandsetsList);
    cloudHandsetsList.setFont(new Font(display, "宋體", 10, SWT.NONE));
    //show it
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:12,代碼來源:AndroidRobot.java

示例11: createTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
/**
 * Create a tab for a contributor 
 * 
 * @param provider a contributor
 */
private void createTab(TemplateViewProvider provider){
	CTabItem tableItem = new CTabItem(folder, SWT.NONE);
	tableItem.setText(provider.getTabName());
	tableItem.setImage(provider.getTabImage());
	Composite tableComposite = new Composite(folder, SWT.NONE);
	tableComposite.setLayout(new GridLayout(1,false));
	provider.createControls(tableComposite);
	tableItem.setControl(tableComposite);
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:15,代碼來源:TemplateStyleView.java

示例12: addFolderItem

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void addFolderItem(String title, Image img, AbstractTabComposite content) {
    CTabItem itm = new CTabItem(tabs, SWT.NONE);
    content.setTab(itm);
    if (img != null) {
        itm.setImage(img);
    }
    Application.setTabLabel(itm, title);
    itm.setControl(content);
    this.application.getFolderMonitor().registerTabItem(itm);
}
 
開發者ID:chfoo,項目名稱:areca-backup-release-mirror,代碼行數:11,代碼來源:MainWindow.java

示例13: createNewSearchTab

import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void createNewSearchTab(BTSQueryRequest query, String queryName, List<BTSCorpusObject> objects) {
	// create main tab item
	CTabItem searchTab = new CTabItem(tabFolder, SWT.NONE);
	searchTab.setShowClose(true);
	searchTab.setImage(resourceProvider.getImage(Display.getCurrent(), BTSResourceProvider.IMG_SEARCH));
	if (queryName != null && queryName.trim().length() > 0)
	{
		searchTab.setText(queryName);
	}
	else
	{
		searchTab.setText(new Integer(tabFolder.getChildren().length - 2).toString());
	}
	if (query != null)
	{
		searchTab.setData("key", query.getQueryId());
	}

	Composite searchTabItemComp = new Composite(tabFolder, SWT.NONE);
	searchTabItemComp.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTabItemComp.setLayout(new GridLayout());
	((GridLayout) searchTabItemComp.getLayout()).marginHeight = 0;
	((GridLayout) searchTabItemComp.getLayout()).marginWidth = 0;

	searchTab.setControl(searchTabItemComp);

	TreeViewer searchTreeViewer = new TreeViewer(searchTabItemComp);
	searchTreeViewer.getTree()
			.setLayoutData(new GridData(GridData.FILL_BOTH));
	searchTreeViewer.getTree().setLayout(new GridLayout());
	searchTab.setData("tv", searchTreeViewer);
	searchTabItemComp.layout();
	tabFolder.setSelection(searchTab);
	
	TreeNodeWrapper searchRootNode = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
	prepareTreeViewer(searchTreeViewer, searchTabItemComp);
	
	// search
	searchInput(searchTabItemComp, searchTreeViewer, searchRootNode, query, objects, searchTab);

}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:42,代碼來源:LemmaNavigator.java


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