Skip to main content
Jesper Ronnholm
Associate III
January 11, 2019
Question

Is it possible to write code that will be generated along with new classes?

  • January 11, 2019
  • 1 reply
  • 621 views

When coupling the view and presenter classes with third-party, low-level code, you currently need to write new functions on every new class generated by the designer.

I'm not sure if it's possible through ATs, but is it possible to add those functions any other way so that the designer will add my code to every newly generated view class?

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
January 11, 2019

Hi @Jesper Rönnholm​,

There's currently no way to do what you're asking: To append pre-written code to generated classes. Have you considered creating a base-view/presenter from which all these views that share common functionality inherit?

Best regards,

Martin

Jesper Ronnholm
Associate III
January 11, 2019

Yes, that was actually the original idea.

We tried to access the "handleKeyEvent" method in the ScreenViewBase class, but it's only defined if the screen in question actually have any interactions with the "Hardware button is clicked"-trigger.

Again, this is ultimately about abusing the "handleKeyEvent" to generate events in the designer. :grinning_face_with_sweat:

-Jesper