Fixed setViewedComponent instead of addAndMakeVisible when generating code for Viewport