blob: 2f9d7b0543faad5c987384e53ffd1e28e4be4f5b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<document id="expanders">
<properties>
<title>Expanders</title>
</properties>
<body>
<p>
Expanders are often used to present small amounts of information to the user. Since the
information may not be relevant to the user all the time, expanders allow the user to
"collapse" the panel to make more room for other content, similar to rolling up a
window shade. The following example demonstrates the use of the <tt>Expander</tt>
component:
</p>
<application class="org.apache.pivot.wtk.ScriptApplication"
width="220" height="360">
<libraries>
<library>core</library>
<library>wtk</library>
<library>wtk-terra</library>
<library>tutorials</library>
</libraries>
<startup-properties>
<src>/org/apache/pivot/tutorials/navigation/expanders.bxml</src>
</startup-properties>
</application>
<p>
The BXML source for this example is as follows. It declares three expanders contained
in a vertical flow pane, which itself is contained in a scroll pane. The contents of
the expanders are defined in several external BXML files that are included by the main
file:
</p>
<source type="xml" location="org/apache/pivot/tutorials/navigation/expanders.bxml">
<![CDATA[
<Window title="Expanders" maximized="true"
xmlns:bxml="http://pivot.apache.org/bxml"
xmlns="org.apache.pivot.wtk">
<Border styles="{padding:6}">
<ScrollPane horizontalScrollBarPolicy="fill">
<BoxPane orientation="vertical" styles="{fill:true,
padding:{left:2, right:2}}">
<Expander bxml:id="stocksExpander" title="Stocks">
<bxml:include src="stocks.bxml"/>
</Expander>
<Expander bxml:id="weatherExpander" title="Weather" expanded="false">
<bxml:include src="weather.bxml"/>
</Expander>
<Expander bxml:id="calendarExpander" title="Calendar" expanded="false">
<Calendar/>
</Expander>
</BoxPane>
</ScrollPane>
</Border>
</Window>
]]>
</source>
<p>
Since this example does not require any logic, there is no associated Java or script
code.
</p>
</body>
</document>