当前位置: 首页>>代码示例>>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;未经允许,请勿转载。