Skip to Content
avatar image
Former Member

Compile-time check identification of view elements

Hi all,

i've posted this as a reply to another post already, i post it again here.

I think, it would be a good idea to generate an (maybe inner) interface class for each view controller which could be used to identify the view elements, which where created at design time (of course this is not possible for the elements added at runtime). This would increase the maintainability of code significantly.

For example, if i create a view "WorkView" which contains a button "ExitButton" and a checkbox "AdvancedSearch", the framework could generate an interface "IViewElementsWorkView" or inner interface "IPrivateWorkView.IViewElements", containing something like:

public final static String EXIT_BUTTON_ID = "ExitButton";

public final static String ADVANCED_SEARCH_ID = "AdvancedSearch";

...

Then, in the wdDoModifyView method, i could do something like:

if (firstTime) {

IWDButton exitButton = (IWDButton) view.getElement(IViewElementsWorkView.EXIT_BUTTON_ID);

IWDCheckBox advSearch = (IWDCheckBox) view.getElement(IViewElementsWorkView.ADVANCED_SEARCH_ID );

}

The compiler will then be able to check, if a view element has been removed or renamed, just like it's possible using the component's messages by the IMessageXXX class. This would be helpful regardless the fact, that the view elements could have been removed or destroyed at runtime.

Best regards,

Stefan

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Mar 04, 2004 at 02:18 PM

    Hi Stefan,

    I already sent this to some people within the team. I'll come back to you as soon as we have an answer.

    At this opportunity: Thanks for all your activities within this forum!

    Karin

    Add comment
    10|10000 characters needed characters exceeded