if (!(container instanceof HasStatesPanels)) throw new IllegalStateException("Container " + container + " at place " + where + " does not implements HasStatesPanels, so it can not change states");
HasStatesPanels panels = (HasStatesPanels)container;
// TODO: check if it is already in this state
Pluggable plug = panels.getViewFor(state);
plug.changeState(state);
layout.plug(where, plug);
}
}
public void plug(Place where, Pluggable what) {
if (currentBuilder == null) throw new IllegalStateException("Current layout builder is null, so I can not plug widgets");