Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerticalAlignment and Alignment ambiguity confuses UiBinder #1

Open
GoogleCodeExporter opened this issue Dec 23, 2015 · 2 comments
Open

Comments

@GoogleCodeExporter
Copy link

SmartGWT Canvas and layout overloads set vertical and horizontal alignment 
methods, which causes GWT compiler to complain "ambiguous method specified".

e.g.,
setLayoutAlign(Alignment) is for horiz align.
setLayoutAlign(VerticalAlignment) is for vert align.

However, in our uibinder nodes, when we declare
<z:UICanvas layoutAlignment='TOP' ..../>

GWT compiler is confused and complains "ambiguous method specified" because it 
does not know which method overload to use.

Proposed Solution
=================
Therefore, the following solution is proposed.
There will be two new interfaces:

[code]
package org.synthful.smartgwt.client;

import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.VerticalAlignment;

public interface HasUICanvasAlign {
    void setLayoutHAlign(Alignment alignment);
    void setLayoutVAlign(VerticalAlignment alignment);
}


package org.synthful.smartgwt.client;

import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.VerticalAlignment;

public interface HasUILayoutAlign
extends HasUICanvasAlign{
    void setDefaultLayoutHAlign(Alignment alignment);
    void setDefaultLayoutVAlign(VerticalAlignment alignment);
}
[/code]

All non-layout canvas wrappers should implement HasUICanvasAlign in the 
following manner:

[code]
@Override
public void setLayoutHAlign(Alignment alignment) {
  super.setLayoutAlign(alignment);
}

@Override
public void setLayoutVAlign(VerticalAlignment alignment) {
  super.setLayoutAlign(alignment);
}
[/code]

All layout canvas wrappers should implement HasUILayoutAlign in the following 
manner:

[code]
@Override
public void setDefaultLayoutHAlign(Alignment alignment){
  super.setDefaultLayoutAlign(alignment);
}

@Override
public void setDefaultLayoutVAlign(VerticalAlignment alignment){
  super.setDefaultLayoutAlign(alignment);
}

@Override
public void setLayoutHAlign(Alignment alignment) {
  super.setLayoutAlign(alignment);
}

@Override
public void setLayoutVAlign(VerticalAlignment alignment) {
  super.setLayoutAlign(alignment);
}
[/code]

Original issue reported on code.google.com by BlessedGeek on 18 Jun 2010 at 5:42

@GoogleCodeExporter
Copy link
Author

I have the same problem too.

[ERROR] Ambiguous setter requested: UISpinnerItem.min

When I try to use setMin or setMax, I got the above error.


Original comment by [email protected] on 14 Aug 2012 at 3:00

@GoogleCodeExporter
Copy link
Author

Have you any fix for this issue??????

Original comment by [email protected] on 14 Aug 2012 at 3:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant