-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathPanel.java
More file actions
executable file
·68 lines (61 loc) · 1.72 KB
/
Copy pathPanel.java
File metadata and controls
executable file
·68 lines (61 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package javaforce.webui;
import java.util.*;
import javaforce.webui.event.*;
/** Panel to display components.
*
* @author pquiring
*/
public class Panel extends Container {
private int overflow = -1;
public Panel() {
addClass("panel");
setFlexDirection(COLUMN);
setOverflow(HIDDEN);
}
public int getOverflow() {
return overflow;
}
public void setOverflow(int type) {
switch (overflow) {
case VISIBLE: removeClass("overflow-visible"); break;
case HIDDEN: removeClass("overflow-hidden"); break;
case SCROLL: removeClass("overflow-scroll"); break;
case AUTO: removeClass("overflow-auto"); break;
}
overflow = type;
switch (overflow) {
case VISIBLE: addClass("overflow-visible"); break;
case HIDDEN: addClass("overflow-hidden"); break;
case SCROLL: addClass("overflow-scroll"); break;
case AUTO: addClass("overflow-auto"); break;
}
}
public void onLoaded(String[] args) {
super.onLoaded(args);
if (parent == null) invokeOnLoaded(this);
}
private static void invokeOnLoaded(Container c) {
int cnt = c.count();
for(int a=0;a<cnt;a++) {
Component c2 = c.get(a);
c2.onLoaded(null);
if (c2 instanceof Container) {
invokeOnLoaded((Container)c2);
}
}
}
public void init() {
super.init();
onInited(null);
}
protected void onInited(String[] args) {
for(int a=0;a<inited.length;a++) {
inited[a].inited(this);
}
}
private Inited[] inited = new Inited[0];
public void addInitedListener(Inited handler) {
inited = Arrays.copyOf(inited, inited.length + 1);
inited[inited.length-1] = handler;
}
}