settextenabled.java

来自「个人珍藏」· Java 代码 · 共 24 行

JAVA
24
字号
/*
 *编写者:陈冈
 *高校经费测算系统--设置文本框的使能状态
 *编写时间:2006-11-24
 */
package cn.edu.jfcs.sys;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;

public class SetTextEnabled {
	public SetTextEnabled(final Control control, boolean isEnabled) {
		if (control instanceof Composite) {
			Control[] children = ((Composite) control).getChildren();
			int j = children.length;
			for (int i = 0; i < j; i++) {
				if (children[i] instanceof Text)
					children[i].setEnabled(isEnabled);
			}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?