---
title: Using Parameters With Views
order: 14
layout: page
---

[[using-parameters-with-views]]
= Using parameters with Views

When the Navigator API is in use, one can pass "parameters" to Views in
the URI fragment.

The remainder of the fragment that is left after the (longest) view name
matched is removed, is considered to be "fragment parameters". These are
passed to the View in question, which can then handle the parameter(s).
Basically: `#viewname/parameters`.

Continuing from the basic navigation example, let's make a View that
displays a message passed as a fragment parameter:

[source,java]
....
import com.vaadin.navigator.View;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;

public class MessageView extends Panel implements View {
    public static final String NAME = "message";

    public MessageView() {
        super(new VerticalLayout());
        setCaption("Messages");
    }

    @Override
    public void enter(ViewChangeEvent event) {
       if(event.getParameters() != null){
           // split at "/", add each part as a label
           String[] msgs = event.getParameters().split("/");
           for (String msg : msgs) {
               ((Layout)getContent()).addComponent(new Label(msg));
           }
       }
    }
}
....

Let's register `MessageView` along with the other Views:

[source,java]
....
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.Navigator.SimpleViewDisplay;
import com.vaadin.server.Page;
import com.vaadin.server.WrappedRequest;
import com.vaadin.ui.UI;

public class NavigationtestUI extends UI {

    @Override
    public void init(VaadinRequest request) {
        // Create Navigator, make it control the ViewDisplay
        Navigator navigator = new Navigator(this, this);

        // Add some Views
        navigator.addView(MainView.NAME, new MainView()); // no fragment

        // #count will be a new instance each time we navigate to it, counts:
        navigator.addView(CountView.NAME, CountView.class);

        // #message adds a label with whatever it receives as a parameter
        navigator.addView(MessageView.NAME, new MessageView());
    }
}
....

Finally, we'll add two labels to the MainView so we don't have to type
in the browsers address-bar to try it out:

[source,java]
....
import com.vaadin.navigator.View;
import com.vaadin.server.ExternalResource;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;

public class MainView extends Panel implements View {

    public static final String NAME = "";

    public MainView() {

        VerticalLayout layout = new VerticalLayout();

        Link lnk = new Link("Count", new ExternalResource("#!" + CountView.NAME));
        layout.addComponent(lnk);

        lnk = new Link("Message: Hello", new ExternalResource("#!"
                + MessageView.NAME + "/Hello"));
        layout.addComponent(lnk);

        lnk = new Link("Message: Bye", new ExternalResource("#!"
                + MessageView.NAME + "/Bye/Goodbye"));
        layout.addComponent(lnk);
        setContent(layout);
    }

    @Override
    public void enter(ViewChangeEvent event) {

    }
}
....

Simple! Let's just conclude by noting that it's usually a good idea to
make sure the parameters are URI encoded, or the browser might
disapprove.
option>
<option value='Temp_XGC_URI_Resolution'>Temp_XGC_URI_Resolution</option>
<option value='archive'>archive</option>
<option value='dirkx'>dirkx</option>
<option value='fop-0_14_0'>fop-0_14_0</option>
<option value='fop-0_14_0_regions'>fop-0_14_0_regions</option>
<option value='fop-0_17_0_batikSVG'>fop-0_17_0_batikSVG</option>
<option value='fop-0_20_2-maintain'>fop-0_20_2-maintain</option>
<option value='fop-0_90'>fop-0_90</option>
<option value='fop-0_91'>fop-0_91</option>
<option value='fop-0_92'>fop-0_92</option>
<option value='fop-0_93'>fop-0_93</option>
<option value='fop-0_94'>fop-0_94</option>
<option value='fop-0_95'>fop-0_95</option>
<option value='fop-1_0'>fop-1_0</option>
<option value='fop-1_1'>fop-1_1</option>
<option value='fop-1_1old'>fop-1_1old</option>
<option value='fop-1_1rc1'>fop-1_1rc1</option>
<option value='fop-2.6'>fop-2.6</option>
<option value='fop-2_0'>fop-2_0</option>
<option value='fop-2_1'>fop-2_1</option>
<option value='fop-2_10'>fop-2_10</option>
<option value='fop-2_11'>fop-2_11</option>
<option value='fop-2_2'>fop-2_2</option>
<option value='fop-2_3'>fop-2_3</option>
<option value='fop-2_4'>fop-2_4</option>
<option value='fop-2_5'>fop-2_5</option>
<option value='fop-2_6'>fop-2_6</option>
<option value='fop-2_7'>fop-2_7</option>
<option value='fop-2_8'>fop-2_8</option>
<option value='fop-2_9'>fop-2_9</option>
<option value='foray-font'>foray-font</option>
<option value='inlineblock'>inlineblock</option>
<option value='jgoncalves-pdfa-extension-fix'>jgoncalves-pdfa-extension-fix</option>
<option value='main'>main</option>
<option value='maven'>maven</option>
<option value='release-0-13-0'>release-0-13-0</option>
<option value='skynavga/configure-sonar-support'>skynavga/configure-sonar-support</option>
<option value='temp/ssteiner-java23'>temp/ssteiner-java23</option>
<option value='temp/ssteiner-pdfbox3'>temp/ssteiner-pdfbox3</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Apache XML Graphics FOP: https://github.com/apache/xmlgraphics-fop</td><td class='sub right'>www-data</td></tr></table>
<table class='tabs'><tr><td>
<a href='/xmlgraphics-fop.git/about/?h=Temp_PDF_in_PDF'>about</a><a href='/xmlgraphics-fop.git/?h=Temp_PDF_in_PDF'>summary</a><a href='/xmlgraphics-fop.git/refs/?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>refs</a><a href='/xmlgraphics-fop.git/log/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF'>log</a><a class='active' href='/xmlgraphics-fop.git/tree/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>tree</a><a href='/xmlgraphics-fop.git/commit/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>commit</a><a href='/xmlgraphics-fop.git/diff/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>diff</a><a href='/xmlgraphics-fop.git/stats/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF'>stats</a></td><td class='form'><form class='right' method='get' action='/xmlgraphics-fop.git/log/src/java/org/apache/fop/area/inline/Character.java'>
<input type='hidden' name='h' value='Temp_PDF_in_PDF'/><input type='hidden' name='id' value='680e4d2637cf021dfedf067a12b7ed38f704af40'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/xmlgraphics-fop.git/tree/?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>root</a>/<a href='/xmlgraphics-fop.git/tree/src?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>src</a>/<a href='/xmlgraphics-fop.git/tree/src/java?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>java</a>/<a href='/xmlgraphics-fop.git/tree/src/java/org?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>org</a>/<a href='/xmlgraphics-fop.git/tree/src/java/org/apache?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>apache</a>/<a href='/xmlgraphics-fop.git/tree/src/java/org/apache/fop?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>fop</a>/<a href='/xmlgraphics-fop.git/tree/src/java/org/apache/fop/area?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>area</a>/<a href='/xmlgraphics-fop.git/tree/src/java/org/apache/fop/area/inline?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>inline</a>/<a href='/xmlgraphics-fop.git/tree/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>Character.java</a></div><div class='content'>blob: 2135162e655e35b0e76d5416e87891c373bbc2c7 (<a href='/xmlgraphics-fop.git/plain/src/java/org/apache/fop/area/inline/Character.java?h=Temp_PDF_in_PDF&amp;id=680e4d2637cf021dfedf067a12b7ed38f704af40'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
<a id='n11' href='#n11'>11</a>
<a id='n12' href='#n12'>12</a>
<a id='n13' href='#n13'>13</a>
<a id='n14' href='#n14'>14</a>
<a id='n15' href='#n15'>15</a>
<a id='n16' href='#n16'>16</a>
<a id='n17' href='#n17'>17</a>
<a id='n18' href='#n18'>18</a>
<a id='n19' href='#n19'>19</a>
<a id='n20' href='#n20'>20</a>
<a id='n21' href='#n21'>21</a>
<a id='n22' href='#n22'>22</a>
<a id='n23' href='#n23'>23</a>
<a id='n24' href='#n24'>24</a>
<a id='n25' href='#n25'>25</a>
<a id='n26' href='#n26'>26</a>
<a id='n27' href='#n27'>27</a>
<a id='n28' href='#n28'>28</a>
<a id='n29' href='#n29'>29</a>
<a id='n30' href='#n30'>30</a>
<a id='n31' href='#n31'>31</a>
<a id='n32' href='#n32'>32</a>
<a id='n33' href='#n33'>33</a>
<a id='n34' href='#n34'>34</a>
<a id='n35' href='#n35'>35</a>
<a id='n36' href='#n36'>36</a>
<a id='n37' href='#n37'>37</a>
<a id='n38' href='#n38'>38</a>
<a id='n39' href='#n39'>39</a>
<a id='n40' href='#n40'>40</a>
<a id='n41' href='#n41'>41</a>
<a id='n42' href='#n42'>42</a>
<a id='n43' href='#n43'>43</a>
<a id='n44' href='#n44'>44</a>
<a id='n45' href='#n45'>45</a>
<a id='n46' href='#n46'>46</a>
<a id='n47' href='#n47'>47</a>
<a id='n48' href='#n48'>48</a>
<a id='n49' href='#n49'>49</a>
<a id='n50' href='#n50'>50</a>
<a id='n51' href='#n51'>51</a>
<a id='n52' href='#n52'>52</a>
<a id='n53' href='#n53'>53</a>
<a id='n54' href='#n54'>54</a>
<a id='n55' href='#n55'>55</a>
<a id='n56' href='#n56'>56</a>
<a id='n57' href='#n57'>57</a>
<a id='n58' href='#n58'>58</a>
<a id='n59' href='#n59'>59</a>
<a id='n60' href='#n60'>60</a>
<a id='n61' href='#n61'>61</a>
<a id='n62' href='#n62'>62</a>
<a id='n63' href='#n63'>63</a>
<a id='n64' href='#n64'>64</a>
<a id='n65' href='#n65'>65</a>
<a id='n66' href='#n66'>66</a>
<a id='n67' href='#n67'>67</a>
<a id='n68' href='#n68'>68</a>
<a id='n69' href='#n69'>69</a>
<a id='n70' href='#n70'>70</a>
<a id='n71' href='#n71'>71</a>
<a id='n72' href='#n72'>72</a>
<a id='n73' href='#n73'>73</a>
<a id='n74' href='#n74'>74</a>
<a id='n75' href='#n75'>75</a>
<a id='n76' href='#n76'>76</a>
<a id='n77' href='#n77'>77</a>
<a id='n78' href='#n78'>78</a>
<a id='n79' href='#n79'>79</a>
<a id='n80' href='#n80'>80</a>
<a id='n81' href='#n81'>81</a>
<a id='n82' href='#n82'>82</a>
<a id='n83' href='#n83'>83</a>
<a id='n84' href='#n84'>84</a>
<a id='n85' href='#n85'>85</a>
<a id='n86' href='#n86'>86</a>
<a id='n87' href='#n87'>87</a>
<a id='n88' href='#n88'>88</a>
<a id='n89' href='#n89'>89</a>
</pre></td>
<td class='lines'><pre><code><style>pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="cm">/*</span>
<span class="cm"> * $Id: Character.java,v 1.4 2003/03/05 16:45:43 jeremias Exp $</span>
<span class="cm"> * ============================================================================</span>
<span class="cm"> *                    The Apache Software License, Version 1.1</span>
<span class="cm"> * ============================================================================</span>
<span class="cm"> * </span>
<span class="cm"> * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.</span>
<span class="cm"> * </span>
<span class="cm"> * Redistribution and use in source and binary forms, with or without modifica-</span>
<span class="cm"> * tion, are permitted provided that the following conditions are met:</span>
<span class="cm"> * </span>
<span class="cm"> * 1. Redistributions of source code must retain the above copyright notice,</span>
<span class="cm"> *    this list of conditions and the following disclaimer.</span>
<span class="cm"> * </span>
<span class="cm"> * 2. Redistributions in binary form must reproduce the above copyright notice,</span>
<span class="cm"> *    this list of conditions and the following disclaimer in the documentation</span>
<span class="cm"> *    and/or other materials provided with the distribution.</span>
<span class="cm"> * </span>
<span class="cm"> * 3. The end-user documentation included with the redistribution, if any, must</span>
<span class="cm"> *    include the following acknowledgment: &quot;This product includes software</span>
<span class="cm"> *    developed by the Apache Software Foundation (http://www.apache.org/).&quot;</span>
<span class="cm"> *    Alternately, this acknowledgment may appear in the software itself, if</span>
<span class="cm"> *    and wherever such third-party acknowledgments normally appear.</span>
<span class="cm"> * </span>
<span class="cm"> * 4. The names &quot;FOP&quot; and &quot;Apache Software Foundation&quot; must not be used to</span>
<span class="cm"> *    endorse or promote products derived from this software without prior</span>
<span class="cm"> *    written permission. For written permission, please contact</span>
<span class="cm"> *    apache@apache.org.</span>
<span class="cm"> * </span>
<span class="cm"> * 5. Products derived from this software may not be called &quot;Apache&quot;, nor may</span>
<span class="cm"> *    &quot;Apache&quot; appear in their name, without prior written permission of the</span>
<span class="cm"> *    Apache Software Foundation.</span>
<span class="cm"> * </span>
<span class="cm"> * THIS SOFTWARE IS PROVIDED ``AS IS&#39;&#39; AND ANY EXPRESSED OR IMPLIED WARRANTIES,</span>
<span class="cm"> * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND</span>
<span class="cm"> * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE</span>
<span class="cm"> * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,</span>
<span class="cm"> * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-</span>
<span class="cm"> * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS</span>
<span class="cm"> * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON</span>
<span class="cm"> * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<span class="cm"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF</span>
<span class="cm"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<span class="cm"> * ============================================================================</span>
<span class="cm"> * </span>
<span class="cm"> * This software consists of voluntary contributions made by many individuals</span>
<span class="cm"> * on behalf of the Apache Software Foundation and was originally created by</span>
<span class="cm"> * James Tauber &lt;jtauber@jtauber.com&gt;. For more information on the Apache</span>
<span class="cm"> * Software Foundation, please see &lt;http://www.apache.org/&gt;.</span>
<span class="cm"> */</span><span class="w"> </span>
<span class="kn">package</span><span class="w"> </span><span class="nn">org.apache.fop.area.inline</span><span class="p">;</span>

<span class="kn">import</span><span class="w"> </span><span class="nn">org.apache.fop.render.Renderer</span><span class="p">;</span>

<span class="cm">/**</span>
<span class="cm"> * Single character inline area.</span>
<span class="cm"> * This inline area holds a single character.</span>
<span class="cm"> */</span>
<span class="kd">public</span><span class="w"> </span><span class="kd">class</span> <span class="nc">Character</span><span class="w"> </span><span class="kd">extends</span><span class="w"> </span><span class="n">InlineArea</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="kd">private</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="n">character</span><span class="p">;</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Create a new characater inline area with the given character.</span>
<span class="cm">     *</span>
<span class="cm">     * @param ch the character for this inline area</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="nf">Character</span><span class="p">(</span><span class="kt">char</span><span class="w"> </span><span class="n">ch</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">character</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">ch</span><span class="p">;</span>
<span class="w">    </span><span class="p">}</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Render this inline area.</span>
<span class="cm">     *</span>
<span class="cm">     * @param renderer the renderer to render this character area</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">render</span><span class="p">(</span><span class="n">Renderer</span><span class="w"> </span><span class="n">renderer</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">renderer</span><span class="p">.</span><span class="na">renderCharacter</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
<span class="w">    </span><span class="p">}</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Get the character for this inline character area.</span>
<span class="cm">     *</span>
<span class="cm">     * @return the character</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="nf">getChar</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">character</span><span class="p">;</span>
<span class="w">    </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
