<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog @ SIB Visions &#187; Vaadin</title>
	<atom:link href="http://blog.sibvisions.com/tag/vaadin/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sibvisions.com</link>
	<description>Blog @ SIB Visions</description>
	<lastBuildDate>Thu, 09 Apr 2026 15:54:28 +0000</lastBuildDate>
		<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VisionX, JVx and native Vaadin</title>
		<link>https://blog.sibvisions.com/2018/01/10/visionx-jvx-and-native-vaadin/</link>
		<comments>https://blog.sibvisions.com/2018/01/10/visionx-jvx-and-native-vaadin/#comments</comments>
		<pubDate>Wed, 10 Jan 2018 13:32:28 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=7679</guid>
		<description><![CDATA[If you create an application with VisionX, it's always a JVx based application. You get all advantages of JVx and its GUI independency, but sometimes the GUI indepency is not important and you want to use native GUI controls in your JVx application because JVx doesn't contain the GUI control or you need a commercial [...]]]></description>
			<content:encoded><![CDATA[<p>If you create an application with VisionX, it's always a JVx based application. You get all advantages of JVx and its GUI independency, but sometimes the GUI indepency is not important and you want to use native GUI controls in your JVx application because JVx doesn't contain the GUI control or you need a commercial control. This is a very simple use-case and it's not a problem to mix JVx components with native components. We have different examples, with different GUI technologies, for this use-case.</p>
<p>Here are some links:</p>
<ul>
<li><a href="http://forum.sibvisions.com/viewtopic.php?f=11&#038;t=137&#038;p=189">User defined Components</a></li>
<li><a href="https://blog.sibvisions.com/2015/03/20/javafx-jvx-calendarfx-and-exchange-server/">JavaFX, JVx, CalendarFX and Exchange Server</a></li>
<li><a href="https://blog.sibvisions.com/2017/01/16/jvx-reference-custom-components/">JVx Reference, Custom Components</a></li>
<li><a href="https://blog.sibvisions.com/2017/07/03/jvx-reference-resource-and-uiresource/">JVx Reference, Resource and UIResource</a></li>
</ul>
<p>But we don't have a link for our Vaadin implementation. But no problem, here it is!</p>
<p>Simply create a new application with VisionX and a dummy screen like this one:</p>
<div id="attachment_7681" class="wp-caption aligncenter nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2018/01/swing_vaadin.png" rel="lightbox[7679]"><img src="https://blog.sibvisions.com/wp-content/uploads/2018/01/swing_vaadin-300x203.png" alt="Simple screen" title="swing_vaadin" width="300" height="203" class="size-medium wp-image-7681" /></a><p class="wp-caption-text">Simple screen</p></div>
<p>The screen contains a simple table and two editors. Nothing special. Now we want to add a custom Vaadin component in the empty space. It doesn't matter which component you use. Every vaadin component or AddOn component can be used. JVx doesn't do specific things, it's only an UI abstraction layer.</p>
<p>So, lets add an Accordion to the screen:</p>
<div id="attachment_7682" class="wp-caption aligncenter nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2018/01/vaadin_accordion.png" rel="lightbox[7679]"><img src="https://blog.sibvisions.com/wp-content/uploads/2018/01/vaadin_accordion-300x208.png" alt="Integrated Accordion" title="vaadin_accordion" width="300" height="208" class="size-medium wp-image-7682" /></a><p class="wp-caption-text">Integrated Accordion</p></div>
<p>The Accordion component is a standard Vaadin component, simply added to the screen. But more... Do you see the "Show Vaadin Notification" Button? This is a standard JVx component. So we mix native vaadin components with standard JVx components and get the full power of both. One advantage of the JVx components is that the automatic translation works without additional hacks, or what about JVx' layouts, event handling, ...</p>
<p><strong>Interested in the source code?</strong></p>
<p>No worries, it's super simple to understand <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Lets have a look at the custom code:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">UIButton butNotification <span class="sy0">=</span> <span class="kw1">new</span> UIButton<span class="br0">&#40;</span><span class="st0">&quot;Show Vaadin Notification&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
butNotification.<span class="me1">eventAction</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">addListener</span><span class="br0">&#40;</span><span class="kw1">new</span> IActionListener<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> action<span class="br0">&#40;</span>UIActionEvent arg0<span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Throwable</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Notification noti <span class="sy0">=</span> <span class="kw1">new</span> Notification<span class="br0">&#40;</span><span class="st0">&quot;Message&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;Description&quot;</span>, Type.<span class="me1">WARNING_MESSAGE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noti.<span class="me1">setDelayMsec</span><span class="br0">&#40;</span>2000<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; noti.<span class="me1">show</span><span class="br0">&#40;</span>Page.<span class="me1">getCurrent</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>UIFormLayout flJVxPanel <span class="sy0">=</span> <span class="kw1">new</span> UIFormLayout<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>UIPanel panJVxPanel <span class="sy0">=</span> <span class="kw1">new</span> UIPanel<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
panJVxPanel.<span class="me1">setLayout</span><span class="br0">&#40;</span>flJVxPanel<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>panJVxPanel.<span class="me1">add</span><span class="br0">&#40;</span>butNotification<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw1">if</span> <span class="br0">&#40;</span>getApplication<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getLauncher</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">isWebEnvironment</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Accordion acc <span class="sy0">=</span> <span class="kw1">new</span> Accordion<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; acc.<span class="me1">setHeight</span><span class="br0">&#40;</span>100.0f, Unit.<span class="me1">PERCENTAGE</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> <span class="nu0">8</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>i <span class="sy0">&gt;=</span> 2<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">final</span> <span class="kw3">Label</span> label <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">Label</span><span class="br0">&#40;</span><span class="st0">&quot;Welcome sheet!&quot;</span>, ContentMode.<span class="kw3">HTML</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label.<span class="me1">setWidth</span><span class="br0">&#40;</span>100.0f, Unit.<span class="me1">PERCENTAGE</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">final</span> VerticalLayout layout <span class="sy0">=</span> <span class="kw1">new</span> VerticalLayout<span class="br0">&#40;</span>label<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layout.<span class="me1">setMargin</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acc.<span class="me1">addTab</span><span class="br0">&#40;</span>layout, <span class="st0">&quot;Tab &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span>panJVxPanel<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; acc.<span class="me1">addTab</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw3">Component</span><span class="br0">&#41;</span>panJVxPanel.<span class="me1">getResource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>, <span class="st0">&quot;Tab &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> UICustomComponent<span class="br0">&#40;</span>acc<span class="br0">&#41;</span>, formLayout1.<span class="me1">getConstraints</span><span class="br0">&#40;</span>0, 2, <span class="sy0">-</span>1, <span class="sy0">-</span>1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>The Accordion source code was copied from <a href="https://demo.vaadin.com/sampler/#ui/structure/accordion">Vaadin Sampler</a>:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">sample <span class="sy0">=</span> <span class="kw1">new</span> Accordion<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
sample.<span class="me1">setHeight</span><span class="br0">&#40;</span>100.0f, Unit.<span class="me1">PERCENTAGE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">1</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> <span class="nu0">8</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">final</span> <span class="kw3">Label</span> label <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">Label</span><span class="br0">&#40;</span>TabSheetSample.<span class="me1">getLoremContent</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, ContentMode.<span class="kw3">HTML</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; label.<span class="me1">setWidth</span><span class="br0">&#40;</span>100.0f, Unit.<span class="me1">PERCENTAGE</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="kw1">final</span> VerticalLayout layout <span class="sy0">=</span> <span class="kw1">new</span> VerticalLayout<span class="br0">&#40;</span>label<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; layout.<span class="me1">setMargin</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; sample.<span class="me1">addTab</span><span class="br0">&#40;</span>layout, <span class="st0">&quot;Tab &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>So, what are the most interesting parts in our code?</strong></p>
<p>First, we add the JVx panel to another JVx panel. This is important to get support for translation. If it's not important for your, simply ignore the line:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span>panJVxPanel<span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>The <strong>groupPanelOverview </strong>is a simple <strong>UIGroupPanel</strong> with <strong>UIFormLayout</strong>:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">UIFormLayout formLayout1 <span class="sy0">=</span> <span class="kw1">new</span> UIFormLayout<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>UIGroupPanel groupPanelOverview <span class="sy0">=</span> <span class="kw1">new</span> UIGroupPanel<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>groupPanelOverview.<span class="me1">setText</span><span class="br0">&#40;</span><span class="st0">&quot;Overview&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
groupPanelOverview.<span class="me1">setLayout</span><span class="br0">&#40;</span>formLayout1<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span>labelName, formLayout1.<span class="me1">getConstraints</span><span class="br0">&#40;</span>0, 0<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span>editOverviewName, formLayout1.<span class="me1">getConstraints</span><span class="br0">&#40;</span>1, 0<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span>labelDescription, formLayout1.<span class="me1">getConstraints</span><span class="br0">&#40;</span>0, 1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span>editOverviewDescription, formLayout1.<span class="me1">getConstraints</span><span class="br0">&#40;</span>1, 1, <span class="sy0">-</span>1, 1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>Our JVx button will be added to the native vaadin Accordion with following code:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">acc.<span class="me1">addTab</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="kw3">Component</span><span class="br0">&#41;</span>panJVxPanel.<span class="me1">getResource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>, <span class="st0">&quot;Tab &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>We don't add the JVx component itself, we use the wrapped resource. This is a simple vaadin component: <strong>com.vaadin.ui.Button</strong></p>
<p>And finally, we add the Accordion as custom component to our JVx group panel:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">groupPanelOverview.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> UICustomComponent<span class="br0">&#40;</span>acc<span class="br0">&#41;</span>, formLayout1.<span class="me1">getConstraints</span><span class="br0">&#40;</span>0, 2, <span class="sy0">-</span>1, <span class="sy0">-</span>1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>This code:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="kw1">if</span> <span class="br0">&#40;</span>getApplication<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getLauncher</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">isWebEnvironment</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</div>
<p>is important for VisionX because the vaadin components aren't available in Swing, so we use this check for the supported environment.</p>
<p>So far, we mixed native vaadin components with JVx components. It's super easy to use, isn't it?</p>
<p>But it's also possible to use CSS for JVx components:</p>
<div id="attachment_7691" class="wp-caption aligncenter nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2018/01/vaadin_css_friendly.png" rel="lightbox[7679]"><img src="https://blog.sibvisions.com/wp-content/uploads/2018/01/vaadin_css_friendly-300x208.png" alt="Css style for Button" title="vaadin_css_friendly" width="300" height="208" class="size-medium wp-image-7691" /></a><p class="wp-caption-text">Css style for Button</p></div>
<p>The button got the friendly style, which is defined in Vaadin CSS. Check <a href="https://demo.vaadin.com/valo-theme/#!buttons-and-links">some examples</a>.</p>
<p>To add the friendly style class to the JVx button, simple add:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="kw3">Style</span>.<span class="me1">addStyleNames</span><span class="br0">&#40;</span>butNotification, <span class="st0">&quot;friendly&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>This example is using predefined CSS from vaadin. It's also possible to set custom styles in your own css file. Simple follow <a href="http://forum.sibvisions.com/viewtopic.php?f=20&#038;t=922&#038;p=1444">this instructions</a>.</p>
<p>This article covered the integration of native vaadin components into an existing JVx application with all advantages of vaadin.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2018/01/10/visionx-jvx-and-native-vaadin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vaadin, let&#039;s hack the Profiler</title>
		<link>https://blog.sibvisions.com/2017/09/11/vaadin-hack-the-profiler/</link>
		<comments>https://blog.sibvisions.com/2017/09/11/vaadin-hack-the-profiler/#comments</comments>
		<pubDate>Mon, 11 Sep 2017 09:00:30 +0000</pubDate>
		<dc:creator>rzenz</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=7155</guid>
		<description><![CDATA[Vaadin comes with a builtin Profiler which is only available during debug mode, which might not be available or reasonable. So, let us see if we can use it without the debug mode enabled.
It has a profiler?
Yes, there is one right builtin on the client side. You can activate it easily enough by adding the [...]]]></description>
			<content:encoded><![CDATA[<p>Vaadin comes with a builtin Profiler which is only available during debug mode, which might not be available or reasonable. So, let us see if we can use it without the debug mode enabled.</p>
<h3 style="padding-top: 10px">It has a profiler?</h3>
<p>Yes, there is one right builtin on the client side. You can activate it easily enough by adding the following to the widgetset:</p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;set-property</span> <span class="re0">name</span>=<span class="st0">&quot;vaadin.profiler&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;true&quot;</span> <span class="re2">/&gt;</span></span></div>
</li>
</ol>
</div>
</div>
<p>But to see the results, you also have to switch the application into debug mode by changing the web.xml to the following:</p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;context-param<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;description<span class="re2">&gt;</span></span></span>Vaadin production mode<span class="sc3"><span class="re1">&lt;/description<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;param-name<span class="re2">&gt;</span></span></span>productionMode<span class="sc3"><span class="re1">&lt;/param-name<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;param-value<span class="re2">&gt;</span></span></span>false<span class="sc3"><span class="re1">&lt;/param-value<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li2">
<div class="de2"><span class="sc3"><span class="re1">&lt;/context-param<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
</div>
<p>This allows you to enter the debug mode of an application, though, that requires to restart the application (or in the worst case, a redeploy). One upside of testing new Widgetsets can be that one can apply them to any running application without modifications, because that is purely client-side. So changing the configuration of the application might not be possible or desirable.</p>
<p>There are some forum posts out there which talk about that it is enough to enable the profiler and see the the output of it being logged to the debug console of the browser, but that is not the case anymore.</p>
<h3 style="padding-top: 10px">Let's have a deeper look</h3>
<p>The Profiler can be found in the class <strong>com.vaain.vaadin.client.Profiler</strong> and is comletely client-side. It will store all gathered information until the function logTimings() is called, which then will hand the gathered information to a consumer which can do with it whatever it wants. Now comes the interesting part, there is no public default implementation for the consumer provided. If you want to log what was profiled to the debug console you'll have to write your own. Even if there were, the function setProfilerResultConsumer(ProfilerResultConsumer) is commented with a warning that it might change in future versions without notice and should not be used - interesting. Also interesting is the fact that it can only be set once. Once set, it can not be changed.</p>
<p>Hm, looks a little bare bone. Of course there is an "internal" class that is utilizing it to send its output to the debug window, but we can't use any of that code, unfortunately. So let's see what we can do with it.</p>
<h3 style="padding-top: 10px">Send everything to the debug console</h3>
<p>The easiest thing is to simply send all the output to the debug console of the browser, we can do this easily enough:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">java.util.LinkedHashMap</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">java.util.List</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">com.vaadin.client.Profiler.Node</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">com.vaadin.client.Profiler.ProfilerResultConsumer</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* A simple {@link ProfilerResultConsumer} which is outputting everything to the</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* debug console of the browser.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* @author Robert Zenz</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">public</span> <span class="kw1">class</span> DebugConsoleProfilerResultConsumer <span class="kw1">implements</span> ProfilerResultConsumer</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Initialization</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Creates a new instance of {@link DebugConsoleProfilerResultConsumer}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> DebugConsoleProfilerResultConsumer<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Interface implementation</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@inheritDoc}</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; @Override</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> addProfilerData<span class="br0">&#40;</span>Node pRootNode, <span class="kw3">List</span> pTotals<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; debug<span class="br0">&#40;</span>pRootNode<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>Node node <span class="sy0">:</span> pTotals<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug<span class="br0">&#40;</span>node<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@inheritDoc}</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; @Override</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> addBootstrapData<span class="br0">&#40;</span>LinkedHashMap pTimings<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// TODO We'll ingore this for now.</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// User-defined methods</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Sends the given {@link Node} to the debug console if it is</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@link #isValid(Node) valid}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pNode the {@link Node} to log.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @see #isValid(Node)</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw4">void</span> debug<span class="br0">&#40;</span>Node pNode<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>isValid<span class="br0">&#40;</span>pNode<span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug<span class="br0">&#40;</span>pNode.<span class="me1">getStringRepresentation</span><span class="br0">&#40;</span><span class="st0">&quot;&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Tests if the given {@link Node} is valid, meaning not {@code null}, has a</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@link Node#getName() name} and was {@link Node#getCount() invoked at</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* all}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pNode the {@link Node} to test}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @return {@code true} if the given {@link Node} is considered valid.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw4">boolean</span> isValid<span class="br0">&#40;</span>Node pNode<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> pNode <span class="sy0">!=</span> <span class="kw2">null</span> <span class="sy0">&amp;&amp;</span> pNode.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">!=</span> <span class="kw2">null</span> <span class="sy0">&amp;&amp;</span> pNode.<span class="me1">getCount</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Native methods</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Logs the given message to the debug console.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pMessage the message to log.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw1">native</span> <span class="kw4">void</span> debug<span class="br0">&#40;</span><span class="kw3">String</span> pMessage<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="coMULTI">/*-{</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; console.debug(pMessage);</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; &nbsp; }-*/</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span> &nbsp; &nbsp;<span class="co1">// DebugConsoleProfilerResultConsumer</span></div>
</li>
</ol>
</div>
</div>
<p>And we can attach it rather easily, too:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2">Profiler.<span class="me1">setProfilerResultConsumer</span><span class="br0">&#40;</span><span class="kw1">new</span> DebugConsoleProfilerResultConsumer<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
</div>
<p>Make sure to do this only once, otherwise an Exception will be thrown, stating that it can only be done once. Also the application should not be in debug mode, otherwise the Vaadin consumer will be attached. Now that we've attached a consumer we can recompile the Widgetset and actually try it, and low and behold, we see output in the debug window of the browser. Quite a lot, actually, seems like the Profiler is used often, which is good.</p>
<h3 style="padding-top: 10px">Filter the results</h3>
<p>Skimming through the results is tedious, luckily most browsers come with the possibility to filter the results, but that possibility is quite limited. If we are interested in multiple results, the easiest way will be to filter them on the server side, obviously we can do that just as easily:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">java.util.HashSet</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">java.util.LinkedHashMap</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">java.util.List</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">java.util.Set</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">com.vaadin.client.Profiler.Node</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">import</span> <span class="co2">com.vaadin.client.Profiler.ProfilerResultConsumer</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* A simple {@link ProfilerResultConsumer} which is outputting everything to the</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* debug console of the browser.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;* @author Robert Zenz</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">public</span> <span class="kw1">class</span> DebugConsoleProfilerResultConsumer <span class="kw1">implements</span> ProfilerResultConsumer</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Class members</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/** The names of nodes we want to output. */</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw3">Set</span> wantedNames <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">HashSet</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Initialization</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Creates a new instance of {@link DebugConsoleProfilerResultConsumer}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pWantedNames the names of the profiler data which should be</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;displayed.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> DebugConsoleProfilerResultConsumer<span class="br0">&#40;</span><span class="kw3">String</span>... <span class="me1">pWantedNames</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">super</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>pWantedNames <span class="sy0">!=</span> <span class="kw2">null</span> <span class="sy0">&amp;&amp;</span> pWantedNames.<span class="me1">length</span> <span class="sy0">&gt;</span> 0<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw3">String</span> wantedName <span class="sy0">:</span> pWantedNames<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wantedNames.<span class="me1">add</span><span class="br0">&#40;</span>wantedName<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Interface implementation</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@inheritDoc}</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; @Override</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> addProfilerData<span class="br0">&#40;</span>Node pRootNode, <span class="kw3">List</span> pTotals<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; debug<span class="br0">&#40;</span>pRootNode<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>Node node <span class="sy0">:</span> pTotals<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug<span class="br0">&#40;</span>node<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@inheritDoc}</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; @Override</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> addBootstrapData<span class="br0">&#40;</span>LinkedHashMap pTimings<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// TODO We'll ingore this for now.</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// User-defined methods</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Sends the given {@link Node} to the debug console if it is</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@link #isValid(Node) valid}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pNode the {@link Node} to log.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @see #isValid(Node)</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw4">void</span> debug<span class="br0">&#40;</span>Node pNode<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>isValid<span class="br0">&#40;</span>pNode<span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; debug<span class="br0">&#40;</span>pNode.<span class="me1">getStringRepresentation</span><span class="br0">&#40;</span><span class="st0">&quot;&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Tests if the given {@link Node} is valid, meaning not {@code null}, has a</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* {@link Node#getName() name} and was {@link Node#getCount() invoked at</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* all}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pNode the {@link Node} to test}.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @return {@code true} if the given {@link Node} is considered valid.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw4">boolean</span> isValid<span class="br0">&#40;</span>Node pNode<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> pNode <span class="sy0">!=</span> <span class="kw2">null</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&amp;&amp;</span> pNode.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">!=</span> <span class="kw2">null</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&amp;&amp;</span> pNode.<span class="me1">getCount</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> 0</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">&amp;&amp;</span> <span class="br0">&#40;</span>wantedNames.<span class="me1">isEmpty</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">||</span> wantedNames.<span class="me1">contains</span><span class="br0">&#40;</span>pNode.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">// Native methods</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co3">/**</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* Logs the given message to the debug console.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;* @param pMessage the message to log.</span></div>
</li>
<li class="li2">
<div class="de2"><span class="co3">&nbsp; &nbsp; &nbsp;*/</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw1">native</span> <span class="kw4">void</span> debug<span class="br0">&#40;</span><span class="kw3">String</span> pMessage<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="coMULTI">/*-{</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; &nbsp; &nbsp; &nbsp; console.debug(pMessage);</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; &nbsp; }-*/</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span> &nbsp; &nbsp;<span class="co1">// DebugConsoleProfilerResultConsumer</span></div>
</li>
</ol>
</div>
</div>
<p>Now we can simply pass the list of "interesting" event names to the consumer and see only these.</p>
<h3 style="padding-top: 10px">JavaScript hacking</h3>
<p>But there is more, instead of setting a consumer we can attach ourselves to the JavaScript function and instead process each profiled section individually. So in the debug console we can simply run something like this:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2">window.__gwtStatsEvent <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; console.<span class="me1">debug</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
</div>
<p>This will output every single profiler event into the console. Now, if we want to process these events, we must first understand there is always a "begin" and an "end" event, which respectively are marking the begin and end of an event.</p>
<p>We can now listen for a certain event and simply output how long it took, like this:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2">window.__profiler <span class="sy0">=</span> <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">window.__gwtStatsEvent <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>event.<span class="me1">subSystem</span> <span class="sy0">===</span> <span class="st0">&quot;Layout pass&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>event.<span class="me1">type</span> <span class="sy0">===</span> <span class="st0">&quot;begin&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.__profiler<span class="br0">&#91;</span>event.<span class="me1">subSystem</span><span class="br0">&#93;</span> <span class="sy0">=</span> event.<span class="me1">millis</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event.<span class="me1">subSystem</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;: &quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="br0">&#40;</span>event.<span class="me1">millis</span> <span class="sy0">-</span> window.__profiler<span class="br0">&#91;</span>event.<span class="me1">subSystem</span><span class="br0">&#93;</span><span class="br0">&#41;</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;ms&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
</div>
<p>Or, to go over the top, we could create a generic listener which informs us about everything:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">
<ol>
<li class="li2">
<div class="de2">window.__wantedEvents <span class="sy0">=</span> <span class="br0">&#91;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="st0">&quot;Layout pass&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="st0">&quot;Layout measure connectors&quot;</span><span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="st0">&quot;layout PostLayoutListener&quot;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#93;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">window.__profiler <span class="sy0">=</span> <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">window.__gwtStatsEvent <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span>event<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>window.__wantedEvents.<span class="me1">indexOf</span><span class="br0">&#40;</span>event.<span class="me1">subSystem</span><span class="br0">&#41;</span> <span class="sy0">&gt;=</span> 0<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw1">typeof</span> window.__profiler<span class="br0">&#91;</span>event.<span class="me1">subSystem</span><span class="br0">&#93;</span> <span class="sy0">===</span> <span class="st0">&quot;undefined&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; window.__profiler<span class="br0">&#91;</span>event.<span class="me1">subSystem</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; averageRuntime <span class="sy0">:</span> 0<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; count <span class="sy0">:</span> 0<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastBegin <span class="sy0">:</span> 0<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastEnd <span class="sy0">:</span> 0<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastRuntime<span class="sy0">:</span> 0<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastRuntimes <span class="sy0">:</span> <span class="kw2">new</span> Array<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; minRuntime <span class="sy0">:</span> 999999999<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; maxRuntime <span class="sy0">:</span> <span class="sy0">-</span>999999999<span class="sy0">,</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; totalRuntime <span class="sy0">:</span> 0</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> info <span class="sy0">=</span> window.__profiler<span class="br0">&#91;</span>event.<span class="me1">subSystem</span><span class="br0">&#93;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>event.<span class="me1">type</span> <span class="sy0">===</span> <span class="st0">&quot;begin&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">count</span> <span class="sy0">=</span> info.<span class="me1">count</span> <span class="sy0">+</span> <span class="nu0">1</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">lastBegin</span> <span class="sy0">=</span> event.<span class="me1">millis</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">lastEnd</span> <span class="sy0">=</span> event.<span class="me1">millis</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">lastRuntime</span> <span class="sy0">=</span> info.<span class="me1">lastEnd</span> <span class="sy0">-</span> info.<span class="me1">lastBegin</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">lastRuntimes</span>.<span class="me1">push</span><span class="br0">&#40;</span>info.<span class="me1">lastRuntime</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">minRuntime</span> <span class="sy0">=</span> Math.<span class="me1">min</span><span class="br0">&#40;</span>info.<span class="me1">lastRuntime</span><span class="sy0">,</span> info.<span class="me1">minRuntime</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">maxRuntime</span> <span class="sy0">=</span> Math.<span class="me1">max</span><span class="br0">&#40;</span>info.<span class="me1">lastRuntime</span><span class="sy0">,</span> info.<span class="me1">maxRuntime</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">totalRuntime</span> <span class="sy0">=</span> info.<span class="me1">totalRuntime</span> <span class="sy0">+</span> info.<span class="me1">lastRuntime</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">averageRuntime</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> index <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> index <span class="sy0">&lt;</span> info.<span class="me1">lastRuntimes</span>.<span class="me1">length</span><span class="sy0">;</span> index<span class="sy0">++</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">averageRuntime</span> <span class="sy0">=</span> info.<span class="me1">averageRuntime</span> <span class="sy0">+</span> info.<span class="me1">lastRuntimes</span><span class="br0">&#91;</span>index<span class="br0">&#93;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; info.<span class="me1">averageRuntime</span> <span class="sy0">=</span> info.<span class="me1">averageRuntime</span> <span class="sy0">/</span> info.<span class="me1">lastRuntimes</span>.<span class="me1">length</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.<span class="me1">log</span><span class="br0">&#40;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; event.<span class="me1">subSystem</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;: &quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> info.<span class="me1">count</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot; times at &quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> info.<span class="me1">averageRuntime</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">3</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot; totaling &quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> info.<span class="me1">totalRuntime</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;ms with current at &quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> info.<span class="me1">lastRuntime</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;ms (&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> info.<span class="me1">minRuntime</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;ms/&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> info.<span class="me1">maxRuntime</span>.<span class="me1">toFixed</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sy0">+</span> <span class="st0">&quot;ms)&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
</div>
<p>And we now have a neat little system in place which displays everything we&#39;d like to know, and it is easily extendable and modifiable, too.</p>
<h3 style="padding-top: 10px">Conclusion</h3>
<p>As we see, we have quite a few ways to get the information from the profiler even without the application running in debug mode, some might not be as obvious as others, though. The interesting part is that many things are easily accessible on the JavaScript side of Vaadin, directly from the debug console of the browser, one only has to look for it.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2017/09/11/vaadin-hack-the-profiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Map component for JVx applications</title>
		<link>https://blog.sibvisions.com/2017/03/03/map-component-for-jvx-applications/</link>
		<comments>https://blog.sibvisions.com/2017/03/03/map-component-for-jvx-applications/#comments</comments>
		<pubDate>Fri, 03 Mar 2017 10:32:16 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Map]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=6411</guid>
		<description><![CDATA[We played around with some interesting stuff in the last weeks. Some customers and users asked us if we have a Map component. 
We don't have a ready-to-use component but there are many free and commercial solutions available. The integration in a JVx application with custom components is not a problem and doesn't need much [...]]]></description>
			<content:encoded><![CDATA[<p>We played around with some interesting stuff in the last weeks. Some customers and users asked us if we have a Map component. </p>
<p>We don't have a ready-to-use component but there are many free and commercial solutions available. The integration in a JVx application with custom components is not a problem and doesn't need much effort. But sure, an out-of-the-box solution would be useful.</p>
<p>Our Research team did create a PoC for a Map. The results is very nice and we want to show you some screenshots from our tests.</p>
<table>
<tr>
<td><div id="attachment_6414" class="wp-caption alignnone nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-swing-tabs.png" rel="lightbox[6411]"><img src="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-swing-tabs-300x240.png" alt="Swing integration (Tab mode)" title="map-swing-tabs" width="300" height="240" class="size-medium wp-image-6414" /></a><p class="wp-caption-text">Swing integration (Tab mode)</p></div></td>
<td style="width: 15px;"></td>
<td><div id="attachment_6413" class="wp-caption alignnone nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-swing.png" rel="lightbox[6411]"><img src="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-swing-300x240.png" alt="Swing integration (frame mode)" title="map-swing" width="300" height="240" class="size-medium wp-image-6413" /></a><p class="wp-caption-text">Swing integration (frame mode)</p></div></td>
</tr>
<tr>
<td><div id="attachment_6416" class="wp-caption alignnone nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-vaadin.png" rel="lightbox[6411]"><img src="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-vaadin-300x240.png" alt="Vaadin integration" title="map-vaadin" width="300" height="240" class="size-medium wp-image-6416" /></a><p class="wp-caption-text">Vaadin integration</p></div></td>
<td></td>
<td><div id="attachment_6417" class="wp-caption alignnone nomargin" style="width: 310px"><a href="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-vaadin-corporate.png" rel="lightbox[6411]"><img src="https://blog.sibvisions.com/wp-content/uploads/2017/03/map-vaadin-corporate-300x240.png" alt="Vaadin integratin (corporation mode)" title="map-vaadin-corporate" width="300" height="240" class="size-medium wp-image-6417" /></a><p class="wp-caption-text">Vaadin integratin (corporation mode)</p></div></td>
</tr>
</table>
<p>We didn't add the component to JVx because it's just a PoC and not ready-to-use.<br />
But the Map integration looks great <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2017/03/03/map-component-for-jvx-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future of JavaFX?</title>
		<link>https://blog.sibvisions.com/2015/11/23/the-future-of-javafx/</link>
		<comments>https://blog.sibvisions.com/2015/11/23/the-future-of-javafx/#comments</comments>
		<pubDate>Mon, 23 Nov 2015 15:46:41 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Gluon]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[JavaFXPorts]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[RoboVM]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=5215</guid>
		<description><![CDATA[After one year of JavaFX development, we thought it's time to write about our experience. 
We started in Nov. 2014 with our first bigger JavaFX tests. The idea was an UI implementation for JVx. We thought it should be an easy task because JavaFX is a desktop technology. We had another research project in 2012, [...]]]></description>
			<content:encoded><![CDATA[<p>After one year of JavaFX development, we thought it's time to write about our experience. </p>
<p>We started in Nov. 2014 with our first bigger JavaFX tests. The idea was an UI implementation for JVx. We thought it should be an easy task because JavaFX is a desktop technology. We had another research project in 2012, but the result wasn't as expected. Sometimes it's a good idea to re-start from scratch!</p>
<p>JavaFX wasn't very popular and is still not a Superstar, but we love researching and we thought it might be a good idea to bet on JavaFX. Not only as pure desktop solution and Swing replacement, but also for mobile app development based on JavaFXPorts and for embedded devices, like Raspberry Pi. So we had this big picture in mind.<br />
We thought it would be awesome to create a single JavaFX application, for all platforms and devices. Sure, some other companies tried to solve this problem as well, but we didn't try to do the same. Our idea was simple and based on JVx. We hade this awesome JVx application framework which enabled GUI and technology independent application development. So we tried to solve the GUI problem because all other things like persistence, remote communcation, i18n, ... were already solved by JVx.</p>
<p>We did different GUI implementations for JVx, before we started with JavaFX. Our first one was based on Swing, followed by QTJambi, GWT, GXT, a headless variant and - last but not least - vaadin. We also made some tests with Flex and Pivot, but we didn't create more than some simple PoC. To be clear: GUI technology know-how was not the problem!</p>
<p>We knew that JavaFX didn't have a solution for MDI and especially a DesktopPane was missing, but it wasn't a problem to create custom components/controls. We had some hard months of development because we found out that JavaFX wasn't a mature toolkit like Swing. We had to find many workarounds for very simple problems and had to create more custom components than expected. We solved most problems in our own code, but it wasn't possible to change some basic problems. We tried to get in contact with the developers, via JIRA, but it was hard to explain real-world use-cases to toolkit developers. Our developers at SIB Visions create custom products and projects together with customers for their needs. So we had many UI toolkit requirements from real users. Some issues were accepted but not all. Many bugs were fixed but we had big problems with Feature Requests. So far so good.</p>
<p>We finished our JavaFX UI implementation in April 2015 and it was a big success, because we had a fresh UI technology with lots new features and animations, transitions, web and media views, .... awesome.</p>
<p>We thought that JavaFX will be improved in 2015/2016 and it will be mature enough to use it for our customers.</p>
<p><strong>Wait... what's the problem with JavaFX?</strong></p>
<p><strong>Performance</strong>, <strong>Memory</strong>, <strong>limited chances to modify standard controls</strong></p>
<p>The performance is not good, if you have many controls (= nodes). It's different on Windows, Linux, MacOS. It's much better on MacOS than on any other supported OS. If you develop business/backoffice applications, the performance is very important. Sure, if you create simple form based applications, it doesn't really matter.</p>
<p>We use JVx to develop huge backoffice applications and currently, JavaFX should be used with care.</p>
<p>What do we mean with "performance is not good"? </p>
<ul>
<li>Large TableViews have scroll delays</li>
<li>Layouting sometimes need some "extra repaints"</li>
<li>Scrolling with many controls is not immediate</li>
<li>Startup time of an application is too long, compared to e.g. Swing applications</li>
</ul>
<p><em>The version number of JavaFX 8 is too high for it's maturity.</em></p>
<p><strong>JavaFX has big potential but we're not sure if it'll survive it's predecessor Swing.</strong></p>
<p>And we're not alone with our opinion: <a href="https://www.codenameone.com/blog/should-oracle-spring-clean-javafx.html">Should Oracle Spring clean JavaFX</a></p>
<p>But there are also companies with JavaFX applications: <a href="https://dlemmermann.wordpress.com/2015/11/20/javafx-real-world-apps-javaone-2015-presentation-online/">JavaFX Real-world apps</a></p>
<h4 style="padding-top: 15px">There's more</h4>
<p>The toolkit issues are one thing. Another big surprise was that Oracle stopped official ARM support in Jan 2015 which didn't mean that JavaFX doesn't run on ARM devices (RaspberryPi, ...), but it's not officially supported and Oracle doesn't fix bugs or implement improvements.<br />
Thanks to <a href="http://gluonhq.com/open-source/javafxports/downloads/">Gluon</a> it's still very easy to use JavaFX on ARM devices.</p>
<p><em>Another step backwards was the migration to Bugzilla.</em> In 2014 (and earlier), JavaFX was a "newcomer" and announced as Swing replacement. The development process at Oracle was very open and you had a "direct connection" to the development team, or something like that. It was very simple to report issues and to get feedback from the developers. It was fantastic to see and feel the progress. This is different nowadays, because the ticketing system moved from JIRA to Bugzilla and it's more or less readonly for standard developers.</p>
<p><strong>One problem with JavaFX is that Oracle doesn't tell us the strategy behind JavaFX</strong>. The investment of Oracle in JavaFX was high, but what will be the next step? It's hard to bet on JavaFX without definitive commitment from Oracle.</p>
<p>But we still hope that JavaFX will be the one and only UI toolkit for Java. </p>
<h4 style="padding-top: 15px">JavaFX for Android and iOS</h4>
<p>In summer, we moved forward and tried to use <a href="http://gluonhq.com/open-source/javafxports/">JavaFXPorts</a>. It makes it possible to use your JavaFX application as native Android and iOS apps. Our JavaFX UI worked with some smaller changes out-of-the-box. It was awesome to see our JVx on Android or iOS devices! It was a milestone.</p>
<p>But things have changed since summer because JavaFXPorts has a depency on <a href="https://robovm.com/">RoboVM</a>. It was an OpenSource project and was a big win for the community. But now it's a commercial tool (<a href="https://robovm.com/robovm-acquired-by-world-leader-in-cross-platform-mobile-xamarin/">read more</a>). This has no impact for us, but means that we can't offer an out-of-the-box OpenSource solution. </p>
<p>JavaFXPorts also works without RoboVM and there are plans for a <a href="http://gluonhq.com/gluon-supports-multiple-jvms/">JVM running on mobile devices</a>, but this won't solve the problem that you need access to device features/APIs. But we'll see what happens in the next few months.</p>
<p>We had some fun in the last few weeks because we tuned our application frame for mobile devices. A mobile application has some specific characteristics and isn't a 1:1 desktop application. A desktop application usually has a menubar and a toolbar. The same app on a mobile device shouldn't use a menubar or toolbar. It should offer a hamburger button which offers a custom menu. Also the style of the controls should be different on mobile devices, e.g. Tabsets.</p>
<p>There are two interesting projects which offer custom mobile controls. The first is a commercial product, from Gluon and the second one is <a href="http://jfoenix.com/">JFoenix</a> and it's OpenSource (LGPL). We took JFoenix because it met our requirements and JVx is OpenSource.</p>
<p>We have some screenshots in older posts: </p>
<ul>
<li><a href="http://blog.sibvisions.com/2015/10/21/code-once-run-anywhere/">Code once. Run anywhere</a></li>
<li><a href="http://blog.sibvisions.com/2015/10/28/details-about-live-css-hacking/">Live CSS hacking</a></li>
</ul>
<h4 style="padding-top: 15px">Resume</h4>
<p>JavaFX has potential to rule the Java UI world, but it needs an official commitment/statement from Oracle. Now it's unclear if JavaFX is the right UI technology for the future.</p>
<p>We hope that JavaFX is the right toolkit, but we aren't sure. Our investment was risky and high, but no risk - no fun. The results are awesome!</p>
<p>Thanks to JVx the UI technology is not important for us, because if JavaFX won't make the race, we still have Swing or vaadin. It's important to be UI technology independent because it saves time and money and is future save.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/11/23/the-future-of-javafx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VaadinUI without web.xml</title>
		<link>https://blog.sibvisions.com/2015/08/20/vaadinui-without-web-xml/</link>
		<comments>https://blog.sibvisions.com/2015/08/20/vaadinui-without-web-xml/#comments</comments>
		<pubDate>Thu, 20 Aug 2015 09:41:47 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=4905</guid>
		<description><![CDATA[We've added some annotations to our vaadin UI to support UI configuration without web.xml (deployment descriptor).
Check this:

@Push
@Widgetset&#40;value = &#34;com.sibvisions.rad.ui.vaadin.ext.ui.Widgetset&#34;&#41;
@Configuration&#40;&#123;@Parameter&#40;name = &#34;main&#34;, value = &#34;MinimalApplication$MyApplication&#34;&#41;&#125;&#41;
@SuppressWarnings&#40;&#34;serial&#34;&#41;
public class MinimalApplication extends VaadinUI
&#123;
&#160; &#160; @WebServlet&#40;value = &#123;&#34;/minimal/*&#34;, &#34;/VAADIN/*&#34;&#125;, asyncSupported = true&#41;
&#160; &#160; @VaadinServletConfiguration&#40;productionMode = false, ui = MinimalApplication.class&#41;
&#160; &#160; public static class Servlet extends VaadinServlet 
&#160; &#160; &#123;&#125;
&#160; &#160; public [...]]]></description>
			<content:encoded><![CDATA[<p>We've added some annotations to our vaadin UI to support UI configuration without web.xml (deployment descriptor).</p>
<p>Check this:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">@Push<br />
@Widgetset<span class="br0">&#40;</span>value <span class="sy0">=</span> <span class="st0">&quot;com.sibvisions.rad.ui.vaadin.ext.ui.Widgetset&quot;</span><span class="br0">&#41;</span><br />
@Configuration<span class="br0">&#40;</span><span class="br0">&#123;</span>@Parameter<span class="br0">&#40;</span>name <span class="sy0">=</span> <span class="st0">&quot;main&quot;</span>, value <span class="sy0">=</span> <span class="st0">&quot;MinimalApplication$MyApplication&quot;</span><span class="br0">&#41;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><br />
@SuppressWarnings<span class="br0">&#40;</span><span class="st0">&quot;serial&quot;</span><span class="br0">&#41;</span><br />
<span class="kw1">public</span> <span class="kw1">class</span> MinimalApplication <span class="kw1">extends</span> VaadinUI<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; @WebServlet<span class="br0">&#40;</span>value <span class="sy0">=</span> <span class="br0">&#123;</span><span class="st0">&quot;/minimal/*&quot;</span>, <span class="st0">&quot;/VAADIN/*&quot;</span><span class="br0">&#125;</span>, asyncSupported <span class="sy0">=</span> <span class="kw2">true</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; @VaadinServletConfiguration<span class="br0">&#40;</span>productionMode <span class="sy0">=</span> <span class="kw2">false</span>, ui <span class="sy0">=</span> MinimalApplication.<span class="kw1">class</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">class</span> Servlet <span class="kw1">extends</span> VaadinServlet <br />
&nbsp; &nbsp; <span class="br0">&#123;</span><span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">class</span> MyApplication <span class="kw1">extends</span> Application<br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">public</span> MyApplication<span class="br0">&#40;</span>UILauncher pLauncher<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">super</span><span class="br0">&#40;</span>pLauncher<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setName<span class="br0">&#40;</span><span class="st0">&quot;JVx application&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setLayout<span class="br0">&#40;</span><span class="kw1">new</span> UIBorderLayout<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; add<span class="br0">&#40;</span><span class="kw1">new</span> UILabel<span class="br0">&#40;</span><span class="st0">&quot;Hello JVx' vaadinUI&quot;</span><span class="br0">&#41;</span>, UIBorderLayout.<span class="me1">CENTER</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>The example demonstrates a minimalistic JVx application with vaadin UI. It's like a standard vaadin application with one additional annotation:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">@Configuration<span class="br0">&#40;</span><span class="br0">&#123;</span>@Parameter<span class="br0">&#40;</span>name <span class="sy0">=</span> <span class="st0">&quot;main&quot;</span>, value <span class="sy0">=</span> <span class="st0">&quot;MinimalApplication$MyApplication&quot;</span><span class="br0">&#41;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</div>
<p>The main parameter defines the JVx application class. It's the inner class <em>MyApplication</em>, in our example.</p>
<p>It's that easy!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/08/20/vaadinui-without-web-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application Coder</title>
		<link>https://blog.sibvisions.com/2015/05/11/application-coder/</link>
		<comments>https://blog.sibvisions.com/2015/05/11/application-coder/#comments</comments>
		<pubDate>Mon, 11 May 2015 08:00:09 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JDT]]></category>
		<category><![CDATA[jquery-ui]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Vaadin]]></category>
		<category><![CDATA[vaadinUI]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=4352</guid>
		<description><![CDATA[This article is about our new Research project: Application Coder.
The application is a very simple Java Code Editor. It shows a tree with Java files and has a Code Editor for modifying files. The code editor is the popular Ace Editor and we use Eclipse JDT for java compilation. The application was written as standard [...]]]></description>
			<content:encoded><![CDATA[<p>This article is about our new Research project: <strong>Application Coder</strong>.</p>
<p>The application is a very simple Java Code Editor. It shows a tree with Java files and has a Code Editor for modifying files. The code editor is the popular <a href="http://ace.c9.io/">Ace Editor</a> and we use <a href="https://eclipse.org/jdt/">Eclipse JDT</a> for java compilation. The application was written as standard <a href="http://sourceforge.net/projects/jvx/">JVx application</a> with vaadin UI.</p>
<p>We made tests as single-page vaadin application, embedded with iframes and embedded with div areas. All versions work without problems but the last one is preferred. If you <a href="https://vaadin.com/book/vaadin7/-/page/advanced.embedding.html">embedd a vaadin application</a> with divs, it's a little bit tricky because you have to configure the client-side on your own, but you get full access to the whole html page. This wouldn't be possible if you use an iframe because you can't access the main html page.</p>
<p>Some cool features of our editor are: <em>error annotations</em> and <em>error markers</em>. And the best feature is our <strong>LIVE Preview</strong> of code changes!</p>
<p><div id="attachment_4361" class="wp-caption aligncenter nomargin" style="width: 310px"><a href="http://blog.sibvisions.com/wp-content/uploads/2015/05/codererror.png" rel="lightbox[4352]"><img src="http://blog.sibvisions.com/wp-content/uploads/2015/05/codererror-300x244.png" alt="Annotations and marker" title="Annotations and marker" width="300" height="244" class="size-medium wp-image-4361" /></a><p class="wp-caption-text">Annotations and marker</p></div><br />
Watch this video:</p>
<p><center><div class="wp-caption aligncenter nomargin" style="width: 570px"><iframe width="560" height="315" src="https://www.youtube.com/embed/tcz8cl0Y7ns" frameborder="0" allowfullscreen></iframe><p class="wp-caption-text">Application coder</p></div><br />
</center>The application coder is not only a Java code editor, it was designed especially for JVx applications, because it groups client code and business logic. The preview also starts a JVx application and LIVE preview reloads the application.</p>
<p>Our coder application has a push mechanism and reloads every preview window automatically and immediate after compilation.</p>
<p>Above video shows multiple instances of our coder application, embedded in divs and it's possible to drag around and resize the applications (thanks to <a href="https://jqueryui.com/resizable/">jquery-ui</a>).</p>
<p>The application is a perfect showcase of JVx because it's not a database application as many other JVx applications. We've used vaadin, jquery-ui and vaadin-addons to create a great UX. JVx is technology independent and open for other technologies.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/05/11/application-coder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Style vaadin menubar popups</title>
		<link>https://blog.sibvisions.com/2015/04/07/style-vaadin-menubar-popups/</link>
		<comments>https://blog.sibvisions.com/2015/04/07/style-vaadin-menubar-popups/#comments</comments>
		<pubDate>Tue, 07 Apr 2015 09:00:04 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=4112</guid>
		<description><![CDATA[Our new application frame has two different vaadin menubars. One for the application menu and one as "hidden" menubar for the user options.
Here's a merged screenshot of both menubars:
As you can see, the left popup is dark and the right popup is bright. Usually, vaadin doesn't allow custom "additional" style definitions for menubar popups. The [...]]]></description>
			<content:encoded><![CDATA[<p>Our new application frame has two different vaadin menubars. One for the application menu and one as "hidden" menubar for the user options.</p>
<p>Here's a merged screenshot of both menubars:</p>
<div id="attachment_4113" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.sibvisions.com/wp-content/uploads/2015/04/vaadin_menu-popup.png" rel="lightbox[4112]"><img src="http://blog.sibvisions.com/wp-content/uploads/2015/04/vaadin_menu-popup-300x226.png" alt="Menubar popup" title="vaadin_menu-popup" width="300" height="226" class="size-medium wp-image-4113" /></a><p class="wp-caption-text">Menubar popup</p></div>
<p>As you can see, the left popup is dark and the right popup is bright. Usually, vaadin doesn't allow custom "additional" style definitions for menubar popups. The default style name is:</p>
<p><strong>v-menubar-popup</strong></p>
<p>The name is defined in the class <em>com.vaadin.shared.ui.menubar.MenuBarState</em> as </p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">primaryStyleName <span class="sy0">=</span> <span class="st0">&quot;v-menubar&quot;</span></div>
</div>
<p>If you want to add an additional style class, it's simply not possible because the client implementation (<em>com.vaadin.client.ui.VMenuBar</em>) sets the primary style name, from the menubar, as style name for the popup overlay. The only thing you can do is, to change the primary stylename of your menubar. The problem is that you have to define all styles for the menubar-popup and menuitems, submenus, ... again in your style file. We tried it but it was horrible because you can't easily change the theme.</p>
<p>We tried to find a solution without changing vaadin client. We tried to set a primary style name as e.g. <strong>customstylepopup v-window-popup</strong>. But the client menu implementation has following code in getPrimaryStyleName:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="kw1">protected</span> <span class="kw1">static</span> <span class="kw3">String</span> getStylePrimaryName<span class="br0">&#40;</span><span class="kw3">Element</span> elem<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">String</span> fullClassName <span class="sy0">=</span> getStyleName<span class="br0">&#40;</span>elem<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; <span class="co1">// The primary style name is always the first token of the full CSS class</span><br />
&nbsp; <span class="co1">// name. There can be no leading whitespace in the class name, so it's not</span><br />
&nbsp; <span class="co1">// necessary to trim() it.</span><br />
&nbsp; <span class="kw4">int</span> spaceIdx <span class="sy0">=</span> fullClassName.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">' '</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>spaceIdx <span class="sy0">&gt;=</span> 0<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> fullClassName.<span class="me1">substring</span><span class="br0">&#40;</span>0, spaceIdx<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="kw1">return</span> fullClassName<span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>(it makes sense to do this!)</p>
<p>So, it wasn't possible with simple tricks. The only solution - we found - was an extension of VMenuBar to override getPrimaryStyleName and return a custom style class concatenated with the default style class, something like this:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">@Override<br />
<span class="kw1">public</span> <span class="kw3">String</span> getStylePrimaryName<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>popupStyle <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> popupStyle <span class="sy0">+</span> <span class="st0">&quot; &quot;</span> <span class="sy0">+</span> <span class="kw1">super</span>.<span class="me1">getStylePrimaryName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">super</span>.<span class="me1">getStylePrimaryName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>It wasn't our preferred solution, but we had another hack for <a href="http://blog.sibvisions.com/2014/09/15/add-ids-to-your-vaadin-menu-items/">setting ids of menu items</a>. So it wasn't hard to add another hack for the style name <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>With our modification, it'll be possible to add custom style classes to menubar popups:</p>
<div id="attachment_4119" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.sibvisions.com/wp-content/uploads/2015/04/vaadin_popup_stylenames.png" rel="lightbox[4112]"><img src="http://blog.sibvisions.com/wp-content/uploads/2015/04/vaadin_popup_stylenames-300x226.png" alt="Custom style names" title="vaadin_popup_stylenames" width="300" height="226" class="size-medium wp-image-4119" /></a><p class="wp-caption-text">Custom style names</p></div>
<p>The <a href="http://sourceforge.net/p/jvx/code/HEAD/tree/trunk/java/vaadin/src/com/sibvisions/rad/ui/vaadin/ext/ui/">source code</a> is available on sourceforge.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/04/07/style-vaadin-menubar-popups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From Swing to Vaadin?</title>
		<link>https://blog.sibvisions.com/2015/03/31/from-swing-to-vaadin/</link>
		<comments>https://blog.sibvisions.com/2015/03/31/from-swing-to-vaadin/#comments</comments>
		<pubDate>Tue, 31 Mar 2015 15:05:44 +0000</pubDate>
		<dc:creator>mhandsteiner</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Vaadin]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=4050</guid>
		<description><![CDATA[Some days ago, vaadin released a Tutorial for Swing developers. It's a hitchhiker's guide to convert a Swing app to modern web app. It's a must-read if you plan to replace/migrate or modernize your Swing application.
We were mentioned in the last paragraph with our JVx framework, as possible conversion strategy. Thanks for that!
I want to [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago, vaadin released a <a href="https://vaadin.com/wiki/-/wiki/Main/Vaadin+tutorial+for+Swing+developers">Tutorial for Swing developers</a>. It's <strong>a hitchhiker's guide to convert a Swing app to modern web app</strong>. It's a must-read if you plan to replace/migrate or modernize your Swing application.</p>
<p>We were mentioned in the last paragraph with our JVx framework, as possible conversion strategy. Thanks for that!</p>
<p>I want to hook in at this paragraph, because I totally agree with the rest of the tutorial.</p>
<p>It's true that a wrapper has pros, cons and limitations. You can't wrap everything. Sure you could try, but it needs so many developers and doesn't make sense because a wrapper shouldn't copy the underlying technology. The more features the wrapper has, the more problems will occur with new (different) technologies. The wrapper should be a subset of all technologies. But a subset is limited in functionality!</p>
<p>A wrapper should be focused on a specific domain, e.g. database/data driven applications or game development. A wrapper for multiple domains will fail!</p>
<p>I don't know many working wrappers. There were many attempts to create (UI) wrappers, in the past, but most were stopped because of complexity or the developers had other interests (if project was open source).</p>
<p>JVx is one working solution and in my opinion the most complete one because it contains an UI wrapper, has implementations for different technologies like Swing, JavaFX, Headless and Vaadin. The APIs are bulletproof and there are native applications for Android and iOS. JVx is a generic solution and doesn't generate additional source code.<br />
But it has more than that, because it's full-stack and comes with different application frames for <a href="https://www.youtube.com/watch?v=zLEWmqqhowc">desktop</a>, <a href="http://blog.sibvisions.com/2015/03/30/vaadin-application-frame-design/">web</a> and mobile applications.</p>
<p><strong>But what is your advantage if you're using a wrapper?</strong></p>
<p>You're (GUI) technology independent.</p>
<p>An example:</p>
<p>Your current business application is a Swing application and you plan the migration to a modern technology.<br />
Your first migration decision should be: Desktop or Web<br />
<em>Next decision:</em> which UI framework<br />
<em>Optional:</em> Mobile support?</p>
<p><strong>If your platform decision was:</strong> Desktop, then it's very simple to find the right UI framework: JavaFX and try <a href="http://javafxports.org/page/home">JavaFXPorts</a> for mobile support.<br />
<em>Fact:</em> No real web and possible problems with mobile support</p>
<p><strong>If your platform decision was:</strong> Web, then it's not an easy task to find the right UI framework, but <a href="http://vaadin.com/">vaadin</a> should be the first choice because it's comparable to Swing and hides web technology for you!<br />
<em>Fact:</em> No desktop but mobile support</p>
<p>Every decision has pros and cons. If you bet on one technology stack, you're fixed to this technology stack. In our example it was JavaFX or vaadin. And what will be the next preferred UI technology after JavaFX or vaadin?<br />
You'll have the same problems again and it's never easy to migrate a (business) application.</p>
<p>You should bet on a technology independent solution, to be prepared for the future!<br />
Means, you should use a wrapper. But don't use a wrapper which hides the technology from you. It should be possible to access the technology directly - if needed or if it's not important to be technology independent. </p>
<p>Sometimes it's not possible to be technology independent, e.g. some custom controls aren't available for all technologies.</p>
<p>The wrapper should allow technology dependent and independent development without any limitations!</p>
<p><strong>Does it make sense to use the same application with different technologies?</strong></p>
<p>Yes, but...</p>
<p>It's not a good idea to use e.g. Swing AND JavaFX because both technologies are desktop toolkits. But it makes sense to use JavaFX for your backend application and vaadin for your frontend or your mobile devices. </p>
<p>It's also a good idea to create only one application that works as desktop, web and mobile application - the same application. But show different screens/views on different platforms.</p>
<p>There's no big difference between desktop and a standard browser because resolution of a desktop pc is the same. A mobile browser has limited space and you shouldn't use the same screen/view on a mobile device as on the desktop pc.</p>
<p><em><strong>Example</strong></em><br />
We use an ERP backend application to manage vacations. The appliation has about 10 screens for resource management, master data management and accounting. The application runs as desktop application with JavaFX. The same application runs in desktop browsers with 3 screens because the web frontend doesn't offer master data management and accounting. The same application runs on mobile devices with only 1 screen because mobile devices are used from employees to enter and view vacations.</p>
<p>We have only one application, started with different UI technologies and with different screens/views.<br />
<span style="height: 15px;"/><br />
It would be possible to create 3 different applications with different screens and with dependencies between the applications and ... (complex to maintain, 3 different projects, application frame x 3).</p>
<p>If you'll create a "native" vaadin application and a JavaFX application you'll need different development teams with different know-how.</p>
<p>Don't waste time and resources, focus on the real problems of your application. A wrapper hides technology problems and allows fast development with few developers: Win-win situation!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/03/31/from-swing-to-vaadin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vaadin application frame design</title>
		<link>https://blog.sibvisions.com/2015/03/30/vaadin-application-frame-design/</link>
		<comments>https://blog.sibvisions.com/2015/03/30/vaadin-application-frame-design/#comments</comments>
		<pubDate>Mon, 30 Mar 2015 15:06:56 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Vaadin]]></category>
		<category><![CDATA[vaadinUI]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=4040</guid>
		<description><![CDATA[Many of you probably know our application frame, for web applications: One application, different styles
We had a MDI variant for legacy applications with internal frames for screens. This is useful for applications with many screens and many records. The internal frames help to compare records from one screen with records from other screens.
For modern user [...]]]></description>
			<content:encoded><![CDATA[<p>Many of you probably know our application frame, for web applications: <a href="http://blog.sibvisions.com/2014/09/17/one-application-different-styles/">One application, different styles</a></p>
<p>We had a MDI variant for legacy applications with internal frames for screens. This is useful for applications with many screens and many records. The internal frames help to compare records from one screen with records from other screens.</p>
<p>For modern user interfaces, we use the SDI option. It looks fresh and simple and is great for applications with a small number of screens, because a scrolling menu is not nice - sure it will scroll if needed.</p>
<p>But what about application with e.g. 60 screens. Is MDI the only option? Yes and No, because we didn't have a variant for that kind of applications.... but now we have.</p>
<p>It's a mix of MDI and SDI, with a little bit CI:</p>
<div id="attachment_4043" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.sibvisions.com/wp-content/uploads/2015/03/appframe_v7_4_2.png" rel="lightbox[4040]"><img src="http://blog.sibvisions.com/wp-content/uploads/2015/03/appframe_v7_4_2-300x231.png" alt="Application frame SDI with menu" title="appframe_v7_4_2" width="300" height="231" class="size-medium wp-image-4043" /></a><p class="wp-caption-text">Application frame SDI with menu</p></div>
<p>The application frame is still the same as before, but with a different option. The name of the option is corporation, because the UI is meant for applications with many screens. It's still SDI with modal popups, because it shouldn't be too legacy!</p>
<p>Oh, do you see the small buttons on top/right? We use the FontAwesome feature of vaadin 7.2. We're already using vaadin 7.4.2 for our JVx vaadin UI!</p>
<p>We now have one application frame for many different application styles (I don't talk about visual attributes). The application frame is responsive and works well on mobile devices.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/03/30/vaadin-application-frame-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JVx and JavaFX (fasten your seat belts)</title>
		<link>https://blog.sibvisions.com/2015/02/17/jvx-and-javafx-fasten-your-seat-belts/</link>
		<comments>https://blog.sibvisions.com/2015/02/17/jvx-and-javafx-fasten-your-seat-belts/#comments</comments>
		<pubDate>Tue, 17 Feb 2015 13:25:35 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Vaadin]]></category>
		<category><![CDATA[vaadinUI]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=3737</guid>
		<description><![CDATA[Today is a great day, because I'm able to write about our latest Research Project.
It has to do with JavaFX and JVx - what else.
If you remember one of my blog postings in 2013, you know that we tried to implement our JVx UI with JavaFX. Long story, short: Not possible with one master thesis.
But... [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Today is a great day</strong>, because I'm able to write about our latest Research Project.<br />
It has to do with JavaFX and JVx - what else.</p>
<p>If you remember one of my <a href="http://blog.sibvisions.com/2013/06/22/whats-jvx-in-2013/">blog postings in 2013</a>, you know that we tried to implement our JVx UI with JavaFX. Long story, short: <em>Not possible with one master thesis</em>.</p>
<p>But... we always try to reach our goals and it's an honor to tell you that we're back on the track.<br />
<center><em>Our JavaFX UI is one of the coolest things on this IT planet.</em></center></p>
<p>It's cool because of JavaFX. It's APIs are still not perfect and the overall performance could be better but it has so many awesome things. Two of them are styling via CSS and animations. JavaFX is the official replacement for Swing and it has potential to bring back "write once run anywhere". We don't know if JavaFX will be the holy grail for desktop application development but there's nothing comparable in the Java world.<br />
To be honest, it's not a problem for us because our JVx is (UI) technology independent and if JavaFX won't do it, we'll implement the next UI toolkit for JVx.</p>
<p><strong>... but back to the topic</strong></p>
<p>You should already know that JVx is a Full-stack application framework for building database (ERP) software. It's GUI technology independent and we've different UI implementations. The most important ones are based on Swing and <a href="http://www.vaadin.com/">vaadin</a>. We also have native Android and iOS support and our applications run on embedded devices as well. Our applications don't need an application server to work properly because we have a plain socket server as well (IoT ready).</p>
<p>Our preferred Java UI technology was and is still Swing, because it's feature rich and you can build every kind of application without bigger problems. The problem with swing is that it's old and not maintained from Oracle. Sure it will work with future Java releases without bigger problems (hopefully) but you can't use modern development techniques or create fancy and fresh UIs with less effort. A standard Swing application looks boring and cold. Sure, it's possible to pimp a swing application with lots of pictures or nice looking LaFs, but it's not fun.</p>
<p>Swing development is like software development in the stone-age, compared to state-of-the-art web development. If you do web development, you have CSS3 and HTML5 and some nice designed UI frameworks. I won't say that you're faster or that web development is better but it's easier to build nice looking UIs. I'm not a big fan of classical web development because most applications are horrible to maintain, there are soo many different frameworks and you can't be sure that your investment is future-proof because many frameworks don't survive the first year. But everything depends on knowledge and the right framework - for sure.</p>
<p>IMO it's better to use one framework that solves most of application relevant problems - if it exists. If we talk about web applications, I recommend vaadin because it's feature rich, just works, is very polished and is licensed under Apache 2.0. The community is active and great support is available!<br />
Sure, there are some other frameworks like GXT or extJS from <a href="http://www.sencha.com/">Sencha</a>, but the license could be a problem if you build commercial applications. Don't forget <a href="http://eclipse.org/rap/">RAP</a>, but it's not trivial to start with the whole Eclipse ecosystem.</p>
<p>I'm talking about (enterprise) application development and not about webpage or webservice development. I would recommend pure HTML5 and CSS3 with one or two smaller javascript libs for developing fancy "webpages", or php instead of Java. If Java and "webpages", PrimeFaces is a good decision.</p>
<p><em>Soo, if Swing is "dead" and web development is hard, what should we use for (enterprise) application development?</em></p>
<p>If you develop for the desktop, try to start with JavaFX becasue it's maintained and has potential for mobile devices.<br />
If you develop web applications, use vaadin.<br />
<center><em>(This is my personal opinion, mixed with my technology and project experience)</em></center></p>
<p><strong>And why should you use JVx?</strong></p>
<p>JVx bundles all together in one independent framework (it's still small and easy to learn). You'll be independent of the underlying UI technology. Write your application once and start it with different UI technologies or use it on different devices without problems. Your investment is future-proof. JVx is open source and licensed under Apache 2.0. JVx doesn't hide the underlying technology. It's always possible to use features from the technology if you want. If you use a UI without abstraction, you can't switch to another UI easily without rewriting most parts of the UI. If you start with e.g. JavaFX and if Oracle will abandon JavaFX, will you rewrite the application?</p>
<p>You can compare the concept of JVx with SLF4J, but with a different use-case: <em>(enterprise) application development</em></p>
<p><strong>And what about JavaFX?</strong></p>
<p>I like JavaFX because of, IMO, 5 great things: <strong>scene graph</strong>, <strong>CSS styling</strong>, <strong>Animations</strong>, <strong>Web engine</strong> and <strong>the community</strong>. All other things are important and useful but not essential for real-world applications (vs. Swing). It's not possible to compare Swing with JavaFX because JavaFX was written from scratch and Swing was based on AWT. Sure, both toolkits are UI toolkits <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but with different concepts.</p>
<p>JavaFX bridges the gap between desktop and web development. It's still a toolkit for desktop applications but with most advantages of web development. It's possible to create fancy applications without headache. There are cool tools like <a href="http://www.oracle.com/technetwork/java/javase/downloads/javafxscenebuilder-info-2157684.html">Scene Builder</a> or <a href="http://fxexperience.com/scenic-view/">ScenicView</a>. IDE support is getting better and developing controls is not too hard.</p>
<p>Sounds too good? JavaFX is on the right track and ready for real-world applications.</p>
<p>That was enough for us to start a JavaFX UI for JVx. It's the only framework which allows switching between Swing, Web, JavaFX or native mobile. Sounds unbelievable? Here's is our first video with our JavaFX implementation. It demonstrates the full power of JVx and JavaFX. </p>
<p>The video starts with our good old Swing UI. The same application will be shown as web application in a Chrome browser. And finally it will run as JavaFX application. You should carefully check the JavaFX application because it has an embedded browser that shows the same application, with a different UI technology - at the same time. Don't miss the animations <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><center><em>It's a world premiere!</em></center></p>
<p><center><div class="wp-caption aligncenter nomargin" style="width: 570px"><iframe width="560" height="315" src="https://www.youtube.com/embed/zLEWmqqhowc" frameborder="0" allowfullscreen></iframe><p class="wp-caption-text">JVx and JavaFX</p></div><br />
</center><br />
We know that the styling is not really cool but we're currently in the development phase and aren't finished... be tolerant <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/02/17/jvx-and-javafx-fasten-your-seat-belts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
