当前位置: 首页>>代码示例>>Java>>正文


Java SWT.FocusOut方法代码示例

本文整理汇总了Java中org.eclipse.swt.SWT.FocusOut方法的典型用法代码示例。如果您正苦于以下问题:Java SWT.FocusOut方法的具体用法?Java SWT.FocusOut怎么用?Java SWT.FocusOut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.FocusOut方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getListener

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	if (helpers != null) {
		txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
		txtDecorator.hide();
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgets[0]).getText().trim();
			if (SWT.FocusOut == event.type) {
				Matcher matchs=Pattern.compile(Constants.PORT_VALIDATION_REGEX).matcher(charSet);
				if (StringUtils.isBlank(charSet)){
					txtDecorator.show();
					((Text) widgets[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
					((Text) widgets[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else if (matchs.matches()||ParameterUtil.isParameter(charSet)) {
					txtDecorator.hide();
				}else{
					txtDecorator.show();
				}
			} 
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:30,代码来源:PortFocusOutListener.java

示例2: 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);
		txtDecorator.hide();
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgetList[0]).getText();
			if (SWT.FocusOut == event.type) {
				if (StringUtils.isEmpty(charSet)){
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
				}
			} 
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:28,代码来源:DelimiterFocusOutListener.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);
		txtDecorator.hide();
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgetList[0]).getText().trim();
			if (SWT.FocusOut == event.type) {
				if (StringUtils.isBlank(charSet)){
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
				}
			} 
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:28,代码来源:ELTNormalFocusOutListener.java

示例4: getListener

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helpers != null) {
		if (helpers.get(HelperType.MINIMUM_PORT_COUNT) != null){
			minimunPortCount = Integer.valueOf((String) helpers.get(HelperType.MINIMUM_PORT_COUNT));
		}
		currentComponent = (Component) helpers.get(HelperType.CURRENT_COMPONENT);
	}
	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			if (event.type == SWT.FocusOut) {
				Text textBox = (Text) widgetList[0];
				String textBoxValue = ((Text) event.widget).getText();
				if(StringUtils.isNotBlank(textBoxValue) && StringUtils.isNumeric(textBoxValue)){
					if ((Integer.parseInt(textBoxValue) < minimunPortCount || Integer.parseInt(textBoxValue) > 25)
							&& currentComponent.getProperties().get(Constants.UNUSED_AND_INPUT_PORT_COUNT_PROPERTY) != null){
							textBox.setText((String) currentComponent.getProperties().get(
									Constants.UNUSED_AND_INPUT_PORT_COUNT_PROPERTY));
					}
				}
			}
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:29,代码来源:JoinInputCountFocusOutListener.java

示例5: 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 charSet = ((Text) widgetList[0]).getText().trim();
			if (event.type == SWT.FocusOut) {

				if (charSet == null || charSet == "") {
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
					((Text) widgetList[0]).setText(charSet.replace("@{", "").replace("}", ""));
					((Text) widgetList[0]).setText("@{"+((Text) widgetList[0]).getText()+"}");
					((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,代码行数:36,代码来源:ELTFocusOutListener.java

示例6: handleEvent

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
public void handleEvent(Event event) {
	switch (event.type) {
	case SWT.KeyDown:
		if (event.character == SWT.CR)
			controlChanged((Control) event.widget);
		break;
	case SWT.FocusOut:
		controlChanged((Control) event.widget);
		break;
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:12,代码来源:ControlChangeListener.java

示例7: getListenerType

import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public int getListenerType() {
	return SWT.FocusOut;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:5,代码来源:PortFocusOutListener.java

示例8: 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);
		txtDecorator.hide();
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgetList[0]).getText().trim();
			if (SWT.FocusOut == event.type) {
				if (StringUtils.isNotBlank(charSet)) {
					String extension = "";
					int i = charSet.lastIndexOf('.');
					if (i > 0) {
						extension = charSet.substring(i);
					}
					if ((StringUtils.equals(extension, ".xls") || StringUtils.equals(extension, ".xlsx"))
							|| ParameterUtil.isParameter(charSet)) {
						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));
				}
			}
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:46,代码来源:FocusOutExcelFileNameListener.java


注:本文中的org.eclipse.swt.SWT.FocusOut方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。