本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例5: getListenerType
import org.eclipse.swt.SWT; //导入方法依赖的package包/类
@Override
public int getListenerType() {
return SWT.FocusIn;
}
示例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;
}