Java Code Examples for org.eclipse.swt.events.FocusEvent#getSource()

The following examples show how to use org.eclipse.swt.events.FocusEvent#getSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SWTNumberAxisEditor.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
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());
    }
}
 
Example 2
Source File: SWTNumberAxisEditor.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
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());
    }
}
 
Example 3
Source File: SWTNumberAxisEditor.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
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());
    }
}
 
Example 4
Source File: SWTChartEditor.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@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());
		}
	}
}
 
Example 5
Source File: SWTNumberAxisEditor.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example 6
Source File: SWTNumberAxisEditor.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example 7
Source File: SWTNumberAxisEditor.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
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());
    }
}
 
Example 8
Source File: SWTNumberAxisEditor.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
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());
    }
}