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


Java ModifyEvent.getSource方法代碼示例

本文整理匯總了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);
		}
	};
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:SelectionDatabaseWidget.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:46,代碼來源:FilterHelper.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:34,代碼來源:FilterHelper.java

示例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());
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:11,代碼來源:ModifyListenerForDBComp.java

示例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();

	}

}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:28,代碼來源:EmptyTextListener.java

示例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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:29,代碼來源:FilterHelper.java


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