public static int getNumberOfDaysInMonth(Date date) { | public static int getNumberOfDaysInMonth(Date date) { | ||||
final int month = date.getMonth(); | final int month = date.getMonth(); | ||||
if (month == 1 && true == isLeapYear(date)) { | |||||
if (month == 1 && isLeapYear(date)) { | |||||
return 29; | return 29; | ||||
} | } | ||||
return maxDaysInMonth[month]; | return maxDaysInMonth[month]; |
Element element = Element.as(event.getEventTarget()); | Element element = Element.as(event.getEventTarget()); | ||||
// We can ignore move event if it's handled by move or over already | // We can ignore move event if it's handled by move or over already | ||||
if (currentElement == element && handledByFocus == true) { | |||||
if (currentElement == element && handledByFocus) { | |||||
return; | return; | ||||
} | } | ||||
for (int i = 0; i < childCount; i++) { | for (int i = 0; i < childCount; i++) { | ||||
VAcceptCriterion crit = VAnd.getCriteria(drag, configuration, i); | VAcceptCriterion crit = VAnd.getCriteria(drag, configuration, i); | ||||
crit.accept(drag, configuration.getChildUIDL(i), this); | crit.accept(drag, configuration.getChildUIDL(i), this); | ||||
if (accepted == true) { | |||||
if (accepted) { | |||||
callback.accepted(drag); | callback.accepted(drag); | ||||
return; | return; | ||||
} | } |
* if the editor handler is not set | * if the editor handler is not set | ||||
*/ | */ | ||||
public void setEnabled(boolean enabled) { | public void setEnabled(boolean enabled) { | ||||
if (enabled == false && state != State.INACTIVE) { | |||||
if (!enabled && state != State.INACTIVE) { | |||||
throw new IllegalStateException( | throw new IllegalStateException( | ||||
"Cannot disable: editor is in edit mode"); | "Cannot disable: editor is in edit mode"); | ||||
} else if (enabled == true && getHandler() == null) { | |||||
} else if (enabled && getHandler() == null) { | |||||
throw new IllegalStateException( | throw new IllegalStateException( | ||||
"Cannot enable: EditorHandler not set"); | "Cannot enable: EditorHandler not set"); | ||||
} | } |
* if the editor handler is not set | * if the editor handler is not set | ||||
*/ | */ | ||||
public void setEnabled(boolean enabled) { | public void setEnabled(boolean enabled) { | ||||
if (enabled == false && state != State.INACTIVE) { | |||||
if (!enabled && state != State.INACTIVE) { | |||||
throw new IllegalStateException( | throw new IllegalStateException( | ||||
"Cannot disable: editor is in edit mode"); | "Cannot disable: editor is in edit mode"); | ||||
} else if (enabled == true && getHandler() == null) { | |||||
} else if (enabled && getHandler() == null) { | |||||
throw new IllegalStateException( | throw new IllegalStateException( | ||||
"Cannot enable: EditorHandler not set"); | "Cannot enable: EditorHandler not set"); | ||||
} | } |
} | } | ||||
if (j == c.length) { | if (j == c.length) { | ||||
// all paramteters matched | |||||
if (found == true) { | |||||
// all parameters matched | |||||
if (found) { | |||||
throw new MethodException(this, | throw new MethodException(this, | ||||
"Could not uniquely identify " + getMethodName | "Could not uniquely identify " + getMethodName | ||||
+ "-method"); | + "-method"); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (found != true) { | |||||
if (!found) { | |||||
throw new MethodException(this, | throw new MethodException(this, | ||||
"Could not find " + getMethodName + "-method"); | "Could not find " + getMethodName + "-method"); | ||||
} | } | ||||
if (j == c.length) { | if (j == c.length) { | ||||
// all parameters match | // all parameters match | ||||
if (found == true) { | |||||
if (found) { | |||||
throw new MethodException(this, | throw new MethodException(this, | ||||
"Could not identify unique " + setMethodName | "Could not identify unique " + setMethodName | ||||
+ "-method"); | + "-method"); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (found != true) { | |||||
if (!found) { | |||||
throw new MethodException(this, | throw new MethodException(this, | ||||
"Could not identify " + setMethodName + "-method"); | "Could not identify " + setMethodName + "-method"); | ||||
} | } |
@Override | @Override | ||||
public void setMultiSelect(boolean multiSelect) | public void setMultiSelect(boolean multiSelect) | ||||
throws UnsupportedOperationException { | throws UnsupportedOperationException { | ||||
if (multiSelect == true) { | |||||
if (multiSelect) { | |||||
throw new UnsupportedOperationException( | throw new UnsupportedOperationException( | ||||
"Multiselect not supported"); | "Multiselect not supported"); | ||||
} | } | ||||
@Override | @Override | ||||
public void setNewItemsAllowed(boolean allowNewOptions) | public void setNewItemsAllowed(boolean allowNewOptions) | ||||
throws UnsupportedOperationException { | throws UnsupportedOperationException { | ||||
if (allowNewOptions == true) { | |||||
if (allowNewOptions) { | |||||
throw new UnsupportedOperationException( | throw new UnsupportedOperationException( | ||||
"newItemsAllowed not supported"); | "newItemsAllowed not supported"); | ||||
} | } |
@Override | @Override | ||||
public String getJsonPresentation() { | public String getJsonPresentation() { | ||||
return "\"" + name + "\":" + (value == true ? "true" : "false"); | |||||
return "\"" + name + "\":" + (value ? "true" : "false"); | |||||
} | } | ||||
} | } |