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