This file contains hidden or 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
table.addCellPreviewHandler(new CellPreviewEvent.Handler<Document>() { | |
@Override | |
public void onCellPreview(CellPreviewEvent<Document> event) { | |
if (BrowserEvents.MOUSEOVER.equals(event.getNativeEvent().getType())) { | |
overDocument = event.getValue(); | |
} | |
} | |
}); | |
table.addAttachHandler(new Handler() { |
This file contains hidden or 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
@Override | |
public void onNavigation(NavigationEvent event) { | |
String nameToken = event.getRequest().getNameToken(); | |
getView().setActive(nameToken); | |
} | |
@Override | |
public void setActive(String nameToken) { | |
$("a", container).toggleClass(res.styles().menuActive(), false); |
This file contains hidden or 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
@Given("^I try to access the (\\S+) page$") | |
public void iNavigateTo(String nameToken) { | |
String url = baseUrl + "#" + nameToken; | |
webDriver.get(url); | |
new WebDriverWait(webDriver, TRY_TIME_OUT_IN_SECONDS); | |
} | |
@Then("^I see the login screen$") | |
public void i_see_the_login_screen() { | |
applicationPage.waitForLoginScreen(); |
This file contains hidden or 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
public class RatingColumnInitializer implements ColumnInitializer<RatingDto> { | |
@Override | |
public void initializeColumns(CellTable<RatingDto> table) { | |
initIdColumn(table); | |
initCarColumn(table); | |
initRatingColumn(table); | |
} | |
private void initIdColumn(CellTable<RatingDto> table) { | |
Column<RatingDto, Number> idColumn = new Column<RatingDto, Number>(new NumberCell()) { |
This file contains hidden or 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
@ColumnsDefinition(definitionFor = RatingDto.class) | |
public interface RatingColumnsDefinition extends ColumnInitializer<RatingDto> { | |
@Column(cellType = NumberCell.class, cellReturnType = Number.class, headerName = "ID") | |
String getId(); | |
@Column(cellType = TextCell.class, cellReturnType = String.class, headerName = "Car") | |
String toString(); | |
@Column(cellType = NumberCell.class, cellReturnType = Number.class, headerName = "Rating") | |
String getRating(); |
This file contains hidden or 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
public abstract class AbstractVelocityGenerator { | |
private final static String IMPL_NAME = "implName"; | |
private final static String PACKAGE_NAME = "packageName"; | |
private final static String ENCODING = "UTF-8"; | |
private final Provider<VelocityContext> velocityContextProvider; | |
private final VelocityEngine velocityEngine; | |
private final GeneratorUtil generatorUtil; | |
protected AbstractVelocityGenerator(Provider<VelocityContext> velocityContextProvider, |
This file contains hidden or 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
public class ColumnsInitializerGenerator extends Generator { | |
private MortalLogger logger; | |
private JClassType type; | |
private Injector injector; | |
@Override | |
public String generate(TreeLogger treeLogger, | |
GeneratorContext generatorContext, | |
String typeName) throws UnableToCompleteException { | |
logger = new MortalLogger(treeLogger); |
This file contains hidden or 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
<generate-with class="com.gwtplatform.carstore.rebind.ColumnsInitializerGenerator"> | |
<when-type-assignable class="com.gwtplatform.carstore.client.application.rating.ui.ColumnsDefinition"/> | |
</generate-with> |
This file contains hidden or 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
private void initRatingGrid() { | |
ratingGrid = new CellTable<RatingDto>(); | |
ratingGrid.setSelectionModel(new NoSelectionModel<RatingDto>()); | |
ratingColumnInitializer.initializeColumns(ratingGrid); | |
initActionColumns(); | |
} |
This file contains hidden or 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
#macro(initColumns $columnsInitializerDefinitions) | |
#foreach (${type} in ${columnsInitializerDefinitions.getColumns()}) | |
#set($dtoCanonicalName = ${columnsInitializerDefinitions.getDtoCanonicalName()}) | |
#set($returnCellCanonicalName = ${type.getReturnCellCanonicalName()}) | |
private void init${type.getMethodCapitalizedName()}Column(CellTable<${dtoCanonicalName}> table) { | |
Column<${dtoCanonicalName}, ${returnCellCanonicalName}> column | |
= new Column<${dtoCanonicalName}, ${returnCellCanonicalName}>(new ${type.getCellCanonicalName()}()) { | |
@Override | |
public ${returnCellCanonicalName} getValue(${dtoCanonicalName} object) { |
NewerOlder