Warning: session_start(): open(/var/lib/php/sessions/sess_8g0qs8pml5haadvnqs17pev633, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// x = names and components interleaving.
// or just components.
// or just names.
// also, first element can be index of tab to open at start
// also, SUPER short demo syntax: jtabs(3)
// also, you can pass a Collection containing the elements
static JTabbedPane fillJTabs(final JTabbedPane tabs, fO... _x) {
if (tabs == null) null;
clearTabs(tabs);
O[] x = flattenArray2(_x);
ifdef fillJTabs_debug
print("fillJTabs length=" + l(_x) + " => " + l(x));
endifdef
int idx = 0;
if (get(x, 0) instanceof Int) {
idx = asInt(get(x, 0));
x = dropFirst(x);
if (empty(x)) {
x = arrayrep(null, idx);
idx = 0;
}
}
int n = 0;
for (int i = 0; i < l(x); i++) {
++n;
// is it a component?
O o = x[i];
if (isComponentOrSwingable(o))
addTab(tabs, "Tab " + n, wrap(o));
else {
// assume it's a tab name, optionally followed by a component
S toolTip = "";
if (o cast WithToolTip) {
toolTip = o.toolTip();
o = o!;
}
S name = str(or(o, "Tab " + n));
ifdef fillJTabs_debug
print("tab " + i + ": " + name);
endifdef
Component c;
if (isComponentOrSwingable(get(x, i+1)))
c = wrap(get(x, ++i));
else
c = new JPanel;
addTabWithToolTip(tabs, name, toolTip, wrap(c));
}
}
if (idx != 0)
tabs.setSelectedIndex(min(tabs.getTabCount()-1, idx));
ret tabs;
}