BrightSide Workbench Full Report + Source Code
ImageSelector.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
package
org.turro.zkoss.image;
19
20
import
java.io.File;
21
import
org.amic.util.file.FileSelector;
22
import
org.turro.elephant.context.ElephantContext;
23
28
public
class
ImageSelector
extends
FileSelector {
29
30
private
String webPath;
31
32
public
ImageSelector
(String path, String regexp) {
33
super(
ElephantContext
.
getRealPath
(path), regexp);
34
this.webPath = path;
35
}
36
37
public
String
getRootPath
() {
38
return
ElephantContext
.
getRootWebPath
();
39
}
40
41
public
String
getImage
(
int
index) {
42
File file = getFile(index);
43
if
(file !=
null
) {
44
return
webPath +
"/"
+ file.getName();
45
}
46
return
null
;
47
}
48
49
public
String
getNextImage
() {
50
File file = getNextFile();
51
if
(file !=
null
) {
52
return
webPath +
"/"
+ file.getName();
53
}
54
return
null
;
55
}
56
57
public
String
getPreviousImage
() {
58
File file = getPreviousFile();
59
if
(file !=
null
) {
60
return
webPath +
"/"
+ file.getName();
61
}
62
return
null
;
63
}
64
65
}
org.turro.elephant.context.ElephantContext
Definition:
ElephantContext.java:59
org.turro.elephant.context.ElephantContext.getRealPath
static String getRealPath(String path)
Definition:
ElephantContext.java:115
org.turro.elephant.context.ElephantContext.getRootWebPath
static String getRootWebPath()
Definition:
ElephantContext.java:137
org.turro.zkoss.image.ImageSelector
Definition:
ImageSelector.java:28
org.turro.zkoss.image.ImageSelector.getPreviousImage
String getPreviousImage()
Definition:
ImageSelector.java:57
org.turro.zkoss.image.ImageSelector.getNextImage
String getNextImage()
Definition:
ImageSelector.java:49
org.turro.zkoss.image.ImageSelector.getImage
String getImage(int index)
Definition:
ImageSelector.java:41
org.turro.zkoss.image.ImageSelector.ImageSelector
ImageSelector(String path, String regexp)
Definition:
ImageSelector.java:32
org.turro.zkoss.image.ImageSelector.getRootPath
String getRootPath()
Definition:
ImageSelector.java:37
TurroProjects
Public
BrightSide
elephant-zkoss
src
main
java
org
turro
zkoss
image
ImageSelector.java
Generated on Tue Mar 12 2024 07:01:19 for BrightSide by
1.9.1