Boolean fun from eclipse project


/ Published in: Java
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. public void setEnabled(boolean enabled) {
  2. if (enabled != this.enabled) {
  3. Boolean oldVal = this.enabled ? Boolean.TRUE : Boolean.FALSE;
  4. Boolean newVal = enabled ? Boolean.TRUE : Boolean.FALSE;
  5. this.enabled = enabled;
  6. firePropertyChange(ENABLED, oldVal, newVal);
  7. }
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.