samedi 26 août 2017

Tab building logic in Firefox like application

I am building GUI application. My application (Shell) looks like Firefox - there are tabs and there are different components inside each tab. My components are window, modules, layout and etc and they include small elements like buttons, text fields etc. Besides these components I inject using CDI.

My problem is that I can't understand where I should put logic of building such tab. For example I have tab that shows application settings. Fist my attempt was

public class SettingsTab{

  @Inject
  private Window window; 

  @Inject
  private FooLayout layout; 

  @Inject
  private ModuleA moduleA;

  @Inject
  private ModuleB moduleB;
  ....
}

And after that I did

Shell.add(settingsTab);

But this code seems a little bit strange to me. Maybe such logic must be put in some like *Builder or *Manager. Where is such logic put in GUI applications?

Aucun commentaire:

Enregistrer un commentaire