class TimeAmountEditor implements IsWidget {

    public void init(final TimeAmount ta, Command onChangeCommand) {
        this.onChangeCommand = onChangeCommand;
        this.timeAmount = ta != null ? ta : new TimeAmount();

        view.setQuantity(timeAmount.getQuantity());
        view.clearIntervalTypeSelector();
        for (int i=0; i< INTERVAL_TYPES.size(); i++) {
            DateIntervalType type = INTERVAL_TYPES.get(i);
            view.addIntervalTypeItem(type);
            if (timeAmount != null && timeAmount.getType().equals(type)) {
                view.setSelectedTypeIndex(i);
            }
        }
    }

    @Inject public  TimeAmountEditor(View view);

}