package net.helipilot50.stocktrade.client;
import net.helipilot50.stocktrade.model.gwt.Customer;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.FillLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class CustomerWindow extends Window {
CustomerSOAsync customerSO;
public CustomerWindow(String customerName){
this();
this.customerSO = Registry.get("CustomerSO");
this.customerSO.getCustomer(customerName, new AsyncCallback<Customer>() {
@Override
public void onSuccess(Customer result) {
// TODO Auto-generated method stub
}
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
});
}
public CustomerWindow() {
super();
setHeading("Customer Stock Holdings");
setLayout(new RowLayout(Orientation.VERTICAL));
CustomerDetailsPanel customerPanel = new CustomerDetailsPanel();
add(customerPanel);
CustomerHoldingsPanel holdingsPanel = new CustomerHoldingsPanel();
add(holdingsPanel);
LayoutContainer layoutContainer = new LayoutContainer();
layoutContainer.setLayout(new FillLayout(Orientation.HORIZONTAL));
Button btnBuy = new Button("Buy");
layoutContainer.add(btnBuy);
Button btnSell = new Button("Sell");
layoutContainer.add(btnSell);
Button btnExit = new Button("Exit");
layoutContainer.add(btnExit);
add(layoutContainer);
layoutContainer.setBorders(true);
}
}