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


Java SWT.FocusIn方法代碼示例

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


在下文中一共展示了SWT.FocusIn方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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) {
			String charSet = ((Text) widgetList[0]).getText();
			if(SWT.FocusIn == event.type) {
					if (StringUtils.isEmpty(charSet)) {
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
				}
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:25,代碼來源:DelimiterFocusInListener.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);
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgetList[0]).getText().trim();
			if (event.type == SWT.FocusIn) {
				((Text) widgetList[0]).setText(charSet.replace("@{", "").replace("}", ""));
			}
		}
	};

	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:ELTFocusGainedListener.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 charSet = ((Text) widgetList[0]).getText().trim();
			if(SWT.FocusIn == event.type) {
				if (StringUtils.isBlank(charSet)) {
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
				}
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:25,代碼來源:FocusInListener.java

示例4: 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);
	}
	
	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgets[0]).getText().trim();
			if(SWT.FocusIn == 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, 255));
					((Text) widgets[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else if(matchs.matches()||ParameterUtil.isParameter(charSet)) {
					txtDecorator.hide();
				} else{
					txtDecorator.show();
				}
			}
		}
	};
	return listener;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:28,代碼來源:PortFocusInListener.java

示例5: getListenerType

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

示例6: 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 charSet = ((Text) widgetList[0]).getText().trim();
			if (SWT.FocusIn == 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,代碼行數:43,代碼來源:FocusInExcelFileNameListener.java


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