当前位置: 首页>>代码示例>>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;未经允许,请勿转载。