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


Java FocusEvent.getSource方法代碼示例

本文整理匯總了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());
    }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:21,代碼來源:SWTNumberAxisEditor.java

示例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());
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:21,代碼來源:SWTNumberAxisEditor.java

示例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);
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:22,代碼來源:CloudFoundryServiceWizardPageRightPanel.java

示例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
    }

}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:23,代碼來源:AssociationGeneralSection.java

示例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);
}
 
開發者ID:osswangxining,項目名稱:dockerfoundry,代碼行數:22,代碼來源:DockerFoundryServiceWizardPageRightPanel.java

示例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());
		}
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:19,代碼來源:SWTChartEditor.java

示例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;
	}
}
 
開發者ID:wendehals,項目名稱:arduino_sct_tools,代碼行數:15,代碼來源:ArduinoFeatureConfigurationSection.java

示例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());
	}
}
 
開發者ID:wendehals,項目名稱:arduino_sct_tools,代碼行數:13,代碼來源:GenericFeatureConfigurationSection.java

示例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;
	}
}
 
開發者ID:wendehals,項目名稱:arduino_sct_tools,代碼行數:16,代碼來源:LicenseHeaderFeatureConfigurationSection.java


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