<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to HowToDialog</title><link>https://sourceforge.net/p/openpatrician/wikimig/HowToDialog/</link><description>Recent changes to HowToDialog</description><atom:link href="https://sourceforge.net/p/openpatrician/wikimig/HowToDialog/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 06 Dec 2016 20:53:05 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/openpatrician/wikimig/HowToDialog/feed" rel="self" type="application/rss+xml"/><item><title>HowToDialog modified by Sahits GmbH</title><link>https://sourceforge.net/p/openpatrician/wikimig/HowToDialog/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="howto-dialogs"&gt;HowTo Dialogs&lt;/h2&gt;
&lt;p&gt;Over the time the game was developed the dialogs were defined in various different ways. Some of these ways are still valid and or might be used for creating more complex setups. Therefore the whole documentation is on this page with the most recent/preferred one at the top.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new implementation of the dialog as a subclass of Dialog or probably more appropriatly  &lt;code&gt;DefaultSimpleDialog&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The dialog must be annotated as @Protype bean and have a @PostConstruct initialisation method named initializeDialog. In this method goes the setup of the dialog.&lt;/li&gt;
&lt;li&gt;The super class &lt;code&gt;DefaultSimpleDialog&lt;/code&gt; supplies utility methods to add nodes and decorated text elements based on keys in the default position &lt;code&gt;CENTER_LEFT&lt;/code&gt;, &lt;code&gt;CENTER&lt;/code&gt;, and &lt;code&gt;CENTER_RIGHT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create a Main class for the dialog in the test directory tree for the testing of the dialog outside the whole application. This main class extends &lt;code&gt;DialogTestApplicationContainerV2&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This class has a static inner class that extends &lt;code&gt;DialogParameters&lt;/code&gt; whicht holds a reference to all the member variables of the dialog as well as any usefull test data.&lt;/li&gt;
&lt;li&gt;In the method &lt;code&gt;configureDialogParameters&lt;/code&gt; these parameter are initialized.&lt;/li&gt;
&lt;li&gt;In the method &lt;code&gt;getDialog&lt;/code&gt; the dialog is created based on these parameters by injecting the fields defined in the parameter object into the dialog and invoiking the &lt;code&gt;initializeDialog&lt;/code&gt; method.&lt;/li&gt;
&lt;li&gt;Implement a Test class with a &lt;code&gt;@Rule&lt;/code&gt; &lt;code&gt;JavaFXThreadingRule&lt;/code&gt;. This rule ensures that the test also run in headless mode.&lt;/li&gt;
&lt;li&gt;Each test method then creates a new Parameter object and configures it through the corresponding Main class&lt;/li&gt;
&lt;li&gt;Additional setup is done after the parameters are configured through &lt;code&gt;configureDialogParameters&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create a dialog instance through the corresponding Main class.&lt;/li&gt;
&lt;li&gt;Do the testing.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr/&gt;
&lt;ol&gt;
&lt;li&gt;Create a new implementation of the dialog as a subclass of Dialog or probably more appropriatly CloseButtonDialog&lt;/li&gt;
&lt;li&gt;The dialog must be annotated as @Protype bean and have a @PostConstruct initialisation method named initializeDialog. In this method goes the setup of the dialog. It is suggested to create the content of the dialog as DecoratedText through the DecoratedTextFactory.&lt;/li&gt;
&lt;li&gt;If the closing of the dialog should update the noticeboard the executeOnCloseButtonClicked must be overridden&lt;/li&gt;
&lt;li&gt;Create a Main class for the dialog in the test directory tree for the testing of the dialog outside the whole application. This main class extends DialogTestApplicationContainer.&lt;/li&gt;
&lt;li&gt;The method getDialog contains the setup with suppling all the data and services for the dialog.&lt;/li&gt;
&lt;li&gt;The method startupFakeApplication should have an empty implementation.&lt;/li&gt;
&lt;li&gt;In the getDialog method the starupFakeApplication method must be called before the dialog is instantiated.&lt;/li&gt;
&lt;li&gt;Implement a test class extending the Main class.&lt;/li&gt;
&lt;li&gt;The test class implements the startupFakeApplication by calling FakeApplicationStartup.startupFakeApplication()&lt;/li&gt;
&lt;li&gt;Test actions and dialog navigation&lt;/li&gt;
&lt;li&gt;In DialogFactory add a case for retrieving the dialog bean&lt;/li&gt;
&lt;li&gt;Where the dialog should be opened call the dialogContoller to replace the dialog. &lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sahits GmbH</dc:creator><pubDate>Tue, 06 Dec 2016 20:53:05 -0000</pubDate><guid>https://sourceforge.neta26a932a5c1a4962dad189b8508c082823fb363f</guid></item></channel></rss>