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


Java CCombo.setData方法代碼示例

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


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

示例1: addComboInTable

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName, 
		String editorName, int columnIndex,	String[] relationalOperators, SelectionListener dropDownSelectionListener,
		ModifyListener modifyListener,FocusListener focusListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final CCombo combo = new CCombo(buttonPane, SWT.NONE);
	combo.setItems(relationalOperators);
	combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(comboName, combo);
	tableItem.setData(comboPaneName, buttonPane);
	combo.addSelectionListener(dropDownSelectionListener);
	combo.addModifyListener(modifyListener);
	combo.addFocusListener(focusListener);
	new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems());
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	combo.setData(editorName, editor);
	return combo;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:FilterConditionsDialog.java

示例2: appendBlankRowToTable

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
private static void appendBlankRowToTable(Table table, TableItem item,
		int index) {

	item.setText(new String[] { String.format("%d", index), "Element name",
			"Action keyword", "", "Selector value" });

	TableEditor keywordChoiceEditor = new TableEditor(table);
	CCombo keywordChoiceCombo = new CCombo(table, SWT.NONE);
	keywordChoiceCombo.setText("Choose..");
	for (String keyword : keywordTable.keySet()) {
		keywordChoiceCombo.add(keyword);
	}
	// NOTE: none of options is initially selected
	keywordChoiceEditor.grabHorizontal = true;
	int keywordChoiceColumn = 2;
	keywordChoiceCombo.setData("column", keywordChoiceColumn);
	keywordChoiceCombo.setData("item", item);
	keywordChoiceEditor.setEditor(keywordChoiceCombo, item,
			keywordChoiceColumn);
	keywordChoiceCombo.addModifyListener(new keywordChoiceListener());

	TableEditor selectorChoiceEditor = new TableEditor(table);
	CCombo selectorChoiceCombo = new CCombo(table, SWT.NONE);
	selectorChoiceCombo.setText("Choose");
	for (String locator : selectorFromSWD.values()) {
		selectorChoiceCombo.add(locator);
	}
	// NOTE: none of options is initially selected
	selectorChoiceEditor.grabHorizontal = true;
	int selectorChoiceColumn = 3;
	selectorChoiceCombo.setData("item", item);
	selectorChoiceCombo.setData("column", selectorChoiceColumn);
	selectorChoiceEditor.setEditor(selectorChoiceCombo, item,
			selectorChoiceColumn);
	selectorChoiceCombo.addModifyListener(new selectorChoiceListener());
	return;
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:38,代碼來源:TableEditorEx.java

示例3: createCCombo

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
/**
 * Creates a combo box as a part of the form.
 * 
 * @param parent
 *          the combo box parent.
 * @param comboStyle
 *          the combo box style.
 * @return the combo box.
 */
public CCombo createCCombo(Composite parent, int comboStyle) {
	CCombo combo = new CCombo(parent, comboStyle);
	adapt(combo, true, false);
	// Bugzilla 145837 - workaround for no borders on Windows XP
	if (getBorderStyle() == SWT.BORDER) {
		combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
	}
	return combo;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:19,代碼來源:TabbedPropertySheetWidgetFactory.java

示例4: appendRowToTable

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
private static void appendRowToTable(Table table, List<String> stepIds) {

		TableItem[] tableItems = table.getItems();
		int cnt = 0;
		for (String stepId : stepIds) {

			// get element data
			TableItem tableItem = tableItems[cnt];
			Map<String, String> elementData = testData.get(stepId);
			String selectorChoice = selectorFromSWD
					.get(elementData.get("ElementSelectedBy"));

			String selectorValue = elementData
					.get(elementData.get("ElementSelectedBy"));

			// Append row into the TableEditor
			tableItem.setText(new String[] { elementData.get("ElementStepNumber"),
					elementData.get("ElementCodeName"), String.format("Action %d", cnt),
					selectorChoice, selectorValue });
			// some columns need to be converted to selects

			TableEditor keywordChoiceEditor = new TableEditor(table);
			CCombo keywordChoiceCombo = new CCombo(table, SWT.NONE);
			keywordChoiceCombo.setText("Choose..");
			for (String keyword : keywordTable.keySet()) {
				keywordChoiceCombo.add(keyword);
			}
			// NOTE: none of options is initially selected
			keywordChoiceEditor.grabHorizontal = true;
			int keywordChoiceColumn = 2;
			keywordChoiceCombo.setData("column", keywordChoiceColumn);
			keywordChoiceCombo.setData("item", tableItem);
			keywordChoiceEditor.setEditor(keywordChoiceCombo, tableItem,
					keywordChoiceColumn);
			keywordChoiceCombo.addModifyListener(new keywordChoiceListener());

			TableEditor selectorChoiceEditor = new TableEditor(table);
			CCombo selectorChoiceCombo = new CCombo(table, SWT.NONE);
			for (String locator : selectorFromSWD.values()) {
				selectorChoiceCombo.add(locator);
			}
			int currentSelector = new ArrayList<String>(selectorFromSWD.values())
					.indexOf(selectorFromSWD.get(elementData.get("ElementSelectedBy")));

			selectorChoiceCombo.select(currentSelector);
			selectorChoiceEditor.grabHorizontal = true;
			int selectorChoiceColumn = 3;
			selectorChoiceCombo.setData("item", tableItem);
			selectorChoiceCombo.setData("column", selectorChoiceColumn);
			selectorChoiceEditor.setEditor(selectorChoiceCombo, tableItem,
					selectorChoiceColumn);
			selectorChoiceCombo.addModifyListener(new selectorChoiceListener());
			cnt = cnt + 1;
		}
		return;
	}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:57,代碼來源:TableEditorEx.java


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