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


Java SWT.Modify方法代碼示例

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


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

示例1: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	
	Listener listener=new Listener() {
		
		@Override
		public void handleEvent(Event event) {
			IPath path = new Path(((Text) widgetList[0]).getText().trim());
			if (event.type == SWT.Modify ) {
				if (StringUtils.isNotBlank(path.segment(0))) {
					if (path.lastSegment().endsWith(".xml")) {
						txtDecorator.hide();
						((Text) widgetList[0]).setToolTipText("");
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));

					}else{
						txtDecorator.show();
						txtDecorator.setDescriptionText("Select valid XML file");
						((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
					}
				}
			}
		}
	};
	
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:33,代碼來源:XmlFilePathModifyListener.java

示例2: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helpers != null) {
		txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
	}

	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			String string = ((Text) widgetList[0]).getText();
			if (event.type == SWT.Modify) {
				if (StringUtils.isNotBlank(string)) {
					Matcher matchs = Pattern.compile(Constants.NUMERIC_REGEX).matcher(string);
					if (matchs.matches()|| ParameterUtil.isParameter(string)) {
						txtDecorator.hide();
						((Text) widgetList[0]).setToolTipText("");
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					} else {
						txtDecorator.show();
						txtDecorator.setDescriptionText(Messages.DB_NUMERIC_PARAMETERZIATION_ERROR);
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					}
				} else {
					txtDecorator.show();
					txtDecorator.setDescriptionText(Messages.DB_NUMERIC_PARAMETERZIATION_ERROR);
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
				}
			}else{
				txtDecorator.hide();
				((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:38,代碼來源:VerifyNumericAndParameterForDBComponents.java

示例3: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	Listener listener=new Listener() {

		@Override
		public void handleEvent(Event event) {
			
			String string=((Text)widgetList[0]).getText();
			if(event.type==SWT.Modify){ 
				if(StringUtils.isEmpty(string)){
					txtDecorator.show();
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
				}else{
					txtDecorator.hide();
					((Text) widgetList[0]).setToolTipText("");
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
				}

			}else{
				txtDecorator.hide();
				((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
			}
		}		
	};

	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:33,代碼來源:DelimiterModifyListener.java

示例4: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	
	Listener listener=new Listener() {
		
		@Override
		public void handleEvent(Event event) {
			String path=((Text)widgetList[0]).getText().trim();
			
			if(event.type==SWT.Modify){
				if(StringUtils.isNotBlank(path)){
					if(isFile(path)){
						txtDecorator.show();
						txtDecorator.setDescriptionText("please enter folder location instead of file.");	
						((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
						
					}else{
						//txtDecorator.setDescriptionText(Messages.EMPTYFIELDMESSAGE);
						txtDecorator.hide();
						((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
						
					}
				}
			}
		}		
	};
	
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:36,代碼來源:FilePathModifyListener.java

示例5: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar,ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
		if (helper.get(HelperType.MINIMUM_PORT_COUNT) != null)
			minimunPortCount = Integer.valueOf((String) helper.get(HelperType.MINIMUM_PORT_COUNT));
	}

	Listener listener=new Listener() {
		@Override
		public void handleEvent(Event event) {
			String string =((Text) widgetList[0]).getText().trim();	
			if(StringUtils.isNotEmpty(string)){
				if(event.type == SWT.Modify){
					if(Integer.parseInt(string) < minimunPortCount || Integer.parseInt(string) > 25 ){
						txtDecorator.setDescriptionText(Messages.bind(Messages.PORT_VALUE, minimunPortCount-1));
						txtDecorator.show();
						propertyDialogButtonBar.enableOKButton(false);
						propertyDialogButtonBar.enableApplyButton(false);
					} else {
						txtDecorator.hide();
						propertyDialogButtonBar.enableOKButton(true);
						propertyDialogButtonBar.enableApplyButton(true);
					}
				}
			}
			else
			{
				propertyDialogButtonBar.enableApplyButton(true);
				txtDecorator.show();
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:37,代碼來源:ELTInputCountListener.java

示例6: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	Listener listener=new Listener() {
		
		@Override
		public void handleEvent(Event event) {
			String string=((Text)widgetList[0]).getText().trim();
			if(event.type==SWT.Modify){
				if(StringUtils.isBlank(string)){
					//txtDecorator.setDescriptionText(Messages.EMPTYFIELDMESSAGE);
					
					txtDecorator.show();
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
				}else{
					//txtDecorator.setDescriptionText(Messages.EMPTYFIELDMESSAGE);
					txtDecorator.hide();
					((Text) widgetList[0]).setToolTipText("");
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
				}
				
			}else{
				//txtDecorator.setDescriptionText(Messages.EMPTYFIELDMESSAGE);
				txtDecorator.hide();
				((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
			}
		}		
	};
	
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:36,代碼來源:ELTModifyListener.java

示例7: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helpers != null) {
		txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
	}

	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			String string = ((Text) widgetList[0]).getText();
			if (event.type == SWT.Modify) {
				if (StringUtils.isNotBlank(string)) {
					Matcher matchs = Pattern.compile(Constants.PORT_VALIDATION_REGEX).matcher(string);
					if (matchs.matches()|| ParameterUtil.isParameter(string)) {
						txtDecorator.hide();
						((Text) widgetList[0]).setToolTipText("");
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					} else {
						txtDecorator.show();
						txtDecorator.setDescriptionText(Messages.PORT_VALIDATION_ERROR);
						((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
						((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					}
				} else {
					txtDecorator.show();
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));

				}
			}else{
				txtDecorator.hide();
				((Text) widgetList[0]).setToolTipText("");
				((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:41,代碼來源:VerifyNumericAndParameterListener.java

示例8: getListenerType

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public int getListenerType() {
	return SWT.Modify;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:5,代碼來源:XmlFilePathModifyListener.java

示例9: getListener

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helpers != null) {
		txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {

			String string = ((Text) widgetList[0]).getText();
			if (event.type == SWT.Modify) {

				if (StringUtils.isNotBlank(string)) {
					String extension = "";
					int i = string.lastIndexOf('.');
					if (i > 0) {
						extension = string.substring(i);
					}
					if ((StringUtils.equals(extension, ".xls") || StringUtils.equals(extension, ".xlsx"))
							|| ParameterUtil.isParameter(string)) {
						txtDecorator.hide();
						((Text) widgetList[0]).setToolTipText("");
					} else {
						txtDecorator.show();
						((Text) widgetList[0]).setToolTipText(
								"Please provide proper file name with extension .xls or .xlsx for creation of an Excelsheet");
						txtDecorator.setDescriptionText(
								"Please provide proper file name with extension .xls or .xlsx for creation of an Excelsheet");
						((Text) widgetList[0])
								.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry(255, 255, 255));
					}
				} else {
					txtDecorator.show();
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
					((Text) widgetList[0])
							.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry(255, 255, 204));
				}

			} else {
				txtDecorator.hide();
				((Text) widgetList[0])
						.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry(255, 255, 255));
			}
		}
	};

	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:53,代碼來源:VerifyExcelFileNameListener.java

示例10: getListenerType

import org.eclipse.swt.SWT; //導入方法依賴的package包/類
@Override
public int getListenerType() {
	
	return SWT.Modify;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:6,代碼來源:ELTCheckFileExtensionListener.java


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