With Robotlegs, when you ask "can...?" then in general the
answer is "yes": its flexibility allows you to do almost anything
with little to no modification. However, following best practices
is another thing. :)
The main role of the Mediator in Robotlegs is to separate
application communication from the view implementation. It passes
messages (events, signals) from the view component to the rest of
the app and vice versa. This allows the view to become independent
from the app, increasing reusability! So, to answer your question:
a "getMediator" method doesn't make sense, because a view shouldn't
know about what manages it. Here's a nice article by Stray about
small and focused Mediators: http://www.xxcoder.net/my-mailman-doesnt-open-my-mail
(and an interesting discussion in the comments as well!)
Regarding view instantiation and adding it to the stage: a
pattern that I started to like is creating a Mediator for the
context view. This Mediator can listen to the correct application
events and create and add the views to the stage (and later remove
them) when necessary. This, to me, feels more logical than doing
that work from a Command, since Commands belong to the Controller
tier. 2 notes about a "ContextViewMediator":
You can use mediatorMap.mapView(contextView,
ContextViewMediator); to map the view to its Mediator.
Always map the context view last, because its
onRegister method will be called immediately.
I hope this has given you a push in the right direction.
Definitely come back if you have more questions!