{"id":192262,"date":"2013-09-02T20:02:03","date_gmt":"2013-09-02T16:02:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=192262"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=192262","title":{"rendered":"<span class=\"post_title\">GWT-Platform \u043e\u0441\u043d\u043e\u0432\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430\u043c\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u0441\u0435\u043c \u0445\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u044f\u043c \u0434\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a!<\/p>\n<p>  \u042f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 Java-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0438 \u0442\u0430\u043a \u0443\u0436 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0432\u043e\u044e \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 GWT. \u041d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0442\u0435\u043c\u0443 GWT, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 GWT-Platform. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/code.google.com\/p\/gwt-platform\/\"> \u0442\u0443\u0442<\/a>, \u0430 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0434\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u0414\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u0431\u044b \u043e\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u043d\u0430\u0432\u0431\u0430\u0440\u0435, \u0442\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043b\u0435\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u043f\u0440\u0430\u0432\u0430\u044f \u0441 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0435\u0432\u0430\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0438\u043c\u0435\u043d\u0438 \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u0438. \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0430\u0432\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/2cc\/c1c\/a1b\/2ccc1ca1bc7dc3f57f8b9b03a98e05eb.jpg\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/19e\/7f1\/a14\/19e7f1a1435e13a58e607dc582798fcf.jpg\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/574\/e97\/f58\/574e97f5848208f74a5d7ff8843d383c.jpg\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/dd3\/59e\/017\/dd359e0173deb162124db389a53aa0e5.jpg\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c GWT \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 IDE. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GWTP \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438: guice-2.0.jar, guice-3.0.jar, gwtp-all-1.0.jar, aopalliance.jar, guice-assistedinject-3.0.jar. \u0422\u0430\u043a\u0436\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b gwt-bootstrap-2.2.2.0-SNAPSHOT.jar \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u201c\u043a\u0440\u0430\u0441\u043e\u0442\u044b\u201d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/4d0\/a37\/5c2\/4d0a375c22676bbf80f5b0372d77b73d.jpg\"\/><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 Eclipse gwt-platform \u043f\u043b\u0430\u0433\u0438\u043d. \u041e\u043d \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0436\u0438\u0437\u043d\u044c. \u0421 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0442\u0430\u043a \u0438 \u0441\u0432\u044f\u0437\u043a\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u044c\u044e. \u041a\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"http:\/\/plugin.gwt-platform.googlecode.com\/hg\/update\">plugin.gwt-platform.googlecode.com\/hg\/update<\/a><\/p>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c:<br \/>  \u041d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0438 Ginjector. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438: <br \/>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 configure () \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0438\u043d\u0434\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0438\u0445 \u0432\u044c\u044e.   <\/p>\n<pre><code class=\"java\">public class ClientModule extends AbstractPresenterModule {  \t@Override \tprotected void configure() { \t\tinstall(new DefaultModule(ClientPlaceManager.class));                            bindPresenter(MainPagePresenter.class, MainPagePresenter.MyView.class, \t\t\t\tMainPageView.class, MainPagePresenter.MyProxy.class);  \t\tbindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.main); \t} } <\/code><\/pre>\n<pre><code class=\"java\">         @GinModules({ DispatchAsyncModule.class, ClientModule.class })          public interface ClientGinjector extends Ginjector {  \tEventBus getEventBus();  \tPlaceManager getPlaceManager();  \tProvider&lt;MainPagePresenter&gt; getMainPagePresenter(); } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0448\u0430 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430: \u0422\u0443\u0442 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043d\u0430\u0448\u0435\u043c\u0443 placemanager \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (place). \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0431\u044b\u043b \u0432\u0432\u0435\u0434\u0435\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u043e\u043a\u0435\u043d, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 place, \u0442\u043e \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0435\u043c \u0442\u0443\u0434\u0430. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f. (\u0417\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 GateKeeper). <\/p>\n<pre><code class=\"java\">public class HabraTest implements EntryPoint {  \tprivate final ClientGinjector ginjector = GWT.create(ClientGinjector.class);  \t@Override \tpublic void onModuleLoad() { \t\tDelayedBindRegistry.bind(ginjector);\t \t\tginjector.getPlaceManager().revealCurrentPlace(); \t} } <\/code><\/pre>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u0437\u0430\u043e\u0441\u0442\u0440\u044f\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 place. \u041d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e GWT. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/habrahabr.ru\/post\/113121\/\"> \u044d\u0442\u0430<\/a>.<\/p>\n<p>  \u042f \u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 GWT \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f place (\u0442\u043e\u0447\u043d\u0435\u0435 \u0441 \u043e\u0434\u043d\u0438\u043c place).<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: <\/p>\n<pre><code class=\"java\">public class MainPagePresenter extends \tPresenter&lt;MainPagePresenter.MyView, MainPagePresenter.MyProxy&gt; implements MainPageUiHandlers, FirstPageEvent.Handler{  \tpublic interface MyView extends View, HasUiHandlers&lt;MainPageUiHandlers&gt; { \t} \t \t\/\/ \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u043b\u043e\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430 \tpublic final static Object SLOT_FIRST_PAGE =  new Object(); \tpublic final static Object SLOT_SECOND_PAGE =  new Object(); \t \t\/\/\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435  \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b \tprivate FirstPagePresenter firstPagePresenter; \tprivate SecondPagePresenter secondPagePresenter;\t  \t@ProxyStandard \t@NameToken(NameTokens.main) \tpublic interface MyProxy extends ProxyPlace&lt;MainPagePresenter&gt; { \t}  \tprivate EventBus eventBus; \tprivate final PlaceManager placeManager;  \t\/\/ \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b \t@Inject \tpublic MainPagePresenter(final EventBus eventBus, final MyView view,  \t\t\tFirstPagePresenter firstPagePresenter, \t\t\tSecondPagePresenter secondPagePresenter, \t\t\tfinal MyProxy proxy, final PlaceManager placeManager) { \t\tsuper(eventBus, view, proxy); \t\tthis.placeManager = placeManager; \t\tthis.firstPagePresenter =  firstPagePresenter; \t\tthis.secondPagePresenter =  secondPagePresenter; \t\tthis.eventBus =  eventBus; \t\t\/\/ \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0441\u0435\u0431\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0439  \u0432\u044c\u044e \t\tgetView().setUiHandlers(this); \t\teventBus.addHandler(FirstPageEvent.getType(), this); \t}  \t\/\/ \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u043c \u0441\u0435\u0431\u044f \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t@Override \tprotected void revealInParent() { \t\tRevealRootContentEvent.fire(this, this); \t}  \t@Override \tprotected void onBind() { \t\tsuper.onBind(); \t\t\/\/ \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e  \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \t\tgetView().setInSlot(SLOT_FIRST_PAGE, firstPagePresenter);\t \t}  \t\/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043b\u0435\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 MainPageView \t@Override \tpublic void onRightBtnClicked() { \t\tshowRightContent(); \t\tMainPageEvent mainPageEvent =  new MainPageEvent( MainPageEvent.Action.SHOW_LOREM_IPSUM); \t\teventBus.fireEvent(mainPageEvent);\t \t} \t\/\/ \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043f\u0440\u0430\u0432\u043e\u0439 \t@Override \tpublic void onLeftBtnClicked() { \t\tshowLeftContent(); \t\t \t}\t \t \tpublic void showLeftContent() { \t\tremoveFromSlot(SLOT_SECOND_PAGE, secondPagePresenter); \t\tgetView().setInSlot(SLOT_FIRST_PAGE, firstPagePresenter);\t\t \t}  \tpublic void showRightContent() { \t\tremoveFromSlot(SLOT_FIRST_PAGE, firstPagePresenter); \t\tgetView().setInSlot(SLOT_SECOND_PAGE, secondPagePresenter);\t \t}  \t@Override \tpublic void onFirstPageEvent(FirstPageEvent event) { \t\t\/\/ \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043b\u0435\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0435\u0440\u0435\u0437 \u044d\u0432\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044e \t\tshowRightContent(); \t\tMainPageEvent mainPageEvent =  new MainPageEvent( MainPageEvent.Action.SHOW_FORM_RESULT, event.getFirstName(),                          event.getLastName());     \t\teventBus.fireEvent(mainPageEvent); \t \t}\t } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 FirstPagePresenter firstPagePresenter, SecondPagePresenter secondPagePresenter.<br \/>  \u042d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 presenter \u2014 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043b\u0435\u0432\u0443\u044e \u0438 \u043f\u0440\u0430\u0432\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b);<\/p>\n<p>  \u0412 GWTP \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432:  <\/p>\n<ul>\n<li>\u041f\u0435\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0435\u0449\u0435 \u0438 place <\/li>\n<li>\u041f\u0435\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b-\u0432\u0438\u0434\u0436\u0435\u0442\u044b(PresenterWidget) <\/li>\n<li>\u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b-\u0432\u0438\u0434\u0436\u0435\u0442\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0431\u043e\u0439 Popup \u043e\u043a\u043d\u043e<\/li>\n<\/ul>\n<p>  Presenter-place \u0438\u0441\u043f\u0443\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b\u0435 \u0432 \u0430\u0434\u0440\u0435\u0441\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. <br \/>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0439 \u0442\u043e\u043a\u0435\u043d \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0443.<br \/>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043c\u0435\u043d\u044b \u00ab\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u00bb \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u043b\u043e\u0442\u043e\u0432 \u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u043b\u043e\u0442\u044b.<br \/>  \u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u043e\u043c. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 instance.<br \/>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u043b\u043e\u0442\u043e\u0432 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u043e\u0442\u044b \u0432 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435 \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 setInSlot() \u0432\u043e \u0432\u044c\u044e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430.<\/p>\n<p>  \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 MainPagePresenter \u0432\u0438\u0434\u043d\u043e \u0447\u0442\u043e \u0441\u043b\u043e\u0442 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e Object:<\/p>\n<pre><code class=\"java\">\tpublic final static Object SLOT_FIRST_PAGE =  new Object(); \tpublic final static Object SLOT_SECOND_PAGE =  new Object(); <\/code><\/pre>\n<p>  \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0432\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432 \u0432 \u0441\u043b\u043e\u0442:<\/p>\n<pre><code class=\"java\">public class MainPageView extends ViewWithUiHandlers&lt;MainPageUiHandlers&gt; implements MainPagePresenter.MyView {  \t\/\/ \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t@UiField HTMLPanel main; \t\/\/ \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u0430\u043d\u0435\u043b\u044c \t@UiField ResponsiveNavbar navbar;  \t\/\/ \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \t@UiField Button firstPageBtn, secondPageBtn; \t\t \tprivate static MainPageViewUiBinder uiBinder = GWT \t\t\t.create(MainPageViewUiBinder.class);  \tinterface MainPageViewUiBinder extends UiBinder&lt;Widget, MainPageView&gt; { \t}  \t\/\/ \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430  \t@UiField Column leftColumn, rightColumn;  \t@Inject \tpublic MainPageView() {\t \t\tuiBinder.createAndBindUi(this); \t\tnavbar.setInverse(true); \t\t\/\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043e\u043a  \t\tfirstPageBtn.addClickHandler(new  ClickHandler() {\t\t \t\t\t@Override \t\t\tpublic void onClick(ClickEvent event) { \t\t\t\tgetUiHandlers().onLeftBtnClicked();\t\t \t\t\t} \t\t}); \t\t \t\tsecondPageBtn.addClickHandler(new  ClickHandler() {\t\t \t\t\t@Override \t\t\tpublic void onClick(ClickEvent event) { \t\t\t\tgetUiHandlers().onRightBtnClicked();\t\t \t\t\t} \t\t});\t\t\t \t}  \t@Override \tpublic Widget asWidget() { \t\treturn main; \t} \t \t\/\/ \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432 \u0432 \u0441\u043b\u043e\u0442 \t@Override \tpublic void setInSlot(Object slot, IsWidget content) { \t\tif(slot == MainPagePresenter.SLOT_FIRST_PAGE ) { \t\t\tleftColumn.add(content); \t\t} \t\telse if(slot == MainPagePresenter.SLOT_SECOND_PAGE ){ \t\t\trightColumn.add(content); \t\t} \t\telse { \t\t\tsuper.setInSlot(slot, content); \t\t}\t\t \t} \t \t\/\/ \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u043b\u043e\u0442\u0430 \t@Override \tpublic void removeFromSlot(Object slot, IsWidget content) { \t\tif(slot == MainPagePresenter.SLOT_FIRST_PAGE ) { \t\t\tleftColumn.remove(content); \t\t} \t\telse if(slot == MainPagePresenter.SLOT_SECOND_PAGE ){ \t\t\trightColumn.remove(content); \t\t} \t\telse { \t\t\tsuper.removeFromSlot(slot, content); \t\t}\t \t} } <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: setInSlot() \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0435\u043c\u0443 \u0441\u043b\u043e\u0442.<br \/>  \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u043a\u043e\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0434\u0432\u0435 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u043e\u0432\u0441\u043a\u0438\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 leftColumn \u0438 rightColumn.<br \/>  \u0425\u043e\u0442\u044f \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044e\u0441\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043c\u0435\u0441\u0442\u043d\u0435\u0439 \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u043b\u043e\u043d\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043f\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0438 \u0438\u0445 \u0432\u044c\u044e:<\/p>\n<pre><code class=\"java\">public class FirstPagePresenter extends \t\tPresenterWidget&lt;FirstPagePresenter.MyView&gt; implements FirstPageUiHandlers, PopupEvent.Handler{  \tpublic interface MyView extends View, HasUiHandlers&lt;FirstPageUiHandlers&gt; { \t}  \t\/\/ \u043f\u043e\u043f\u0430\u043f \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \tFirstPagePopupPresenter firstPagePopupPresenter; \tEventBus eventBus; \t \t@Inject \tpublic FirstPagePresenter(final EventBus eventBus, final MyView view, \t\t\tFirstPagePopupPresenter firstPagePopupPresenter ) { \t\tsuper(eventBus, view); \t\tthis.firstPagePopupPresenter =  firstPagePopupPresenter; \t\tthis.eventBus =  eventBus; \t\tgetView().setUiHandlers(this); \t\t\/\/ \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0441\u0435\u0431\u044f \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u043e\u043c PopupEvent \t\teventBus.addHandler(PopupEvent.getType(), this); \t}  \t@Override \tpublic void onShowFormBtnClicked() { \t\t\/\/ \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \t\tshowForm(true);\t\t \t}  \tprivate void showForm(boolean show) { \t\tif(show){ \t\taddToPopupSlot(firstPagePopupPresenter, true); \t\tfirstPagePopupPresenter.getView().show(); \t\t} \t\telse { \t\t\tremoveFromPopupSlot(firstPagePopupPresenter); \t\t}\t\t \t}  \t@Override \tpublic void onPopupEvent(PopupEvent event) { \t\tshowForm(false); \t\teventBus.fireEvent(new FirstPageEvent(event.getFirstName(), event.getLastName()));\t\t \t} } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u044f \u0437\u0430\u0438\u043d\u0436\u0435\u043a\u0442\u0438\u043b \u043d\u0435\u043a\u0438\u0439 FirstPagePopupPresenter firstPagePopupPresenter.(\u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435). \u042d\u0442\u043e \u043d\u0430\u0448\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e \u0441 \u0444\u043e\u0440\u043c\u043e\u0439. \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0438 \u0441 \u043b\u044e\u0431\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e. <\/p>\n<pre><code class=\"java\">public class FirstPageView extends ViewWithUiHandlers&lt;FirstPageUiHandlers&gt; implements \t\tFirstPagePresenter.MyView {  \tprivate final Widget widget; \t@UiField Button showFormBtn;  \tpublic interface Binder extends UiBinder&lt;Widget, FirstPageView&gt; { \t}  \t@Inject \tpublic FirstPageView(final Binder binder) { \t\twidget = binder.createAndBindUi(this); \t\t \t\tshowFormBtn.addClickHandler(new ClickHandler() {\t\t\t \t\t\t@Override \t\t\tpublic void onClick(ClickEvent event) { \t\t\t\tgetUiHandlers().onShowFormBtnClicked();\t\t\t\t \t\t\t} \t\t}); \t}  \t@Override \tpublic Widget asWidget() { \t\treturn widget; \t} } <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u044c\u044e \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 ViewWithUiHandlers. <br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0440\u0443\u0448\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 MVP, \u0442\u043e \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0432\u044c\u044e( \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043c\u043e\u0436\u0435\u043c). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b. \u041e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u044b \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e getUiHandlers().onShowFormBtnClicked();<\/p>\n<pre><code class=\"java\">public interface FirstPageUiHandlers extends UiHandlers{  \tvoid onShowFormBtnClicked(); } <\/code><\/pre>\n<p>  getUiHandlers() \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 FirstPageUiHandlers, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0442\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 \u043d\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MyView \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 HasUiHandlers. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432\u044c\u044e \u2014 getView().setUiHandlers(this); <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u044c\u044e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<\/p>\n<pre><code class=\"java\">public class SecondPagePresenter extends \t\tPresenterWidget&lt;SecondPagePresenter.MyView&gt; implements MainPageEvent.Handler {  \tpublic interface MyView extends View { \t\tvoid showLoremIpsum(); \t\tvoid showFormInfo(String firstName, String lastName); \t} \t \tEventBus eventBus;  \t@Inject \tpublic SecondPagePresenter(final EventBus eventBus, final MyView view) { \t\tsuper(eventBus, view); \t\tthis.eventBus =  eventBus; \t\teventBus.addHandler(MainPageEvent.getType(), this); \t} \t \t@Override \tpublic void onMainPageEvent(MainPageEvent event) { \t\tswitch(event.getAction()) { \t\tcase SHOW_FORM_RESULT: \t\t\tshowFormInfoWidget(event.getFirstName(), event.getLastName()); \t\t\tbreak; \t\tcase SHOW_LOREM_IPSUM: \t\t\tshowLoremIpsumWidget(); \t\t\tbreak; \t\tdefault: \t\t\tbreak;\t\t \t\t}\t\t \t}  \tprivate void showLoremIpsumWidget() { \t\tgetView().showLoremIpsum();\t\t \t}  \tprivate void showFormInfoWidget(String firstName, String lastName) { \t\tgetView().showFormInfo( firstName, lastName);\t\t \t} <\/code><\/pre>\n<pre><code class=\"java\">public class SecondPageView extends ViewImpl implements \t\tSecondPagePresenter.MyView {  \tprivate final Widget widget; \t \t@UiField FlowPanel contentPanel;  \tpublic interface Binder extends UiBinder&lt;Widget, SecondPageView&gt; { \t}  \t@Inject \tpublic SecondPageView(final Binder binder) { \t\twidget = binder.createAndBindUi(this); \t}  \t@Override \tpublic Widget asWidget() { \t\treturn widget; \t}  \t@Override \tpublic void showLoremIpsum() { \t\tcontentPanel.clear(); \t\tcontentPanel.add(new LoremIpsumWidget());\t\t\t\t \t}  \t@Override \tpublic void showFormInfo(String firstName, String lastName) { \t\tcontentPanel.clear(); \t\tcontentPanel.add(new FormInfoWidget(firstName, lastName));\t \t} } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 GWT. \u041e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u044d\u0432\u0435\u043d\u0442\u043e\u0432 ( GwtEvent ). <\/p>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u043f\u0430\u043f \u0441 \u0444\u043e\u0440\u043c\u043e\u0439:<\/p>\n<pre><code class=\"java\">public class FirstPagePopupPresenter extends \t\tPresenterWidget&lt;FirstPagePopupPresenter.MyView&gt; implements PopupUiHandlers {  \tpublic interface MyView extends PopupView , HasUiHandlers&lt;PopupUiHandlers&gt;{ \t}  \tEventBus eventBus; \t \t@Inject \tpublic FirstPagePopupPresenter(final EventBus eventBus, final MyView view) { \t\tsuper(eventBus, view); \t\tthis.eventBus =  eventBus; \t\tgetView().setUiHandlers(this); \t}  \t@Override \tpublic void onSubmitBtnClicked(String firstName, String lastName) { \t\teventBus.fireEvent(new PopupEvent(firstName, lastName));\t\t \t} } <\/code><\/pre>\n<pre><code class=\"java\">public class FirstPagePopupView extends PopupViewWithUiHandlers&lt;PopupUiHandlers&gt; implements \t\tFirstPagePopupPresenter.MyView {  \t@UiField PopupPanel main; \t@UiField Button submitBtn; \t@UiField TextBox firstName, lastName;  \tpublic interface Binder extends UiBinder&lt;Widget, FirstPagePopupView&gt; { \t}  \t@Inject \tpublic FirstPagePopupView(final EventBus eventBus, final Binder binder) { \t\tsuper(eventBus); \t\tbinder.createAndBindUi(this);                            main.setAnimationEnabled(true);                            main.setModal(true);                            main.setGlassEnabled(true);                            submitBtn.addClickHandler(new ClickHandler() { \t\t\t \t\t\t@Override \t\t\tpublic void onClick(ClickEvent event) { \t\t\t\tgetUiHandlers().onSubmitBtnClicked(firstName.getValue(), lastName.getValue());\t\t\t\t \t\t\t} \t\t}); \t}  \t@Override \tpublic Widget asWidget() { \t\treturn main; \t} } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u043e\u043f\u0430\u043f \u0442\u043e\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442\u043e\u043c, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0435\u0433\u043e \u0432\u044c\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c PopupView. \u0418 \u0435\u0449\u0435 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0430\u043d\u0435\u043b\u044c \u0432\u044c\u044e \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e PopupPanel, \u043d\u0443 \u0438\u043b\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u043c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u2014 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043f\u0430\u043f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043b\u043e\u0442 \u0438 \u043f\u0430\u043d\u0435\u043b\u044c \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 addToPopupSlot(); <\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0432\u044f\u0437\u043a\u0430\u0445 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440-\u0432\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d uibinder. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 *ui.xml \u0444\u0430\u0439\u043b\u044b \u044f \u043d\u0435 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e. \u0422\u0430\u043c \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u043b\u044f GWT-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043d\u0435\u0442.<\/p>\n<p>  \u0421\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e <a href=\"http:\/\/timych.no-ip.org\/HabraTest.7z\">\u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443<\/a> <\/p>\n<p>  \u0418 \u0442\u0430\u043a \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0447\u0442\u043e \u0431\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438 \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439:<\/p>\n<p>  \u041f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 MainPagePresenter \u0432 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 onBind() \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u0441\u043b\u043e\u0442 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<\/p>\n<pre><code class=\"java\">\t@Override \tprotected void onBind() { \t\tsuper.onBind(); \t\tgetView().setInSlot(SLOT_FIRST_PAGE, firstPagePresenter);\t \t} <\/code><\/pre>\n<p>  (\u041f\u0440\u043e \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b onBind(), onUnbind, onReveal(), onReset(), onHide() \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.)<\/p>\n<p>  \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043b\u0435\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u0440\u0430\u043d\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044c\u044e FirstPagePresenter&#8217;a. \u041f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 onShowFormBtnClicked() \u0432 FirstPagePresenter \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 FirstPageUiHandlers<\/p>\n<p>  \u0412\u044b\u0437\u043e\u0432:  <\/p>\n<pre><code class=\"java\">\t\tshowFormBtn.addClickHandler(new ClickHandler() {\t\t\t \t\t\t@Override \t\t\tpublic void onClick(ClickEvent event) { \t\t\t\tgetUiHandlers().onShowFormBtnClicked();\t\t\t\t \t\t\t} \t\t}); <\/code><\/pre>\n<p>  \u0432 FirstPagePresenter&#8217; e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"java\">\t\taddToPopupSlot(firstPagePopupPresenter, true); <\/code><\/pre>\n<p>  \u041c\u044b \u0441\u0435\u0442\u0438\u043c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043f\u043e\u043f\u0430\u043f\u0430 \u0432 \u0441\u043b\u043e\u0442. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0434\u043b\u044f \u043f\u043e\u043f\u0430\u043f\u043e\u0432 \u0441\u043b\u043e\u0442 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u0447\u0442\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043f\u0430\u043f \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0442\u0435 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 addToPopupSlot() \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0446\u0435\u043d\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u0438 \u043f\u043e\u043f\u0430\u043f \u0432 \u043e\u043a\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u043c\u0435\u0442\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d). <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u043e\u043f\u0430\u043f \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043e\u043a\u043d\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0442\u0443\u0434\u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0432\u044c\u044e \u043f\u043e\u043f\u0430\u043f\u0430 \u0447\u0435\u0440\u0435\u0437 getUiHandlers() \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435, \u0430 \u0442\u043e\u0442 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043a\u0438\u0434\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 EventBus \u044d\u0432\u0435\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d FirstPagePresenter (\u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u043f\u0440\u043e \u044d\u0432\u0435\u043d\u0442\u044b \u0432 GWT \u044f \u0431\u044b \u043c\u043e\u0433 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435):<\/p>\n<pre><code class=\"java\">\t@Override \tpublic void onPopupEvent(PopupEvent event) { \t\tshowForm(false); \t\teventBus.fireEvent(new FirstPageEvent(event.getFirstName(), event.getLastName()));\t\t \t} <\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 showForm() \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u043e\u043f\u0430\u043f \u0438\u0437 \u0441\u043b\u043e\u0442\u0430:<\/p>\n<pre><code class=\"java\">removeFromPopupSlot(firstPagePopupPresenter); <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043a\u0438\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u044d\u0432\u0435\u043d\u0442 ( \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e FirstPageEvent) \u0434\u0430\u043b\u044c\u0448\u0435. \u041d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d \u043d\u0430\u0448 MainPagePresenter:<\/p>\n<pre><code class=\"java\">\t@Override \tpublic void onFirstPageEvent(FirstPageEvent event) { \t\t\/\/ \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043b\u0435\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u044b\u0439 , \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439  \u0447\u0435\u0440\u0435\u0437 \u044d\u0432\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044e \t\tshowRightContent(); \t\tMainPageEvent mainPageEvent =  new MainPageEvent( MainPageEvent.Action.SHOW_FORM_RESULT, event.getFirstName(),     event.getLastName()); \t\teventBus.fireEvent(mainPageEvent); \t} <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0435\u0433\u043e MainPagePresenter \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u043b\u043e\u0442\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0442\u043e\u0440\u0443\u044e: <\/p>\n<pre><code class=\"java\">\tpublic void showRightContent() { \t\tremoveFromSlot(SLOT_FIRST_PAGE, firstPagePresenter); \t\tgetView().setInSlot(SLOT_SECOND_PAGE, secondPagePresenter);\t \t} <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043e\u043d \u043f\u043e\u043b\u044b\u043b\u0430\u0435\u0442 \u0443\u0436\u0435 MainPageEvent \u0434\u0430\u043b\u044c\u0448\u0435. \u0412 \u043d\u0435\u0433\u043e \u0441\u0435\u0442\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044e, \u043d\u043e \u0438 Action. <\/p>\n<p>  \u041d\u0430\u0448 SecondPagePresenter \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u044d\u0432\u0435\u043d\u0442 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 onMainPageEvent() \u0440\u0435\u0448\u0430\u0435\u0442 \u0447\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0431\u0435\u0437 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432.<\/p>\n<pre><code class=\"java\">\t@Override \tpublic void onMainPageEvent(MainPageEvent event) { \t\tswitch(event.getAction()) { \t\tcase SHOW_FORM_RESULT: \t\t\tshowFormInfoWidget(event.getFirstName(), event.getLastName()); \t\t\tbreak; \t\tcase SHOW_LOREM_IPSUM: \t\t\tshowLoremIpsumWidget(); \t\t\tbreak; \t\tdefault: \t\t\tbreak;\t\t \t\t}\t\t \t} <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0432\u0441\u0435. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e:   <\/p>\n<ul>\n<li> \u041c\u044b \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 MVP \u2014 \u0432\u044c\u044e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435<\/li>\n<li> \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f reusable \u0438 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u043c<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u0443\u0442\u044f\u0442\u0441\u044f \u2014 \u0437\u0430\u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u044d\u0432\u0435\u043d\u0442\u043e\u0432? \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u044d\u0432\u0435\u043d\u0442, \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440, \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e, \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u044b \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. <\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0434\u0430\u043d\u043d\u0430\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0443-\u043b\u0438\u0431\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438 \u043e\u043d \u043e\u0431\u0440\u0430\u0442\u0438\u0442 \u0441\u0432\u043e\u0439 \u0432\u0437\u043e\u0440 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 GWT-Platform.<\/p>\n<p>  PS: \u041f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0437\u0430 \u043d\u0435\u043a\u0443\u044e \u0441\u0443\u043c\u0431\u0443\u0440\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u042d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442 \u043d\u0430 IT-\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443. \u041e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/192262\/\"> http:\/\/habrahabr.ru\/post\/192262\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412\u0441\u0435\u043c \u0445\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u044f\u043c \u0434\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a!<\/p>\n<p>  \u042f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 Java-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0438 \u0442\u0430\u043a \u0443\u0436 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0432\u043e\u044e \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 GWT. \u041d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043d\u0430 \u0442\u0435\u043c\u0443 GWT, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 GWT-Platform. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/code.google.com\/p\/gwt-platform\/\"> \u0442\u0443\u0442<\/a>, \u0430 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u0431 \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-192262","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192262"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/192262\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}