@Inject public FilterViewImpl() { // Setting the Range for the Sliders lengthSlider = new RangeSlider(); lengthSlider.setMin(Boundaries.MIN_LENGTH); lengthSlider.setMax(Boundaries.MAX_LENGTH); lengthSlider.setWidth("70%"); lengthSlider.setValue(new Range(Boundaries.MIN_LENGTH, Boundaries.MAX_LENGTH)); yearSlider = new RangeSlider(); yearSlider.setWidth("70%"); yearSlider.setMin(Boundaries.MIN_YEAR); yearSlider.setMax(Boundaries.MAX_YEAR); yearSlider.setValue(new Range(Boundaries.MIN_YEAR, Boundaries.MAX_YEAR)); initWidget(uiBinder.createAndBindUi(this)); collapseBox.setIn(true); // Setting Up Listening for Enter Pressed Events to start the search focusPanel.addKeyDownHandler( new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { filterPresenter.onSearch(); } } }); }
@Override public int getYearEnd() { return (int) yearSlider.getValue().getMaxValue(); }
@Override public int getYearStart() { return (int) yearSlider.getValue().getMinValue(); }
@Override public void setYearSlider(int startYear, int endYear) { yearSlider.setValue(new Range(startYear, endYear)); }
@Override public int getLengthEnd() { return (int) lengthSlider.getValue().getMaxValue(); }
@Override public int getLengthStart() { return (int) lengthSlider.getValue().getMinValue(); }
@Override public void setLengthSlider(int startLength, int endLength) { lengthSlider.setValue(new Range(startLength, endLength)); }