* @throws ClassCastException if the specified object's type prevents it
* from being compared to this Object.
*/
public int compareTo(Object o) {
Layout oLayout = (Layout) o;
LayoutsManager layoutsManager = UIServices.lookup().getLayoutsManager();
if (layoutsManager.isBaseElement(this) && !layoutsManager.isBaseElement(oLayout))
return Integer.MIN_VALUE;
if (!layoutsManager.isBaseElement(this) && layoutsManager.isBaseElement(oLayout))
return Integer.MAX_VALUE;
if (this.getWorkspaceId() != null && oLayout.getWorkspaceId() != null) {
if (this.getWorkspaceId().equals(oLayout.getWorkspaceId())) {
return this.getId().compareTo(oLayout.getId());