本文整理汇总了Java中org.eclipse.swt.events.FocusEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java FocusEvent.getSource方法的具体用法?Java FocusEvent.getSource怎么用?Java FocusEvent.getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.events.FocusEvent
的用法示例。
在下文中一共展示了FocusEvent.getSource方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
public void focusLost(FocusEvent e) {
if (e.getSource() == this.minimumRangeValue) {
// verify min value
if (! validateMinimum( this.minimumRangeValue.getText()))
this.minimumRangeValue.setText(String.valueOf(
this.minimumValue));
else
this.minimumValue = Double.parseDouble(
this.minimumRangeValue.getText());
}
else if (e.getSource() == this.maximumRangeValue) {
// verify max value
if (! validateMaximum(this.maximumRangeValue.getText()))
this.maximumRangeValue.setText(String.valueOf(
this.maximumValue));
else
this.maximumValue = Double.parseDouble(
this.maximumRangeValue.getText());
}
}
示例2: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
public void focusLost(FocusEvent e) {
if (e.getSource() == this.minimumRangeValue) {
// verify min value
if (!validateMinimum(this.minimumRangeValue.getText()))
this.minimumRangeValue.setText(String.valueOf(
this.minimumValue));
else
this.minimumValue = Double.parseDouble(
this.minimumRangeValue.getText());
}
else if (e.getSource() == this.maximumRangeValue) {
// verify max value
if (!validateMaximum(this.maximumRangeValue.getText()))
this.maximumRangeValue.setText(String.valueOf(
this.maximumValue));
else
this.maximumValue = Double.parseDouble(
this.maximumRangeValue.getText());
}
}
示例3: focusGained
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
@Override
public void focusGained(FocusEvent e) {
Control c = (Control) e.getSource();
ServiceInstance service = (ServiceInstance) c.getData();
Rectangle bounds = service.getAppxLocation(); // child.getBounds();
Rectangle area = scrollComp.getClientArea();
Point origin = scrollComp.getOrigin();
// Our view is lower than the item
if (origin.y > bounds.y) {
origin.y = Math.max(0, bounds.y);
}
// Our view is above the item
if (origin.y + area.height < bounds.y + bounds.height) {
origin.y = Math.max(0, bounds.y + bounds.height - area.height);
}
scrollComp.setOrigin(origin);
}
示例4: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
public void focusLost(FocusEvent e) {
CCombo combo = (CCombo) e.getSource();
String text = combo.getText();
try {
final int value = new Integer(text).intValue();
final Property property = this.property;
if (value > 0) {
DomainUtil.run(new TransactionalAction() {
@Override
public void doExecute() {
property.setLower(value);
property.setUpper(value);
}
});
}
} catch (Exception e2) {
// TODO: handle exception
}
}
示例5: focusGained
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
@Override
public void focusGained(FocusEvent e) {
Control c = (Control) e.getSource();
ServiceInstance service = (ServiceInstance) c.getData();
Rectangle bounds = service.getAppxLocation(); // child.getBounds();
Rectangle area = scrollComp.getClientArea();
Point origin = scrollComp.getOrigin();
if (bounds != null) {
// Our view is lower than the item
if (origin.y > bounds.y) {
origin.y = Math.max(0, bounds.y);
}
// Our view is above the item
if (origin.y + area.height < bounds.y + bounds.height) {
origin.y = Math.max(0, bounds.y + bounds.height - area.height);
}
}
scrollComp.setOrigin(origin);
}
示例6: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
@Override
public void focusLost(final FocusEvent e) {
if (e.getSource() == this.minimumRangeValue) {
// verify min value
if (!validateMinimum(this.minimumRangeValue.getText())) {
this.minimumRangeValue.setText(String.valueOf(this.minimumValue));
} else {
this.minimumValue = Double.parseDouble(this.minimumRangeValue.getText());
}
} else if (e.getSource() == this.maximumRangeValue) {
// verify max value
if (!validateMaximum(this.maximumRangeValue.getText())) {
this.maximumRangeValue.setText(String.valueOf(this.maximumValue));
} else {
this.maximumValue = Double.parseDouble(this.maximumRangeValue.getText());
}
}
}
示例7: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
/**
* @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusLost(final FocusEvent event) {
if (!this.mutex) {
this.mutex = true;
final Text text = (Text) event.getSource();
getFormPage().updateModel((FeatureParameter) text.getData(), text.getText());
this.mutex = false;
}
}
示例8: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
/**
* @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusLost(final FocusEvent event) {
if (!this.mutex) {
final Text text = (Text) event.getSource();
final FeatureParameter parameter = (FeatureParameter) text.getData();
getFormPage().updateModel(parameter, text.getText());
}
}
示例9: focusLost
import org.eclipse.swt.events.FocusEvent; //导入方法依赖的package包/类
/**
* @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
public void focusLost(final FocusEvent event) {
if (!this.mutex) {
this.mutex = true;
final Text text = (Text) event.getSource();
final FeatureParameter parameter = (FeatureParameter) text.getData();
getFormPage().updateModel(parameter, text.getText());
this.mutex = false;
}
}