本文整理汇总了Java中org.eclipse.swt.widgets.Text.getData方法的典型用法代码示例。如果您正苦于以下问题:Java Text.getData方法的具体用法?Java Text.getData怎么用?Java Text.getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Text
的用法示例。
在下文中一共展示了Text.getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTextBoxValue1Listener
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* Gets the text box value 1 listener.
*
* @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 text box value 1 listener
*/
public Listener getTextBoxValue1Listener(final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
Text text = (Text)event.widget;
int index = (int) text.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
filterConditions.setValue1(text.getText());
validateText(text, filterConditions.getFieldName(), fieldsAndTypes, filterConditions.getConditionalOperator());
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
示例2: getTextBoxValue2Listener
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* Gets the text box value 2 listener.
*
* @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 text box value 2 listener
*/
public Listener getTextBoxValue2Listener(final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
Text text = (Text)event.widget;
int index = (int) text.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
filterConditions.setValue2(text.getText());
validateText(text, filterConditions.getFieldName(), fieldsAndTypes,filterConditions.getConditionalOperator());
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
示例3: checkState
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
* Checks if all values are correct and enable/disable ok button
*/
private void checkState() {
if (editorList != null) {
int size = editorList.size();
for (int i = 0; i < size; i++) {
Text fieldEditor = editorList.get(i);
String errorMessage = (String) fieldEditor.getData(ERROR_KEY);
if (StringUtils.isNotBlank(errorMessage)) {
executionTrackPreference.setErrorMessage(errorMessage);
executionTrackPreference.setValid(false);
break;
} else {
executionTrackPreference.setErrorMessage(null);
executionTrackPreference.setValid(true);
}
}
}
}
示例4: modifyText
import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void modifyText(ModifyEvent event) {
Text textBox = (Text)event.getSource();
Button btnRemoteMode = (Button)textBox.getData(RunConfigDialog.SELECTION_BUTTON_KEY);
String txt= textBox.getText();
if (StringUtils.isBlank(txt)) {
if(errorDecorator==null){
errorDecorator = WidgetUtility.addDecorator(textBox,Messages.bind(Messages.EMPTY_FIELD, fieldName));
}
if(btnRemoteMode!=null){
if(btnRemoteMode.getSelection()){
errorDecorator.show();
}else
errorDecorator.hide();
}else{
errorDecorator.show();
}
errorDecorator.setMarginWidth(3);
} else {
if(errorDecorator!=null)
errorDecorator.hide();
}
}