本文整理汇总了Java中org.eclipse.swt.custom.CCombo.getData方法的典型用法代码示例。如果您正苦于以下问题:Java CCombo.getData方法的具体用法?Java CCombo.getData怎么用?Java CCombo.getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.CCombo
的用法示例。
在下文中一共展示了CCombo.getData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldNameModifyListener
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
* Gets the field name modify listener.
*
* @param tableViewer
* the table viewer
* @param conditionsList
* the conditions list
* @param fieldsAndTypes
* the fields and types
* @param fieldNames
* the field names
* @param saveButton
* the save button
* @param displayButton
* the display button
* @return the field name modify listener
*/
public ModifyListener getFieldNameModifyListener(final TableViewer tableViewer, final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
ModifyListener listener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
CCombo source = (CCombo) e.getSource();
int index = (int) source.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
String fieldName = source.getText();
filterConditions.setFieldName(fieldName);
if(StringUtils.isNotBlank(fieldName)){
String fieldType = fieldsAndTypes.get(fieldName);
TableItem item = tableViewer.getTable().getItem(index);
CCombo conditionalCombo = (CCombo) item.getData(FilterConditionsDialog.CONDITIONAL_OPERATORS);
if(conditionalCombo != null && StringUtils.isNotBlank(fieldType)){
conditionalCombo.setText(filterConditions.getConditionalOperator());
conditionalCombo.setItems(FilterHelper.INSTANCE.getTypeBasedOperatorMap().get(fieldType));
new AutoCompleteField(conditionalCombo, new CComboContentAdapter(), conditionalCombo.getItems());
}
}
validateCombo(source);
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
示例2: createComboCommand
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
* DOC nrousseau Comment method "createComboCommand".
*
* @param source
* @return
*/
private PropertyChangeCommand createComboCommand(CCombo combo) {
String paramName = (String) combo.getData(PARAMETER_NAME);
IElementParameter param = elem.getElementParameter(paramName);
String value = combo.getText();
// for (int j = 0; j < param.getListItemsValue().length; j++) {
// if (combo.getText().equals(param.getListItemsDisplayName()[j])) {
// value = (String) param.getListItemsValue()[j];
// }
// }
if (value.equals(param.getValue())) {
return null;
}
return new PropertyChangeCommand(elem, paramName, value);
}
示例3: modifyText
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
@Override
public void modifyText(ModifyEvent event) {
CCombo combo = (CCombo) event.widget;
int column = (int) combo.getData("column");
String oldValue = ((TableItem) combo.getData("item")).getText(column);
String newValue = combo.getText();
logger.info(String.format("Updating %s = %s", oldValue, newValue));
if (selectorFromSWD.containsValue(newValue)) {
((TableItem) combo.getData("item")).setText(column, newValue);
}
}
示例4: processConditionalOperator
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void processConditionalOperator(CCombo source, List<Condition> conditionsList, Map<String, String> fieldsAndTypes,
String[] fieldNames, Button saveButton, Button displayButton){
int index = (int) source.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
filterConditions.setConditionalOperator(source.getText());
validateCombo(source);
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
示例5: processRelationalOperator
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void processRelationalOperator(CCombo source, List<Condition> conditionsList, Map<String, String> fieldsAndTypes,
String[] fieldNames, Button saveButton, Button displayButton){
int index = (int) source.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
filterConditions.setRelationalOperator(source.getText());
if(index != 0){
validateCombo(source);
}
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
示例6: getTableItem
import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private TableItem getTableItem(CCombo source) {
TableEditor tableEditor = (TableEditor) source.getData(FilterConstants.CONDITIONAL_EDITOR);
TableItem tableItem = tableEditor.getItem();
return tableItem;
}