ANGULAR GRID
http://www.angulargrid.com/index.html
NG-GRID
http://angular-ui.github.io/ng-grid/
Example on Plunker:
http://plnkr.co/edit/50vJrs?p=preview
UI GRID
http://ui-grid.info/
JQX GRID
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/
Monday, June 29, 2015
Sunday, June 28, 2015
Friday, June 26, 2015
Sunday, June 21, 2015
Friday, June 19, 2015
GWT - ListBox with Enum vs ValueListBox implementation example
public class EnumListBoxEditor<T extends Enum<T>> implements IsWidget, LeafValueEditor<T> { private ListBox listBox; private Class<T> enumType; public EnumListBoxEditor(Class<T> tClass) { listBox = new ListBox(); this.enumType = tClass; for(T e : enumType.getEnumConstants()) { listBox.addItem(e.name()); } } @Override public Widget asWidget() { return listBox; } @Override public void setValue(T language) { listBox.setSelectedIndex(language.ordinal()); } @Override public T getValue() { int index = listBox.getSelectedIndex(); T result = null; for (T e : enumType.getEnumConstants()) { String itemName = listBox.getValue(index); if (e.name().equals(itemName)) { result = e; } } return result; } public void setEnabled(boolean isEnabled){ listBox.setEnabled(isEnabled); } }
Thus this approach is acceptable the best way to use ListBox with any Enum or bean that implement HasLabel interface is ValueListBox component e.g.:
@UiField(provided = true) ValueListBox<TeamDTO> team;
this.team = new ValueListBox<TeamDTO>(new HasLabelRenderer<TeamDTO>(), new IdentityProvidesKey<TeamDTO>());
public class HasLabelRenderer<T extends HasLabel> extends AbstractRenderer<T>{ @Override public String render(HasLabel object) { return object == null ? "" : object.getLabel(); } }
public class IdentityProvidesKey<T extends Identity> implements ProvidesKey<T> { @Override public Object getKey(T item) { return item == null ? null: item.getId(); } }
Thursday, June 18, 2015
JAVA - example of use in overrided method generic type of class that extends interface
public class HasLabelRenderer<T extends HasLabel> extends AbstractRenderer<T>{ @Override public String render(HasLabel object) { return object == null ? "" : object.getLabel(); } }
This approach is possible due to the fact that in generics e.g. Bounded Type Parameter the type can be of the upper type it is extended. For instance, in example above the type T in HasLabelRenderer<T extends HasLabel> can be of type HasLabel interface.
Thursday, June 11, 2015
Subscribe to:
Posts (Atom)
