Permalink
Browse files

merge from 2.0.x: PIVOT-880

git-svn-id: https://svn.apache.org/repos/asf/pivot/trunk@1408252 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent f3ac3df commit 95fc67d4f3996527d6cf997883fe78714d55f6eb Sandro Martini committed Nov 12, 2012
@@ -37,15 +37,17 @@ limitations under the License.
System.out.println("bxmlSerializer is " + bxmlSerializer);
function openFileBrowser(root) {
- System.out.println("Opening FileBrowser with the given folder \"" + root + "\" as root");
+ System.out.println("Opening FileBrowserSheet with the given folder \"" + root + "\" as root");
var fileBrowser = null;
if (root == undefined || root == null || root.length < 1)
fileBrowser = new FileBrowserSheet();
else {
// fileBrowser = new FileBrowserSheet(FileBrowserSheet.Mode.OPEN, root); // ok in Java, but not from JavaScript ...
- fileBrowser = new FileBrowserSheet();
- fileBrowser.setRootFolder(root);
+ // fileBrowser = new FileBrowserSheet();
+ // fileBrowser.setRootFolder(root);
+ // using the new constructor in FileBrowserSheet
+ fileBrowser = new FileBrowserSheet(root);
}
fileBrowser.open(window, null);
@@ -62,12 +64,13 @@ function openFileBrowser(root) {
</columns>
<TablePane.Row height="-1">
<FlowPane styles="{padding:2, alignToBaseline:true}">
- <TextInput bxml:id="textInput" text="\\server\share" textSize="30"/>
+ <TextInput bxml:id="textInput" prompt="Write here the \\server\share to open" textSize="30"/>
<Label text=" "/>
<PushButton bxml:id="selectFolderButton" buttonData="Open Folder">
<buttonPressListeners>
function buttonPressed(button) {
- openFileBrowser(textInput.text);
+ if (textInput.text.length() > 0)
+ openFileBrowser(textInput.text);
}
</buttonPressListeners>
</PushButton>
@@ -110,6 +110,19 @@ public FileBrowserSheet(Mode mode) {
/**
* Creates a new FileBrowserSheet
* <p>
+ * Note that this version of the constructor can be used when a custom root folder has to be set,
+ * and uses the default mode.
+ *
+ * @param rootFolder
+ * The root folder full name.
+ */
+ public FileBrowserSheet(String rootFolder) {
+ this(Mode.OPEN, rootFolder);
+ }
+
+ /**
+ * Creates a new FileBrowserSheet
+ * <p>
* Note that this version of the constructor must be used when a custom root folder has to be set.
*
* @param mode

0 comments on commit 95fc67d

Please sign in to comment.