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/08/04 02:07:50 UTC

svn commit: r800635 - in /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk: ./ skin/ skin/terra/

Author: gbrown
Date: Tue Aug  4 00:07:49 2009
New Revision: 800635

URL: http://svn.apache.org/viewvc?rev=800635&view=rev
Log:
Preliminary work towards implementing file browser skins.

Added:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.json
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_add.png   (with props)
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_home.png   (with props)
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_up.png   (with props)
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/house.png   (with props)
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_alert_skin.wtkx
      - copied unchanged from r800465, incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/alert_skin.wtkx
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_sheet_skin.wtkx
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_skin.wtkx
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_prompt_skin.wtkx
      - copied unchanged from r800465, incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/prompt_skin.wtkx
Removed:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/alert_skin.wtkx
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/prompt_skin.wtkx
Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.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/TerraFileBrowserSkin.json
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java

Modified: 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=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowser.java Tue Aug  4 00:07:49 2009
@@ -160,7 +160,11 @@
 
     public void setMultiSelect(boolean multiSelect) {
         if (this.multiSelect != multiSelect) {
+            // Clear any existing selection
+            fileSelection.clear();
+
             this.multiSelect = multiSelect;
+
             fileBrowserListeners.multiSelectChanged(this);
         }
     }

Modified: 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=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/FileBrowserSheet.java Tue Aug  4 00:07:49 2009
@@ -183,7 +183,11 @@
 
     public void setMultiSelect(boolean multiSelect) {
         if (this.multiSelect != multiSelect) {
+            // Clear any existing selection
+            fileSelection.clear();
+
             this.multiSelect = multiSelect;
+
             fileBrowserSheetListeners.multiSelectChanged(this);
         }
     }

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java?rev=800635&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java Tue Aug  4 00:07:49 2009
@@ -0,0 +1,49 @@
+/*
+ * 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;
+
+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;
+
+/**
+ * Abstract base class for file browser skins.
+ *
+ * @author gbrown
+ */
+public abstract class FileBrowserSkin extends ContainerSkin implements FileBrowserListener {
+    @Override
+    public void install(Component component) {
+        super.install(component);
+
+        FileBrowser fileBrowser = (FileBrowser)component;
+        fileBrowser.getFileBrowserListeners().add(this);
+    }
+
+    @Override
+    public void uninstall() {
+        FileBrowser fileBrowser = (FileBrowser)getComponent();
+        fileBrowser.getFileBrowserListeners().remove(this);
+
+        super.uninstall();
+    }
+
+    public void multiSelectChanged(FileBrowser fileBrowser) {
+        // No-op
+    }
+}

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java?rev=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java Tue Aug  4 00:07:49 2009
@@ -61,7 +61,7 @@
         Component content = null;
 
         try {
-            content = (Component)wtkxSerializer.readObject(getClass().getResource("alert_skin.wtkx"));
+            content = (Component)wtkxSerializer.readObject(this, "terra_alert_skin.wtkx");
         } catch(Exception exception) {
             throw new RuntimeException(exception);
         }

Modified: 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=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java Tue Aug  4 00:07:49 2009
@@ -31,8 +31,6 @@
  * @author gbrown
  */
 public class TerraFileBrowserSheetSkin extends TerraSheetSkin implements FileBrowserSheetListener {
-    // TODO Define abstract base class
-
     @Override
     public void install(Component component) {
         super.install(component);
@@ -40,7 +38,7 @@
         FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)component;
         fileBrowserSheet.getFileBrowserSheetListeners().add(this);
 
-        // TODO Add components
+        // TODO Set content component
     }
 
     @Override
@@ -48,7 +46,7 @@
         FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)getComponent();
         fileBrowserSheet.getFileBrowserSheetListeners().remove(this);
 
-        // TODO Remove components
+        fileBrowserSheet.setContent(null);
 
         super.uninstall();
     }

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.json
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.json?rev=800635&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.json (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.json Tue Aug  4 00:07:49 2009
@@ -0,0 +1,8 @@
+{   openFile: "Open File",
+    openFiles: "Open Files",
+    saveFile: "Save File",
+    saveTo: "Save To",
+    ok: "OK",
+    cancel: "Cancel"
+}
+

Modified: 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=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java Tue Aug  4 00:07:49 2009
@@ -23,32 +23,23 @@
 import org.apache.pivot.util.Filter;
 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;
+import org.apache.pivot.wtk.skin.FileBrowserSkin;
 
 /**
  * Terra file browser skin.
  *
  * @author gbrown
  */
-public class TerraFileBrowserSkin extends ContainerSkin implements FileBrowserListener {
-    // TODO Define abstract base class
-
+public class TerraFileBrowserSkin extends FileBrowserSkin {
     @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();
@@ -60,10 +51,6 @@
 
     }
 
-    public void multiSelectChanged(FileBrowser fileBrowser) {
-        // TODO
-    }
-
     public void selectedFolderChanged(FileBrowser fileBrowser, Folder previousSelectedFolder) {
         // TODO
     }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.json
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.json?rev=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.json (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.json Tue Aug  4 00:07:49 2009
@@ -1,5 +1,5 @@
 {   goUp: "Go up a folder",
     newFolder: "Create new folder",
     goHome: "Go to home folder",
-    showFiles: "Show:"
+    search: "search"
 }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java?rev=800635&r1=800634&r2=800635&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java Tue Aug  4 00:07:49 2009
@@ -59,7 +59,7 @@
         Component content = null;
 
         try {
-            content = (Component)wtkxSerializer.readObject(getClass().getResource("prompt_skin.wtkx"));
+            content = (Component)wtkxSerializer.readObject(this, "terra_prompt_skin.wtkx");
         } catch(Exception exception) {
             throw new RuntimeException(exception);
         }

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_add.png
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_add.png?rev=800635&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_add.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_home.png
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_home.png?rev=800635&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_home.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_up.png
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_up.png?rev=800635&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/folder_up.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/house.png
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/house.png?rev=800635&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/house.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_sheet_skin.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_sheet_skin.wtkx?rev=800635&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_sheet_skin.wtkx (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_sheet_skin.wtkx Tue Aug  4 00:07:49 2009
@@ -0,0 +1,32 @@
+<?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.
+-->
+
+<TablePane xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk">
+    <columns>
+        <TablePane.Column width="1*"/>
+    </columns>
+    <rows>
+        <TablePane.Row height="-1">
+        </TablePane.Row>
+        <TablePane.Row height="1*">
+        </TablePane.Row>
+        <TablePane.Row height="-1">
+        </TablePane.Row>
+    </rows>
+</TablePane>

Added: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_skin.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_skin.wtkx?rev=800635&view=auto
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_skin.wtkx (added)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/terra_file_browser_skin.wtkx Tue Aug  4 00:07:49 2009
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<TablePane xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk">
+    <columns>
+        <TablePane.Column width="1*"/>
+    </columns>
+    <rows>
+        <TablePane.Row height="-1">
+        </TablePane.Row>
+        <TablePane.Row height="1*">
+        </TablePane.Row>
+    </rows>
+</TablePane>