Return to Snippet

Revision: 14312
at May 29, 2009 11:20 by guetux


Updated Code
public void setEnabled(boolean enabled) {
	if (enabled != this.enabled) {
		Boolean oldVal = this.enabled ? Boolean.TRUE : Boolean.FALSE;
		Boolean newVal = enabled ? Boolean.TRUE : Boolean.FALSE;
		this.enabled = enabled;
		firePropertyChange(ENABLED, oldVal, newVal);
	}
}

Revision: 14311
at May 29, 2009 09:13 by guetux


Initial Code
public void setEnabled(boolean enabled) {
		if (enabled != this.enabled) {
			Boolean oldVal = this.enabled ? Boolean.TRUE : Boolean.FALSE;
			Boolean newVal = enabled ? Boolean.TRUE : Boolean.FALSE;
			this.enabled = enabled;
			firePropertyChange(ENABLED, oldVal, newVal);
		}
	}

Initial URL

                                

Initial Description
i love those ternary expressions, they really make things clear, don't they? found in org.eclipse.jface.action.Action

Initial Title
Boolean fun from eclipse project

Initial Tags
java

Initial Language
Java