本文整理匯總了Java中org.eclipse.swt.events.ModifyEvent.getSource方法的典型用法代碼示例。如果您正苦於以下問題:Java ModifyEvent.getSource方法的具體用法?Java ModifyEvent.getSource怎麽用?Java ModifyEvent.getSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.events.ModifyEvent
的用法示例。
在下文中一共展示了ModifyEvent.getSource方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: attachTextModifyListner
import org.eclipse.swt.events.ModifyEvent; //導入方法依賴的package包/類
/**
* Applies multiple listeners to textBoxes
* @param widgetList
* @return
*/
private ModifyListener attachTextModifyListner(final ArrayList<AbstractWidget> widgetList) {
return new ModifyListener() {
@Override
public void modifyText(ModifyEvent event) {
Text text = (Text)event.getSource();
if(((Button) tableNameRadioButton.getSWTWidgetControl()).getSelection()){
databaseSelectionConfig.setTableName(text.getText());
}else{
databaseSelectionConfig.setSqlQuery(text.getText());
}
Utils.INSTANCE.addMouseMoveListener(sqlQueryTextBox, cursor);
Utils.INSTANCE.addMouseMoveListener(textBoxTableName, cursor);
showHideErrorSymbol(widgetList);
}
};
}
示例2: getFieldNameModifyListener
import org.eclipse.swt.events.ModifyEvent; //導入方法依賴的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;
}
示例3: getConditionalOperatorModifyListener
import org.eclipse.swt.events.ModifyEvent; //導入方法依賴的package包/類
/**
* Gets the conditional operator modify 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 conditional operator modify listener
*/
public ModifyListener getConditionalOperatorModifyListener(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();
TableItem tableItem = getTableItem(source);
Condition condition = (Condition) tableItem.getData();
if (tableItem.getData(FilterConstants.VALUE2TEXTBOX) != null) {
Text text = (Text) tableItem.getData(FilterConstants.VALUE2TEXTBOX);
enableAndDisableValue2TextBox(condition.getConditionalOperator(), text);
}
processConditionalOperator(source, conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
示例4: modifyText
import org.eclipse.swt.events.ModifyEvent; //導入方法依賴的package包/類
@Override
public void modifyText(ModifyEvent event) {
if(event.getSource() == lowerBoundText){
validate(lowerBoundText, upperBoundText,
lowerBoundTextDecorator, upperBoundTextDecorator, lowerBoundText.getText(), upperBoundText.getText());
}else{
validate(upperBoundText, lowerBoundText,
upperBoundTextDecorator, lowerBoundTextDecorator, lowerBoundText.getText(), upperBoundText.getText());
}
}
示例5: modifyText
import org.eclipse.swt.events.ModifyEvent; //導入方法依賴的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();
}
}
示例6: getRelationalOpModifyListener
import org.eclipse.swt.events.ModifyEvent; //導入方法依賴的package包/類
/**
* Gets the relational op modify 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 relational op modify listener
*/
public ModifyListener getRelationalOpModifyListener(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();
processRelationalOperator(source, conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}