use of org.adempiere.webui.component.ListHeader in project adempiere by adempiere.
the class AboutWindow method createTrace.
private Tabpanel createTrace() {
Tabpanel tabPanel = new Tabpanel();
Vbox vbox = new Vbox();
vbox.setParent(tabPanel);
vbox.setWidth("100%");
vbox.setHeight("100%");
Hbox hbox = new Hbox();
bErrorsOnly = new Checkbox();
bErrorsOnly.setLabel(Msg.getMsg(Env.getCtx(), "ErrorsOnly"));
//default only show error
bErrorsOnly.setChecked(true);
bErrorsOnly.addEventListener(Events.ON_CHECK, this);
hbox.appendChild(bErrorsOnly);
btnDownload = new Button(Msg.getMsg(Env.getCtx(), "SaveFile"));
btnDownload.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btnDownload);
btnErrorEmail = new Button(Msg.getMsg(Env.getCtx(), "SendEMail"));
btnErrorEmail.addEventListener(Events.ON_CLICK, this);
hbox.appendChild(btnErrorEmail);
vbox.appendChild(hbox);
Vector<String> columnNames = CLogErrorBuffer.get(true).getColumnNames(Env.getCtx());
logTable = new Listbox();
ListHead listHead = new ListHead();
listHead.setParent(logTable);
listHead.setSizable(true);
for (Object obj : columnNames) {
ListHeader header = new ListHeader(obj.toString());
header.setWidth("100px");
listHead.appendChild(header);
}
vbox.appendChild(logTable);
logTable.setWidth("480px");
logTable.setHeight("310px");
logTable.setVflex(false);
updateLogTable();
return tabPanel;
}
use of org.adempiere.webui.component.ListHeader in project adempiere by adempiere.
the class ADSortTab method init.
/**
* Static Layout
* @throws Exception
*/
private void init() throws Exception {
this.setStyle("height: 100%; width: 100%;");
//
noLabel.setValue("No");
yesLabel.setValue("Yes");
//yesList.setHeight("100%");
//noList.setHeight("100%");
yesList.setVflex(true);
noList.setVflex(true);
EventListener mouseListener = new EventListener() {
public void onEvent(Event event) throws Exception {
if (Events.ON_DOUBLE_CLICK.equals(event.getName())) {
migrateValueAcrossLists(event);
}
}
};
yesList.addDoubleClickListener(mouseListener);
noList.addDoubleClickListener(mouseListener);
//
EventListener actionListener = new EventListener() {
public void onEvent(Event event) throws Exception {
migrateValueAcrossLists(event);
}
};
yesList.setSeltype("multiple");
noList.setSeltype("multiple");
bAdd.setImage(ServletFns.resolveThemeURL("~./images/Detail24.png"));
bAdd.addEventListener(Events.ON_CLICK, actionListener);
bRemove.setImage(ServletFns.resolveThemeURL("~./images/Parent24.png"));
bRemove.addEventListener(Events.ON_CLICK, actionListener);
EventListener crossListMouseListener = new DragListener();
yesList.addOnDropListener(crossListMouseListener);
noList.addOnDropListener(crossListMouseListener);
yesList.setItemDraggable(true);
noList.setItemDraggable(true);
actionListener = new EventListener() {
public void onEvent(Event event) throws Exception {
migrateValueWithinYesList(event);
}
};
bUp.setImage(ServletFns.resolveThemeURL("~./images/Previous24.png"));
bUp.addEventListener(Events.ON_CLICK, actionListener);
bDown.setImage(ServletFns.resolveThemeURL("~./images/Next24.png"));
bDown.addEventListener(Events.ON_CLICK, actionListener);
EventListener yesListMouseMotionListener = new EventListener() {
public void onEvent(Event event) throws Exception {
if (event instanceof DropEvent) {
DropEvent me = (DropEvent) event;
ListItem startItem = (ListItem) me.getDragged();
ListItem endItem = (ListItem) me.getTarget();
if (startItem.getListbox() == endItem.getListbox() && startItem.getListbox() == yesList) {
int startIndex = yesList.getIndexOfItem(startItem);
int endIndex = yesList.getIndexOfItem(endItem);
Object endElement = yesModel.getElementAt(endIndex);
Object element = yesModel.getElementAt(startIndex);
yesModel.removeElement(element);
endIndex = yesModel.indexOf(endElement);
yesModel.add(endIndex, element);
yesList.setSelectedIndex(endIndex);
if (yesList.getSelectedItem() != null) {
AuFocus focus = new AuFocus(yesList.getSelectedItem());
Clients.response(focus);
}
setIsChanged(true);
}
}
}
};
yesList.addOnDropListener(yesListMouseMotionListener);
ListHead listHead = new ListHead();
listHead.setParent(yesList);
ListHeader listHeader = new ListHeader();
listHeader.appendChild(yesLabel);
listHeader.setParent(listHead);
listHead = new ListHead();
listHead.setParent(noList);
listHeader = new ListHeader();
listHeader.appendChild(noLabel);
listHeader.setParent(listHead);
Span span = new Span();
span.setParent(this);
span.setStyle("height: 99%; display: inline-block; width: 40%;");
span.appendChild(noList);
Vbox vbox = new Vbox();
vbox.appendChild(bAdd);
vbox.appendChild(bRemove);
span = new Span();
span.setParent(this);
span.setStyle("height: 99%; display: inline-block; width: 46px");
span.appendChild(vbox);
span = new Span();
span.setParent(this);
span.setStyle("height: 99%; display: inline-block; width: 40%");
span.appendChild(yesList);
vbox = new Vbox();
vbox.appendChild(bUp);
vbox.appendChild(bDown);
span = new Span();
span.setParent(this);
span.setStyle("height: 99%; display: inline-block; width: 46px");
span.appendChild(vbox);
}
Aggregations