本文整理匯總了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;
}
}