You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/07/23 22:51:35 UTC
svn commit: r797221 - in /incubator/pivot/trunk: tutorials/www/
wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/skin/terra/
Author: gbrown
Date: Thu Jul 23 20:51:34 2009
New Revision: 797221
URL: http://svn.apache.org/viewvc?rev=797221&view=rev
Log:
Add FileBrowser, FileBrowserSheet, FolderBrowser, and FolderBrowserSheet components; stub out skins for each.
Added:
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserListener.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheetListener.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowser.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserListener.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheet.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheetListener.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSheetSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSkin.java
Modified:
incubator/pivot/trunk/tutorials/www/platform_overview.template.html
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
Modified: incubator/pivot/trunk/tutorials/www/platform_overview.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/platform_overview.template.html?rev=797221&r1=797220&r2=797221&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/platform_overview.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/platform_overview.template.html Thu Jul 23 20:51:34 2009
@@ -137,19 +137,14 @@
<ul>
<li><p><b>Window</b> - Base window class; it is not abstract and is the most basic means by which content may be placed on the screen. It simply provides an undecorated region in which other components may be placed.</p></li>
-
<li><p><b>Frame</b> - A window with a title bar and border for dragging and resizing.</p></li>
-
<li><p><b>Dialog</b> - A frame that is generally used for collecting user input (engaging in a "dialog" with the user); may optionally be "modal", blocking input to its owner.</p></li>
-
<li><p><b>Alert</b> - A dialog that is generally used to present brief notifications to the user.</p></li>
-
<li><p><b>Sheet</b> - A window that, like a dialog, is generally used for collecting user input; however, unlike dialogs, sheets always have an owner, and are always modal over the owner's content.</p></li>
-
<li><p><b>Prompt</b> - A sheet that is generally used to present brief notifications to the user; the sheet equivalent of <tt>Alert</tt>.</p></li>
-
<li><p><b>Palette</b> - A floating tool palette window.</p></li>
-
+<li><p><b>FileBrowserSheet</b> - A file browser sheet.</p></li>
+<li><p><b>FolderBrowserSheet</b> - A folder browser sheet.</p></li>
<li><p><b>Tooltip</b> - A small, popup-like window that disappears as soon as the user moves the mouse.</p></li>
</ul>
@@ -168,19 +163,12 @@
<ul>
<li><p><b>FlowPane</b> - Container that arranges components in a horizontal line, wrapping when contents don't fit on a single line.</p></li>
-
<li><p><b>BoxPane</b> - Container that arranges components in a line, either vertically or horizontally.</p></li>
-
<li><p><b>TablePane</b> - A container that lays out its children in a two-dimensional table structure, optionally spanning table cells.</p></li>
-
<li><p><b>Border</b> - A container with an optional title that draws a border around a single content component.</p></li>
-
<li><p><b>StackPane</b> - Arranges components in layers, like a stack of transparencies.</p></li>
-
<li><p><b>SplitPane</b> - Provides a draggable divider between two components allowing a user to dynamically change the size of each; may be horizontal or vertical.</p></li>
-
<li><p><b>Form</b> - Arranges components in a "form" layout with labels to the left and optional flag messages (e.g. to alert a user to input errors) to the right.</p></li>
-
<li><p><b>Panel</b> - A container that performs no layout, allowing the application to specify absolute component positions and sizes.</p></li>
</ul>
@@ -190,15 +178,10 @@
<ul>
<li><p><b>CardPane</b> - A simple "card stack" of components, only one of which is visible at a time.</p></li>
-
<li><p><b>TabPane</b> - Similar to CardPane but with built-in "tabs" for navigation; may optionally be "collapsed" such that only the tab buttons show.</p></li>
-
<li><p><b>Accordion</b> - Similar to <tt>TabPane</tt>, but subcomponents are presented like the folds of an accordion, with headers for navigating between panels.</p></li>
-
<li><p><b>Expander</b> - Similar to a border but collapsible such that only the title shows.</p></li>
-
<li><p><b>Rollup</b> - Similar to Expander but can contain an aribitrary number of child components; when collapsed, only the first component is visible. Can be nested to create the appearance of a "tree" structure.</p></li>
-
<li><p><b><i>Viewport</i></b> - Abstract base class for a scrollable region. Viewport sublcasses include:
<ul>
<li><b>ScrollPane</b> - A scrollable area with optional vertical and horizontal scroll bars as well as row and column headers.
@@ -216,15 +199,14 @@
<p>Composites are simply components that are implemented using other components. For example, a <tt>ScrollBar</tt> is a container consisting of of two button components and a "thumb", the draggable area that allows the user to scroll by clicking and dragging the mouse. Composites include:</p>
<ul>
-<li><p><b>Menu</b> - Displays a list of actions to the user. Generally displayed in a popup context menu or as part of a menu bar or menu button.</p></li>
-
-<li><p><b>MenuBar</b> - Provides access to a collection of sub-menus.</p></li>
-
<li><p><b>ScrollBar</b> - Allows a user to select one of a range of values using up/down buttons or a draggable "thumb" that also represents an extent value. Most often used to facilitate scrolling in a scroll pane.</p></li>
-
<li><p><b>Spinner</b> - An "up/down" control allowing a user to cycle through a range of pre-defined values.</p></li>
-
<li><p><b>Slider</b> - Allows a user to select one of a range of values by dragging the mouse.</p></li>
+<li><p><b>Menu</b> - Displays a list of actions to the user. Generally displayed in a popup context menu or as part of a menu bar or menu button.</p></li>
+<li><p><b>MenuBar</b> - Provides access to a collection of sub-menus.</p></li>
+<li><p><b>Calendar</b> - Allows a user to select a date.</p></li>
+<li><p><b>FileBrowser</b> - Allows a user to select a file.</p></li>
+<li><p><b>FolderBrowser</b> - Allows a user to select a folder.</p></li>
</ul>
<h3>Components</h3>
@@ -233,9 +215,7 @@
<ul>
<li><p><b>Label</b> - A simple component used to display an uneditable block of (optionally wrapped) text.</p></li>
-
<li><p><b>ImageView</b> - A component that displays a static, optionally scaled, image.</p></li>
-
<li><p><b><i>Button</i></b> - Abstract base class for buttons, which include:
<ul>
<li><b>PushButton</b> - A basic push button. Can be single-push or toggle (selectable); toggle push buttons can be placed in groups such that only one can be selected at at time.</li>
@@ -243,27 +223,18 @@
<li><b>RadioButton</b> - A button that behaves like an old-style car radio button; generally part of a group where only one button can be selected at time.</li>
<li><b>LinkButton</b> - A single-push button that looks like an HTML hyperlink.</li>
<li><b>ListButton</b> - A button that displays a drop-down list of choices when pushed and reflects the user's selection.</li>
+<li><b>CalendarButton</b> - A button that displays a calendar when pushed and reflects the user's selection.</li>
<li><b>MenuButton</b> - A button that displays a drop-down list of menu items; can optionally reflect the user's selection allowing the action associated with the item to be repeated (i.e. behave like a "split button").</li>
<li><b>Menu.Item</b> - A button that provides behavior for menu items.</li>
<li><b>Menu.BarItem</b> - A button that provides behavior for menu bar items.</li>
</ul></p></li>
-
<li><b>Separator</b> - A simple horizontal rule component.</p></li>
-
<li><b>TextInput</b> - A component for entering a single line of text.</p></li>
-
<li><b>TextArea</b> - A component for viewing or entering multiple lines of (optionally formatted) text.</p></li>
-
-<li><b>Spinner</b> - Allows the user to select one of a predefined collection of values.</p></li>
-
<li><b>ActivityIndicator</b> - Displays an indeterminate progress state.</p></li>
-
<li><b>Meter</b> - Displays a progress bar reflecting a completion percentage.</p></li>
-
<li><b>ListView</b> - Displays a list of optionally selectable items arranged vertically.</p></li>
-
<li><b>TableView</b> - Displays data grouped into rows and columns. Columns are sortable and resizeable, and rows are optionally selectable.</p></li>
-
<li><b>TreeView</b> - Displays a hierarchical data structure. Tree nodes are optionally selectable and collapsible.</p></li>
</ul>
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import java.io.File;
+
+import org.apache.pivot.util.ListenerList;
+
+/**
+ * Component representing a file browser.
+ *
+ * @author gbrown
+ */
+public class FileBrowser extends Container {
+ private static class FileBrowserListenerList extends ListenerList<FileBrowserListener>
+ implements FileBrowserListener {
+ public void selectedFileChanged(FileBrowser fileBrowser, File previousSelectedFile) {
+ for (FileBrowserListener listener : this) {
+ listener.selectedFileChanged(fileBrowser, previousSelectedFile);
+ }
+ }
+ }
+
+ private File selectedFile = null;
+
+ private FileBrowserListenerList fileBrowserListeners = new FileBrowserListenerList();
+
+ public FileBrowser() {
+ installSkin(FileBrowser.class);
+ }
+
+ public File getSelectedFile() {
+ return selectedFile;
+ }
+
+ public void setSelectedFile(File selectedFile) {
+ File previousSelectedFile = this.selectedFile;
+
+ if (selectedFile != previousSelectedFile) {
+ this.selectedFile = selectedFile;
+ fileBrowserListeners.selectedFileChanged(this, previousSelectedFile);
+ }
+ }
+
+ public ListenerList<FileBrowserListener> getFileBrowserListeners() {
+ return fileBrowserListeners;
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserListener.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserListener.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserListener.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import java.io.File;
+
+/**
+ * File browser listener interface.
+ *
+ * @author gbrown
+ */
+public interface FileBrowserListener {
+ /**
+ * Called when a file browser's selected file has changed.
+ *
+ * @param fileBrowser
+ * @param previousSelectedFile
+ */
+ public void selectedFileChanged(FileBrowser fileBrowser, File previousSelectedFile);
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import java.io.File;
+
+import org.apache.pivot.util.ListenerList;
+
+/**
+ * File browser sheet.
+ *
+ * @author gbrown
+ */
+public class FileBrowserSheet extends Sheet {
+ private static class FileBrowserSheetListenerList extends ListenerList<FileBrowserSheetListener>
+ implements FileBrowserSheetListener {
+ public void selectedFileChanged(FileBrowserSheet fileBrowserSheet, File previousSelectedFile) {
+ for (FileBrowserSheetListener listener : this) {
+ listener.selectedFileChanged(fileBrowserSheet, previousSelectedFile);
+ }
+ }
+ }
+
+ private File selectedFile = null;
+
+ private FileBrowserSheetListenerList fileBrowserSheetListeners = new FileBrowserSheetListenerList();
+
+ public FileBrowserSheet() {
+ installSkin(FileBrowserSheet.class);
+ }
+
+ public File getSelectedFile() {
+ return selectedFile;
+ }
+
+ public void setSelectedFile(File selectedFile) {
+ File previousSelectedFile = this.selectedFile;
+
+ if (selectedFile != previousSelectedFile) {
+ this.selectedFile = selectedFile;
+ fileBrowserSheetListeners.selectedFileChanged(this, previousSelectedFile);
+ }
+ }
+
+ public ListenerList<FileBrowserSheetListener> getFileBrowserSheetListeners() {
+ return fileBrowserSheetListeners;
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheetListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheetListener.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheetListener.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheetListener.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import java.io.File;
+
+/**
+ * File browser sheet listener interface.
+ *
+ * @author gbrown
+ */
+public interface FileBrowserSheetListener {
+ /**
+ * Called when a file browser sheet's selected file has changed.
+ *
+ * @param fileBrowserSheet
+ * @param previousSelectedFile
+ */
+ public void selectedFileChanged(FileBrowserSheet fileBrowserSheet, File previousSelectedFile);
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowser.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowser.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowser.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowser.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import org.apache.pivot.io.Folder;
+import org.apache.pivot.util.ListenerList;
+
+/**
+ * Component representing a folder browser.
+ *
+ * @author gbrown
+ */
+public class FolderBrowser extends Container {
+ private static class FolderBrowserListenerList extends ListenerList<FolderBrowserListener>
+ implements FolderBrowserListener {
+ public void selectedFolderChanged(FolderBrowser folderBrowser, Folder previousSelectedFolder) {
+ for (FolderBrowserListener listener : this) {
+ listener.selectedFolderChanged(folderBrowser, previousSelectedFolder);
+ }
+ }
+ }
+
+ private Folder selectedFolder = null;
+
+ private FolderBrowserListenerList folderBrowserListeners = new FolderBrowserListenerList();
+
+ public FolderBrowser() {
+ installSkin(FolderBrowser.class);
+ }
+
+ public Folder getSelectedFolder() {
+ return selectedFolder;
+ }
+
+ public void setSelectedFolder(Folder selectedFolder) {
+ Folder previousSelectedFolder = this.selectedFolder;
+
+ if (selectedFolder != previousSelectedFolder) {
+ this.selectedFolder = selectedFolder;
+ folderBrowserListeners.selectedFolderChanged(this, previousSelectedFolder);
+ }
+ }
+
+ public ListenerList<FolderBrowserListener> getFolderBrowserListeners() {
+ return folderBrowserListeners;
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserListener.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserListener.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserListener.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import org.apache.pivot.io.Folder;
+
+/**
+ * Folder browser listener interface.
+ *
+ * @author gbrown
+ */
+public interface FolderBrowserListener {
+ /**
+ * Called when a folder browser's selected folder has changed.
+ *
+ * @param folderBrowser
+ * @param previousSelectedFolder
+ */
+ public void selectedFolderChanged(FolderBrowser folderBrowser, Folder previousSelectedFolder);
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheet.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheet.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheet.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheet.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import org.apache.pivot.io.Folder;
+import org.apache.pivot.util.ListenerList;
+
+/**
+ * Folder browser sheet.
+ *
+ * @author gbrown
+ */
+public class FolderBrowserSheet extends Sheet {
+ private static class FolderBrowserSheetListenerList extends ListenerList<FolderBrowserSheetListener>
+ implements FolderBrowserSheetListener {
+ public void selectedFolderChanged(FolderBrowserSheet folderBrowserSheet, Folder previousSelectedFolder) {
+ for (FolderBrowserSheetListener listener : this) {
+ listener.selectedFolderChanged(folderBrowserSheet, previousSelectedFolder);
+ }
+ }
+ }
+
+ private Folder selectedFolder = null;
+
+ private FolderBrowserSheetListenerList folderBrowserSheetListeners = new FolderBrowserSheetListenerList();
+
+ public FolderBrowserSheet() {
+ installSkin(FolderBrowserSheet.class);
+ }
+
+ public Folder getSelectedFolder() {
+ return selectedFolder;
+ }
+
+ public void setSelectedFolder(Folder selectedFolder) {
+ Folder previousSelectedFolder = this.selectedFolder;
+
+ if (selectedFolder != previousSelectedFolder) {
+ this.selectedFolder = selectedFolder;
+ folderBrowserSheetListeners.selectedFolderChanged(this, previousSelectedFolder);
+ }
+ }
+
+ public ListenerList<FolderBrowserSheetListener> getFolderBrowserSheetListeners() {
+ return folderBrowserSheetListeners;
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheetListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheetListener.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheetListener.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FolderBrowserSheetListener.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk;
+
+import org.apache.pivot.io.Folder;
+
+/**
+ * Folder browser sheet listener interface.
+ *
+ * @author gbrown
+ */
+public interface FolderBrowserSheetListener {
+ /**
+ * Called when a folder browser sheet's selected folder has changed.
+ *
+ * @param folderBrowserSheet
+ * @param previousSelectedFolder
+ */
+ public void selectedFolderChanged(FolderBrowserSheet folderBrowserSheet, Folder previousSelectedFolder);
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk.skin.terra;
+
+import java.io.File;
+
+import org.apache.pivot.wtk.Component;
+import org.apache.pivot.wtk.FileBrowserSheet;
+import org.apache.pivot.wtk.FileBrowserSheetListener;
+
+/**
+ * Terra file browser sheet skin.
+ *
+ * @author gbrown
+ */
+public class TerraFileBrowserSheetSkin extends TerraSheetSkin
+ implements FileBrowserSheetListener {
+ @Override
+ public void install(Component component) {
+ super.install(component);
+
+ FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)component;
+ fileBrowserSheet.getFileBrowserSheetListeners().add(this);
+
+ // TODO Add components
+ }
+
+ @Override
+ public void uninstall() {
+ FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)getComponent();
+ fileBrowserSheet.getFileBrowserSheetListeners().remove(this);
+
+ // TODO Remove components
+
+ super.uninstall();
+ }
+
+ @Override
+ public void selectedFileChanged(FileBrowserSheet fileBrowserSheet, File previousSelectedFile) {
+ // TODO
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk.skin.terra;
+
+import java.io.File;
+
+import org.apache.pivot.wtk.Component;
+import org.apache.pivot.wtk.FileBrowser;
+import org.apache.pivot.wtk.FileBrowserListener;
+import org.apache.pivot.wtk.skin.ContainerSkin;
+
+/**
+ * Terra file browser skin.
+ *
+ * @author gbrown
+ */
+public class TerraFileBrowserSkin extends ContainerSkin
+ implements FileBrowserListener {
+ @Override
+ public void install(Component component) {
+ super.install(component);
+
+ FileBrowser fileBrowser = (FileBrowser)component;
+ fileBrowser.getFileBrowserListeners().add(this);
+
+ // TODO Add components
+ }
+
+ @Override
+ public void uninstall() {
+ FileBrowser fileBrowser = (FileBrowser)getComponent();
+ fileBrowser.getFileBrowserListeners().remove(this);
+
+ // TODO Remove components
+
+ super.uninstall();
+ }
+
+ @Override
+ public void layout() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void selectedFileChanged(FileBrowser fileBrowser, File previousSelectedFile) {
+ // TODO
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSheetSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSheetSkin.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSheetSkin.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSheetSkin.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk.skin.terra;
+
+import org.apache.pivot.io.Folder;
+import org.apache.pivot.wtk.Component;
+import org.apache.pivot.wtk.FolderBrowserSheet;
+import org.apache.pivot.wtk.FolderBrowserSheetListener;
+
+/**
+ * Terra folder browser sheet skin.
+ *
+ * @author gbrown
+ */
+public class TerraFolderBrowserSheetSkin extends TerraSheetSkin
+ implements FolderBrowserSheetListener {
+ @Override
+ public void install(Component component) {
+ super.install(component);
+
+ FolderBrowserSheet folderBrowserSheet = (FolderBrowserSheet)component;
+ folderBrowserSheet.getFolderBrowserSheetListeners().add(this);
+
+ // TODO Add components
+ }
+
+ @Override
+ public void uninstall() {
+ FolderBrowserSheet folderBrowserSheet = (FolderBrowserSheet)getComponent();
+ folderBrowserSheet.getFolderBrowserSheetListeners().remove(this);
+
+ // TODO Remove components
+
+ super.uninstall();
+ }
+
+ @Override
+ public void selectedFolderChanged(FolderBrowserSheet folderBrowserSheet, Folder previousSelectedFolder) {
+ // TODO
+ }
+}
Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSkin.java?rev=797221&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSkin.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFolderBrowserSkin.java Thu Jul 23 20:51:34 2009
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+package org.apache.pivot.wtk.skin.terra;
+
+import org.apache.pivot.io.Folder;
+import org.apache.pivot.wtk.Component;
+import org.apache.pivot.wtk.FolderBrowser;
+import org.apache.pivot.wtk.FolderBrowserListener;
+import org.apache.pivot.wtk.skin.ContainerSkin;
+
+/**
+ * Terra folder browser skin.
+ *
+ * @author gbrown
+ */
+public class TerraFolderBrowserSkin extends ContainerSkin
+ implements FolderBrowserListener {
+ @Override
+ public void install(Component component) {
+ super.install(component);
+
+ FolderBrowser folderBrowser = (FolderBrowser)component;
+ folderBrowser.getFolderBrowserListeners().add(this);
+
+ // TODO Add components
+ }
+
+ @Override
+ public void uninstall() {
+ FolderBrowser folderBrowser = (FolderBrowser)getComponent();
+ folderBrowser.getFolderBrowserListeners().remove(this);
+
+ // TODO Remove components
+
+ super.uninstall();
+ }
+
+ @Override
+ public void layout() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void selectedFolderChanged(FolderBrowser folderBrowser, Folder previousSelectedFolder) {
+ // TODO
+ }
+}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=797221&r1=797220&r2=797221&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java Thu Jul 23 20:51:34 2009
@@ -38,6 +38,10 @@
import org.apache.pivot.wtk.Dialog;
import org.apache.pivot.wtk.Expander;
import org.apache.pivot.wtk.BoxPane;
+import org.apache.pivot.wtk.FileBrowser;
+import org.apache.pivot.wtk.FileBrowserSheet;
+import org.apache.pivot.wtk.FolderBrowser;
+import org.apache.pivot.wtk.FolderBrowserSheet;
import org.apache.pivot.wtk.Form;
import org.apache.pivot.wtk.Frame;
import org.apache.pivot.wtk.Label;
@@ -152,6 +156,10 @@
componentSkinMap.put(CalendarButton.class, TerraCalendarButtonSkin.class);
componentSkinMap.put(Dialog.class, TerraDialogSkin.class);
componentSkinMap.put(Expander.class, TerraExpanderSkin.class);
+ componentSkinMap.put(FileBrowser.class, TerraFileBrowserSkin.class);
+ componentSkinMap.put(FileBrowserSheet.class, TerraFileBrowserSheetSkin.class);
+ componentSkinMap.put(FolderBrowser.class, TerraFolderBrowserSkin.class);
+ componentSkinMap.put(FolderBrowserSheet.class, TerraFolderBrowserSheetSkin.class);
componentSkinMap.put(Form.class, TerraFormSkin.class);
componentSkinMap.put(BoxPane.class, TerraBoxPaneSkin.class);
componentSkinMap.put(Frame.class, TerraFrameSkin.class);