FileBrowserSheetAdapter.java
01 /*
02  * Copyright 2008-2014 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *     http://www.apache.org/licenses/LICENSE-2.0
09  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package griffon.pivot.support.adapters;
17 
18 import griffon.core.CallableWithArgs;
19 
20 import java.io.File;
21 
22 /**
23  @author Andres Almiray
24  @since 2.0.0
25  */
26 public class FileBrowserSheetAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.FileBrowserSheetListener {
27     private CallableWithArgs<Void> modeChanged;
28     private CallableWithArgs<Void> rootDirectoryChanged;
29     private CallableWithArgs<Void> selectedFilesChanged;
30     private CallableWithArgs<Void> disabledFileFilterChanged;
31 
32     public CallableWithArgs<Void> getModeChanged() {
33         return this.modeChanged;
34     }
35 
36     public CallableWithArgs<Void> getRootDirectoryChanged() {
37         return this.rootDirectoryChanged;
38     }
39 
40     public CallableWithArgs<Void> getSelectedFilesChanged() {
41         return this.selectedFilesChanged;
42     }
43 
44     public CallableWithArgs<Void> getDisabledFileFilterChanged() {
45         return this.disabledFileFilterChanged;
46     }
47 
48 
49     public void setModeChanged(CallableWithArgs<Void> modeChanged) {
50         this.modeChanged = modeChanged;
51     }
52 
53     public void setRootDirectoryChanged(CallableWithArgs<Void> rootDirectoryChanged) {
54         this.rootDirectoryChanged = rootDirectoryChanged;
55     }
56 
57     public void setSelectedFilesChanged(CallableWithArgs<Void> selectedFilesChanged) {
58         this.selectedFilesChanged = selectedFilesChanged;
59     }
60 
61     public void setDisabledFileFilterChanged(CallableWithArgs<Void> disabledFileFilterChanged) {
62         this.disabledFileFilterChanged = disabledFileFilterChanged;
63     }
64 
65 
66     public void modeChanged(org.apache.pivot.wtk.FileBrowserSheet arg0, org.apache.pivot.wtk.FileBrowserSheet.Mode arg1) {
67         if (modeChanged != null) {
68             modeChanged.call(arg0, arg1);
69         }
70     }
71 
72     public void rootDirectoryChanged(org.apache.pivot.wtk.FileBrowserSheet arg0, java.io.File arg1) {
73         if (rootDirectoryChanged != null) {
74             rootDirectoryChanged.call(arg0, arg1);
75         }
76     }
77 
78     public void selectedFilesChanged(org.apache.pivot.wtk.FileBrowserSheet arg0, org.apache.pivot.collections.Sequence<File> arg1) {
79         if (selectedFilesChanged != null) {
80             selectedFilesChanged.call(arg0, arg1);
81         }
82     }
83 
84     public void disabledFileFilterChanged(org.apache.pivot.wtk.FileBrowserSheet arg0, org.apache.pivot.util.Filter<File> arg1) {
85         if (disabledFileFilterChanged != null) {
86             disabledFileFilterChanged.call(arg0, arg1);
87         }
88     }
89 
90 }