Created
November 24, 2015 18:57
-
-
Save slugmandrew/32d7ea2b6a39b57b313a to your computer and use it in GitHub Desktop.
GWT Custom CellList Resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cellListSelectedItem { | |
background: #f2f2f2; | |
color: inherit; | |
} | |
.cellListKeyboardSelectedItem { | |
background: #f2f2f2; | |
color: inherit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.utilitiessavings.usavappv7.client.resources; | |
import com.google.gwt.core.shared.GWT; | |
import com.google.gwt.user.cellview.client.CellList; | |
import com.google.gwt.user.cellview.client.CellList.Resources; | |
public interface MyCellListResources extends Resources | |
{ | |
public static final MyCellListResources INSTANCE = GWT.create(MyCellListResources.class); | |
@Source(value = { CellList.Style.DEFAULT_CSS, "CellListStyle.css" }) | |
CellList.Style cellListStyle(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@UiField(provided = true) | |
CellList<OfferDto> list; | |
private ListDataProvider<OfferDto> dataProvider = new ListDataProvider<>(); | |
private MultiSelectionModel<OfferDto> selectionModel = new MultiSelectionModel<>(OfferDto.KEY_PROVIDER); | |
// snip | |
list = new CellList<>(cell, MyCellListResources.INSTANCE, OfferDto.KEY_PROVIDER); | |
list.setSelectionModel(selectionModel); | |
dataProvider.addDataDisplay(list); | |
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() | |
{ | |
@Override | |
public void onSelectionChange(SelectionChangeEvent event) | |
{ | |
setSelectedTariffs(getOffersSelected().size()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here you can see the two instances of the same generated class name: