package info.greenspace.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Hyperlink;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTMLTable;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
/**
* Entry point classes define onModuleLoad().
*/
public class GwtTestApp implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
final TabPanel tabs = new TabPanel();
tabs.add(createTepaPanel(), "TepaEditor");
tabs.add(createTepaBetaPanel(), "TepaEditor Beta");
tabs.add(createOtherSoftsPanel(), "Other");
tabs.getDeckPanel().setStyleName("TabDeckPanel");
tabs.selectTab(0);
// Assume that the host HTML has elements defined whose
// IDs are "slot1", "slot2". In a real app, you probably would not want
// to hard-code IDs. Instead, you could, for example, search for all
// elements with a particular CSS class and replace them with widgets.
//
RootPanel.get("slot-tab").add(tabs);
}
private Widget createTepaPanel()
{
Grid g = createGrid( 4, 2);
g.setText(0, 0, "Name");
g.setText(0, 1, "Download");
g.setText(1, 0, "TepaEditor Ver4.38");
g.setHTML(1, 1, "Download");
g.setText(2, 0, "TepaEditor Ver4.38 installer");
g.setHTML(2, 1, "Download");
g.setText(3, 0, "TepaEditor Ver4.38");
g.setHTML(3, 1, "Download");
VerticalPanel p = new VerticalPanel();
p.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
p.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
p.add(g);
return p;
}
private Widget createTepaBetaPanel()
{
Grid g = createGrid( 2, 2 );
g.setText(0, 0, "Name");
g.setText(0, 1, "Download");
g.setText(1, 0, "TepaEditor Version 5.0 Beta 2.4");
g.setHTML(1, 1, "Download");
VerticalPanel p = new VerticalPanel();
p.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
p.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
p.add(g);
return p;
}
private Widget createOtherSoftsPanel()
{
Grid g = createGrid( 5, 2 );
g.setText(0, 0, "Name");
g.setText(0, 1, "Download");
g.setText(1, 0, "ColorManager Ver1.50");
g.setHTML(1, 1, "Download");
g.setText(2, 0, "BGI Checker Ver1.10");
g.setHTML(2, 1, "Download");
g.setText(3, 0, "GebaType. Ver1.10");
g.setHTML(3, 1, "Download");
g.setText(4, 0, "VisualBasic5(SP2) Runtime kit");
g.setHTML(4, 1, "Download");
VerticalPanel p = new VerticalPanel();
p.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
p.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
p.add(g);
return p;
}
private Grid createGrid( int aRow, int aCol )
{
Grid g = new Grid(aRow, aCol);
g.setCellSpacing(0);
g.setCellPadding(5);
for( int col = 0; col < aCol; col++ )
{
g.getCellFormatter().setStyleName(0, col, "table-header");
g.getCellFormatter().setWordWrap(0, col, false);
}
for( int row = 1; row < aRow; row++ )
{
for( int col = 0; col < aCol; col++ )
{
g.getCellFormatter().setStyleName(row, col, "table-cell");
g.getCellFormatter().setWordWrap(row, col, false);
}
}
return g;
}
}