the code i have acheived is below: -
- Code: Select all
public class FruitMart implements EntryPoint {
public void onModuleLoad() {
VerticalPanel mainPanel = new VerticalPanel();
mainPanel.setWidth("100%");
mainPanel.setHeight("100%");
//the top panel displaying the FruitMart title
HorizontalPanel topPanel = new HorizontalPanel();
topPanel.setWidth("100%");
topPanel.setHeight("100%");
topPanel.setStyleName("topPanel");
Label fruitMartLabel = new Label("FruitMart");
fruitMartLabel.setStyleName("mainPanel");
topPanel.add(fruitMartLabel);
//the panel where the fruit stands and fruit basket are displayed
HorizontalPanel fruitMartPanel = new HorizontalPanel();
fruitMartPanel.setWidth("100%");
fruitMartPanel.setHeight("100%");
//the tab panel with all the different sections
TabPanel fruitStandsPanel = new TabPanel();
fruitStandsPanel.setHeight("100%");
fruitStandsPanel.setWidth("75%");
I<attachFruitStandsTabs(fruitStandsPanel);> ---THIS DOESNT WORK
I<fruitStandsPanel.selectTab(0);> ---THIS DOESNT WORK
fruitStandsPanel.selectTab(0);
fruitMartPanel.add(fruitStandsPanel);
fruitMartPanel.setCellHeight(fruitStandsPanel, "100%");
fruitMartPanel.setCellWidth(fruitStandsPanel, "75%");
//the basket panel
VerticalPanel fruitBasketPanel = new VerticalPanel();
fruitBasketPanel.setHeight("100%");
fruitBasketPanel.setWidth("25em");
Label fruitBasketLabel = new Label("Fruit Basket");
fruitBasketLabel.addStyleName("fruitBasketLabel");
fruitBasketPanel.add(fruitBasketLabel);
I<attachFruitBasketItems(fruitBasketPanel);> ---THIS DOESNT WORK
Button fruitBasketConfirmButton = new Button();
fruitBasketConfirmButton.setText("Confirm");
fruitBasketPanel.add(fruitBasketConfirmButton);
fruitMartPanel.add(fruitBasketPanel);
fruitMartPanel.setCellHeight(fruitBasketPanel, "100%");
fruitMartPanel.setCellWidth(fruitBasketPanel, "25%");
mainPanel.add(topPanel);
mainPanel.add(fruitMartPanel);
mainPanel.setCellHeight(topPanel, "10%");
mainPanel.setCellHeight(fruitMartPanel, "90%");
RootPanel.get().add(mainPanel);
}
private void attachFruitBasketItems(VerticalPanel fruitBasketPanel) {
//CODE IS HERE, COMPILES CORRECTLY AND SHOULD WORK FINE
}
private void attachFruitStandsTabs(TabPanel fruitStandsTabPanel) {
//AGAIN CODE IS HERE, COMPILES CORRECTLY AND SHOULD WORK FINE
}
I just cannot understand why the onLoadMethod cannot see the correct methods that i have defined in the same class?? what am i doing wrong??
Many Thanks