use of org.eevolution.grid.WBrowserTable in project adempiere by adempiere.
the class WBrowser method initComponents.
/**
* Initialize View Components
*/
private void initComponents() {
toolsBar = new ToolBar();
bZoom = new Button();
bExport = new Button();
bDelete = new Button();
tabsPanel = new Tabbox();
searchTab = new Borderlayout();
collapsibleSeach = new North();
topPanel = new Hbox();
searchGrid = new WBrowserSearch(getWindowNo(), getAD_Browse_ID(), BrowserSearch.COLUMNS_2);
detail = new WBrowserTable(this);
detail.addEventListener(Events.ON_SELECT, this);
bCancel = new Button();
bOk = new Button();
detailPanel = new Borderlayout();
Borderlayout mainLayout = new Borderlayout();
setupToolBar();
bSelectAll.setLabel(Msg.getMsg(Env.getCtx(), "SelectAll").replaceAll("[&]", ""));
bSelectAll.setEnabled(false);
bSelectAll.addActionListener(new EventListener() {
public void onEvent(Event evt) {
selectedRows();
}
});
toolsBar.appendChild(bSelectAll);
//TODO: victor.perez@e-evolution.com pending print functionality
/*bPrint.setLabel("Print");
bPrint.addActionListener(new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
bPrintActionPerformed(event);
}
});
toolsBar.appendChild(bPrint);*/
bZoom.setLabel(Msg.getMsg(Env.getCtx(), "Zoom").replaceAll("[&]", ""));
bZoom.setEnabled(false);
bZoom.addActionListener(new EventListener() {
public void onEvent(Event evt) {
cmd_Zoom();
}
});
//Only enable if exist a reference
if (AD_Window_ID > 0)
toolsBar.appendChild(bZoom);
bExport.setLabel(Msg.getMsg(Env.getCtx(), "Export"));
bExport.setEnabled(false);
bExport.addActionListener(new EventListener() {
public void onEvent(Event evt) {
cmd_Export();
}
});
toolsBar.appendChild(bExport);
bDelete.setLabel(Msg.getMsg(Env.getCtx(), "Delete").replaceAll("[&]", ""));
bDelete.setEnabled(false);
bDelete.addActionListener(new EventListener() {
public void onEvent(Event evt) {
cmd_deleteSelection();
}
});
if (isDeleteable())
toolsBar.appendChild(bDelete);
m_frame.setWidth("100%");
m_frame.setHeight("100%");
m_frame.setStyle("position: absolute; padding: 0; margin: 0");
m_frame.appendChild(mainLayout);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
mainLayout.setStyle("position: absolute");
North north = new North();
north.appendChild(toolsBar);
mainLayout.appendChild(north);
searchTab = new Borderlayout();
searchTab.setWidth("99.4%");
searchTab.setHeight("99.4%");
searchTab.setStyle("background-color: transparent");
topPanel = new Hbox();
topPanel.setStyle("background-color: transparent");
bSearch.setLabel(Msg.getMsg(Env.getCtx(), "StartSearch"));
bSearch.addActionListener(new EventListener() {
public void onEvent(Event evt) {
cmd_Search();
}
});
Vbox vbox = new Vbox();
vbox.appendChild(topPanel);
vbox.appendChild(bSearch);
vbox.setAlign("center");
vbox.setWidth("100%");
vbox.setStyle("background-color: transparent");
Div div = new Div();
div.appendChild(vbox);
div.setWidth("100%");
div.setHeight("100%");
collapsibleSeach.setTitle(Msg.getMsg(Env.getCtx(), ("SearchCriteria")));
collapsibleSeach.setCollapsible(true);
collapsibleSeach.setAutoscroll(true);
collapsibleSeach.appendChild(div);
collapsibleSeach.setStyle("overflow-y:auto");
collapsibleSeach.setStyle("background-color: transparent");
collapsibleSeach.setStyle("border: none");
searchTab.appendChild(collapsibleSeach);
detail.setWidth("100%");
//detail.setHeight("100%");
Center dCenter = new Center();
dCenter.appendChild(detail);
dCenter.setBorder("none");
detail.setVflex(true);
detail.setFixedLayout(true);
dCenter.setHflex("true");
dCenter.setVflex("true");
dCenter.setAutoscroll(true);
detailPanel.setHeight("100%");
detailPanel.setWidth("100%");
detailPanel.appendCenter(detail);
// Div dv = new Div();
div.appendChild(detailPanel);
div.setHeight("100%");
div.setWidth("100%");
searchTab.appendCenter(detailPanel);
Hbox hbox = new Hbox();
// bCancel.setLabel(Msg.getMsg(Env.getCtx(), "Cancel").replaceAll("[&]",""));
bCancel.addActionListener(new EventListener() {
public void onEvent(Event evt) {
cmd_Cancel();
}
});
// bOk.setLabel(Msg.getMsg(Env.getCtx(), "Ok").replaceAll("[&]",""));
bOk.addActionListener(new EventListener() {
public void onEvent(Event evt) {
cmd_Ok();
}
});
Div confirmDiv = new Div();
confirmDiv.setAlign("center");
hbox.appendChild(bCancel);
hbox.appendChild(bOk);
hbox.setAlign("center");
confirmDiv.appendChild(hbox);
Separator separator = new Separator();
separator.setBar(true);
confirmDiv.appendChild(separator);
confirmDiv.appendChild(statusBar);
searchTab.appendSouth(confirmDiv);
searchTab.getSouth().setBorder("none");
Tabpanel search = new Tabpanel();
search.setWidth("100%");
search.appendChild(searchTab);
Tab tabSearch = new Tab();
tabSearch.addEventListener(Events.ON_SELECT, this);
tabSearch.setLabel(Msg.getMsg(Env.getCtx(), "Search").replaceAll("[&]", ""));
Tabs tabs = new Tabs();
tabs.appendChild(tabSearch);
Tabpanels tabPanels = new Tabpanels();
tabPanels.setWidth("100%");
tabPanels.appendChild(search);
//graphPanel = new Borderlayout();
//TODO victor.perez@e-evolution.com implement Graph Functionality
//Tabpanel graph = new Tabpanel();
//graph.setWidth("100%");
//graph.appendChild(graphPanel);
//Tab tabGraph = new Tab();
//tabGraph.addEventListener(Events.ON_SELECT, this);
//tabGraph.setLabel(Msg.getMsg(Env.getCtx(), "Graph").replaceAll("[&]",
// ""));
//tabs.appendChild(tabGraph);
//tabPanels.appendChild(graph);
tabsPanel.setWidth("100%");
tabsPanel.setHeight("100%");
tabsPanel.appendChild(tabs);
tabsPanel.appendChild(tabPanels);
mainLayout.appendCenter(tabsPanel);
}
Aggregations