| <?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. |
| --> |
| |
| <Window title="Multiple Selection on Trees" maximized="true" |
| xmlns:bxml="http://pivot.apache.org/bxml" |
| xmlns:collections="org.apache.pivot.collections" |
| xmlns:content="org.apache.pivot.wtk.content" |
| xmlns="org.apache.pivot.wtk" |
| > |
| <windowStateListeners> |
| function windowOpened(window) { |
| dataTreeView.requestFocus(); |
| } |
| </windowStateListeners> |
| |
| <TablePane styles="{horizontalSpacing:8}"> |
| <columns> |
| <TablePane.Column width="1*"/> |
| <TablePane.Column width="1*"/> |
| </columns> |
| |
| <TablePane.Row height="1*"> |
| <Border styles="{color:10}"> |
| <ScrollPane horizontalScrollBarPolicy="fill_to_capacity"> |
| <TreeView bxml:id="dataTreeView" selectMode="multi"> |
| <nodeRenderer> |
| <content:TreeViewNodeRenderer showIcon="true"/> |
| </nodeRenderer> |
| <treeData> |
| <content:TreeBranch> |
| <content:TreeBranch text="Activity"> |
| <content:TreeBranch text="Games"> |
| <content:TreeNode text="Foosball"/> |
| <content:TreeNode text="A very long game name that just serves to show how a wide tree node behaves"/> |
| <content:TreeNode text="Ping Pong"/> |
| <content:TreeNode text="Air Hockey"/> |
| </content:TreeBranch> |
| <content:TreeBranch text="Sports"> |
| <content:TreeNode text="Baseball"/> |
| <content:TreeNode text="Basketball"/> |
| <content:TreeNode text="Football"/> |
| <content:TreeNode text="Ice Hockey"/> |
| <content:TreeNode text="Soccer"/> |
| <content:TreeNode text="Softball"/> |
| </content:TreeBranch> |
| <content:TreeNode text="Camping"/> |
| <content:TreeNode text="Skiing"/> |
| </content:TreeBranch> |
| <content:TreeBranch text="Occasion"> |
| <content:TreeBranch text="Holidays"> |
| <content:TreeNode text="Christmas"/> |
| <content:TreeNode text="Independence Day"/> |
| <content:TreeNode text="Labor Day"/> |
| <content:TreeNode text="New Year's Day"/> |
| <content:TreeNode text="President's Day"/> |
| <content:TreeNode text="Thanksgiving"/> |
| <content:TreeNode text="Valentine's Day"/> |
| <content:TreeNode text="Veteran's Day"/> |
| </content:TreeBranch> |
| <content:TreeNode text="Anniversary"/> |
| <content:TreeNode text="Birthday"/> |
| <content:TreeNode text="Wedding"/> |
| </content:TreeBranch> |
| <content:TreeBranch text="Location"> |
| <content:TreeNode text="Africa"/> |
| <content:TreeNode text="Antarctica"/> |
| <content:TreeNode text="Asia"/> |
| <content:TreeNode text="Australia"/> |
| <content:TreeNode text="Europe"/> |
| <content:TreeNode text="North America"/> |
| <content:TreeBranch text="South America"> |
| <content:TreeNode text="Peru"/> |
| </content:TreeBranch> |
| </content:TreeBranch> |
| </content:TreeBranch> |
| </treeData> |
| |
| <treeViewSelectionListeners> |
| importPackage(org.apache.pivot.collections); |
| function selectedPathsChanged(viewComponent, previousSelectedElements) { |
| selectionListView.listData = new ArrayList(viewComponent.selectedPaths); |
| } |
| </treeViewSelectionListeners> |
| </TreeView> |
| </ScrollPane> |
| </Border> |
| <Border styles="{color:10}"> |
| <ScrollPane horizontalScrollBarPolicy="fill"> |
| <ListView bxml:id="selectionListView" selectMode="none"/> |
| </ScrollPane> |
| </Border> |
| </TablePane.Row> |
| </TablePane> |
| </Window> |