randomNotes

  • presenter manage all the interaction of the user with the view and define how the view should be rendered

  • the business logic specifically for the view is defined in its concrete implementation

  • The presenter is very important in order to start all the process in order to see the dialog

  • from a presenter you can bind the action delegate with the properly methods defined in the view implementation

  • Inside the view implementation is necessary define the interface UI binder related to the specific xml layout for the dialog

  • inside the view impl the action when user click on "ok" or "close" are managed by the ActionDelegate class with its methods onOkClicked and onCancelClicked

  • Important hierarchy

  • everything starts with the extension
    • setting up its name
    • defining the label of the group in the main menu of che
    • it allow the ActionManager to register the actions that we need in our development // action are associated to a particular behavior defined by view implementation
  • second important thing is the Action implementation class
    • it extends BaseAction
    • in its constructor we can set the title of the action in the group on the main menu toolbar
    • there is an actionPerformed method that call the method defined by the presenter
    • update method and setBrightsideExtension are to discuss later
  • third part is the presenter
    • in its constructor we put some contents: the interface View, AppContext and so on
    • the presenter implements the ActionDelegate inner interface defined in the View interface, so we need to implement the methods onOkClicked and onCancelClicked (we usually use specific methods provided by the view interface)
    • from the presenter is possible manage some commands to execute something.
  • fourth part is relative to the View interface
    • it extends its inner interface i.e. public interface HelloWorldView extends View
    • there are the signs about specific methods (i.e. showDialog() and pippo())
    • The inner interface ActionDelegate contains two methods activated when user perform some operations on the dialog window (ok or close dialog)
    • last part is the view implementation and its UI binder
    • for a dialog the class extends Window and implement its interface parent
    • If you define an object in the xml layout here you need to retreive it with the correct annotation --> @UiField TextBox memberField;
    • In its constructor we define first of all the name of the dialog
    • there is also a method AddFooterButton that is used to attach a button on the footer of the dialog. It return a Button object. In its click handler we call a method of the delegate class (ActionDelegate - the inner interface of the View class)
    • THE IMPORTANT THING IS TO ATTACH THE XML TO THE VIEW IMPL USING THE METHOD createAndBindUi() that returns a Widget component that is settled in the Window instance (remember that the view impl extends Window class!)
    • Also is necessary implement the view methods (for the showDialog method we can simply call the window method show())
    • Also we need an Interface that exteds UiBinder map that it requires the Widget object and the view impl. i.e. interface HelloWorldViewImplUiBinder extends UiBinder {}
    • last part is relative to the xml layout
    • there is a main root tag and inside of it we define:
      • styling --> using
      • DockLayoutPanel
      • FlowPanel
      • Specific objects (label, textbox etc)