My GWT app will have 4 – 5 different views but each one will have 2 similar buttons on the bottom of the view. The function of these buttons will vary between each view but their appeararnce/position will remain the same. Is there any design strategy that I could apply in this case? Could I go down the road of having a base panel class that adds the buttons and each extending class then implements the different functionality or is there a better way to do it?
Share
Create a composite widget BottomToolbar consisting of a panel with two buttons. Add two methods to this widget:
setLeftButtonHandler(ClickHandler handler)andsetRightButtonHandler(ClickHandler handler).When you add this widget to the view, your Controller/Activity/Presenter (whatever you use) only needs to set these handlers.