本文整理匯總了Java中com.google.gwt.user.client.ui.Grid.setHTML方法的典型用法代碼示例。如果您正苦於以下問題:Java Grid.setHTML方法的具體用法?Java Grid.setHTML怎麽用?Java Grid.setHTML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.Grid
的用法示例。
在下文中一共展示了Grid.setHTML方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createStatTable
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private Grid createStatTable(DBStatistics result)
{
Grid table = new Grid(3, 2);
table.addStyleName("stat");
table.setHTML(0, 0, "the number of clouds <b>in total</b>");
table.setHTML(1, 0, "the number of clouds constructed <b>last month</b>");
table.setHTML(2, 0, "the number of clouds constructed <b>last week</b>");
table.setHTML(0, 1, "" + result.getTotal());
table.setHTML(1, 1, "" + result.getLastMonth());
table.setHTML(2, 1, "" + result.getLastWeek());
CellFormatter cf = table.getCellFormatter();
cf.setWidth(0, 0, "65%");
cf.setWidth(0, 1, "35%");
return table;
}
示例2: createAndAddFilterGrid
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private void createAndAddFilterGrid() {
filterGrid = new Grid(2, 3);
filterGrid.setHTML(0, 0, translatorappI18n.transPage_moduleSelect());
moduleListBox =
new ListBoxFW(
formCtx,
new RelationFDesc("", "", ModuleConsts.descriptorName).setNullable(true),
new WidgetRDesc());
filterGrid.setWidget(0, 1, moduleListBox);
massUpload = new IneButton(IneButtonType.ACTION, translatorappI18n.massUpload());
filterGrid.setWidget(0, 2, massUpload);
massUpload.setVisible(false);
filterGrid.setHTML(1, 0, translatorappI18n.rowListPage_magicFilter());
textBox = new TextBoxFW();
filterGrid.setWidget(1, 1, textBox);
filterGrid.getElement().getStyle().setMarginBottom(25, Unit.PX);
filterGrid.getElement().getStyle().setMarginLeft(5, Unit.PX);
mainPanel.add(filterGrid);
}
示例3: createAndAddFilterGrid
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private void createAndAddFilterGrid() {
Grid filterGrid = new Grid(2, 2);
filterGrid.setHTML(0, 0, translatorappI18n.transPage_listmodeSelect());
listTypeRadioButton =
new RadioEnumSelectorFW(
new LongFDesc().setNullable(false),
TranslateListingType.getValuesAsString(),
new WidgetRDesc());
filterGrid.setWidget(0, 1, listTypeRadioButton);
filterGrid.setHTML(1, 0, translatorappI18n.transPage_moduleSelect());
moduleListBox =
new ListBoxFW(
formCtx,
new RelationFDesc("", "", ModuleConsts.descriptorName).setNullable(true),
new WidgetRDesc());
filterGrid.setWidget(1, 1, moduleListBox);
filterGrid.getElement().getStyle().setMarginBottom(25, Unit.PX);
filterGrid.getElement().getStyle().setMarginLeft(5, Unit.PX);
filterGrid.getElement().getStyle().setHeight(90, Unit.PX);
filterGrid.getElement().getStyle().setWidth(700, Unit.PX);
mainPanel.add(filterGrid);
}
示例4: setPlayerList
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public void setPlayerList(List<PacketMatchingPlayer> players) {
final Grid grid = new Grid(players.size(), 3);
grid.addStyleName("gridFrame");
grid.addStyleName("gridFontNormal");
for (int row = 0; row < players.size(); ++row) {
final PacketMatchingPlayer player = players.get(row);
final Image image = new Image(Constant.ICON_URL_PREFIX + player.imageFileName);
image.setPixelSize(Constant.ICON_SIZE, Constant.ICON_SIZE);
grid.setWidget(row, 0, image);
grid.setHTML(row, 1, player.playerSummary.asSafeHtml());
grid.setText(row, 2, player.greeting);
}
panelGrid.setWidget(grid);
}
示例5: SpellcheckSearchContextComponent
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public SpellcheckSearchContextComponent() {
super("Spellchecking");
grid = new Grid(6, 2);
grid.setHTML(0, 0, "<b>Enabled</b>");
grid.setHTML(1, 0, "<b>Dictionary</b>");
grid.setHTML(2, 0, "<b>Count</b>");
grid.setHTML(3, 0, "<b>Only More Popular</b>");
grid.setHTML(4, 0, "<b>Collate</b>");
grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(4, 1, HasHorizontalAlignment.ALIGN_CENTER);
main.setContent(grid);
}
示例6: HighlightSearchContextComponent
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public HighlightSearchContextComponent() {
super("Highlighting");
grid = new Grid(4, 2);
grid.setHTML(0, 0, "<b>Enabled</b>");
grid.setHTML(1, 0, "<b>Fields</b>");
grid.setHTML(2, 0, "<b>Prefix</b>");
grid.setHTML(3, 0, "<b>Suffix</b>");
grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_CENTER);
main.setContent(grid);
}
示例7: CommonSearchContextComponent
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public CommonSearchContextComponent() {
super("Common");
grid = new Grid(4, 2);
grid.setHTML(0, 0, "<b>Text Query</b>");
grid.setHTML(1, 0, "<b>Page Index</b>");
grid.setHTML(2, 0, "<b>Page Size</b>");
grid.setHTML(3, 0, "<b>Sort</b>");
grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_CENTER);
grid.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_CENTER);
main.setContent(grid);
}
示例8: loadTableIntoPanel
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private void loadTableIntoPanel(DataSet ds, double pixScale, long fileSize){
//set column widths
List<BaseTableData.RowData> rows = ds.getModel().getRows();
int rowLength = 170;
int dataLength;
String rowValue;
for(BaseTableData.RowData row : rows){
rowValue = row.getValue(3);
dataLength = rowValue.length()*6;
//set column width to size of text
if(dataLength > rowLength){
rowLength = dataLength;
}
}
TableDataView.Column c = ds.getColumn(0);
c.setWidth(25);
c = ds.getColumn(1);
c.setWidth(100);
c = ds.getColumn(2);
c.setWidth(100);
c = ds.getColumn(3);
c.setWidth(rowLength);
BasicTable table = new BasicTable(ds);
table.setSize("470px", "375px");
// String[] str = values.split(";");
Grid grid = new Grid (1,2);
HTMLTable.ColumnFormatter colF = grid.getColumnFormatter();
colF.setWidth(0, "200px");
grid.setHTML(0,0,"<b>Pixel Size:</b> " + _nfPix.format(pixScale)+ "''");
grid.setHTML(0,1,"<b>File Size:</b> " + StringUtils.getSizeAsString(fileSize));
_panel.add(grid);
_panel.add(table);
}
示例9: loadTable
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private VerticalPanel loadTable(DataSet ds, double pixScale, long fileSize){
VerticalPanel vp = new FitsHeaderPanel();
//set column widths
List<BaseTableData.RowData> rows = ds.getModel().getRows();
int rowLength = 170;
int dataLength;
String rowValue;
for(BaseTableData.RowData row : rows){
rowValue = row.getValue(3);
dataLength = rowValue.length()*6;
//set column width to size of text
if(dataLength > rowLength){
rowLength = dataLength;
}
}
TableDataView.Column c = ds.getColumn(0);
c.setWidth(25);
c = ds.getColumn(1);
c.setWidth(75);
c = ds.getColumn(2);
c.setWidth(100);
c = ds.getColumn(3);
c.setWidth(rowLength);
BasicTable table = new BasicTable(ds);
table.setSize("400px", "375px");
Grid grid = new Grid (1,2);
HTMLTable.ColumnFormatter colF = grid.getColumnFormatter();
colF.setWidth(0, "200px");
grid.setHTML(0,0,"<b>Pixel Size:</b> " + _nfPix.format(pixScale)+ "''");
grid.setHTML(0,1,"<b>File Size:</b> " + StringUtils.getSizeAsString(fileSize));
vp.add(grid);
vp.add(table);
return vp;
}
示例10: setPlayerList
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public void setPlayerList(List<PacketResult> result) {
panelTransition.setVisible(true);
grid = new Grid(result.size() + 1, 5);
grid.addStyleName("gridFrame");
grid.addStyleName("gridFontNormal");
grid.setText(0, 1, "プレイヤー名");
grid.setText(0, 2, "得點");
grid.setText(0, 3, "順位");
grid.setText(0, 4, "レーティング");
for (int i = 0; i < result.size(); ++i) {
PacketResult player = result.get(i);
Image image = new Image(Constant.ICON_URL_PREFIX + player.imageFileName);
image.setPixelSize(Constant.ICON_SIZE, Constant.ICON_SIZE);
int row = i + 1;
grid.setWidget(row, 0, image);
grid.setHTML(row, 1, player.playerSummary.asResultSafeHtml());
grid.setText(row, 2, player.score + "點");
grid.setText(row, 3, player.rank + "位");
int newRating = player.newRating;
if (newRating <= 0) {
continue;
}
SafeHtml ratingChange;
int oldRating = player.playerSummary.rating;
if (oldRating < newRating) {
ratingChange = TEMPLATE.up(oldRating, newRating);
} else if (oldRating == newRating) {
ratingChange = TEMPLATE.equal(oldRating, newRating);
} else {
ratingChange = TEMPLATE.down(oldRating, newRating);
}
grid.setHTML(row, 4, ratingChange.asString());
}
panelPlayer.add(grid);
}
示例11: InputWidgetHayaimono
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public InputWidgetHayaimono(PacketProblem problem, AnswerView answerView,
QuestionPanel questionPanel, SessionData sessionData) {
super(problem, answerView, questionPanel, sessionData);
int numberOfChoices = problem.getNumberOfShuffledChoices();
buttons = new Button[numberOfChoices];
int numberOfRows = numberOfChoices / 2;
Grid grid = new Grid(numberOfRows, 4);
add(grid);
for (int i = 0; i < numberOfChoices; ++i) {
String choice = problem.shuffledChoices[i];
// BugTrack-QMAClone/387 - QMAClone wiki
// http://kishibe.dyndns.tv/qmaclone/wiki/wiki.cgi?page=BugTrack%2DQMAClone%2F387#1322577322
Button button = new Button(toMultilineSafeHtml(choice), this);
button.setStyleName(BUTTON_HAYAIMONO);
buttonToChoice.put(button, choice);
buttons[i] = button;
grid.setHTML(i % numberOfRows, i / numberOfRows * 2, Integer.toString(i + 1));
grid.setWidget(i % numberOfRows, i / numberOfRows * 2 + 1, button);
}
int numberOfAnswers = problem.getNumberOfShuffledAnswers();
// BugTrack-QMAClone/384 - QMAClone wiki
// http://kishibe.dyndns.tv/qmaclone/wiki/wiki.cgi?page=BugTrack%2DQMAClone%2F384
numberOfSeats = numberOfAnswersToNumberOfSeats.get(numberOfAnswers);
}
示例12: createTable
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
private Grid createTable(List<WordCloud> clouds, boolean debug)
{
Grid table = new Grid(clouds.size() + 1, debug ? 4 : 3);
table.addStyleName("latest");
CellFormatter cf = table.getCellFormatter();
table.setHTML(0, 0, "<b>id</b>");
table.setHTML(0, 1, "<b>creation date</b>");
table.setHTML(0, 2, "<b>source</b>");
cf.setWidth(0, 0, "10%");
cf.setWidth(0, 1, "25%");
cf.setWidth(0, 2, "65%");
cf.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
cf.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER);
cf.setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_CENTER);
if (debug)
{
table.setHTML(0, 3, "<b>ip</b>");
cf.setWidth(0, 1, "20%");
cf.setWidth(0, 2, "60%");
cf.setWidth(0, 3, "10%");
cf.setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_CENTER);
}
for (int i = 0; i < clouds.size(); i++)
{
WordCloud cloud = clouds.get(i);
table.setHTML(i + 1, 0, "<a href='/cloud.html?id=" + cloud.getId() + "'>" + cloud.getId() + "</a>");
Date dt = cloud.getCreationDateAsDate();
table.setHTML(i + 1, 1, DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(dt));
table.setWidget(i + 1, 2, createSourceField(cloud, debug));
cf.setHorizontalAlignment(i + 1, 2, HasHorizontalAlignment.ALIGN_LEFT);
if (debug)
{
table.setHTML(i + 1, 3, cloud.getCreatorIP());
}
}
return table;
}
示例13: PanelSearchProblem
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
public PanelSearchProblem() {
setWidth("800px");
setHorizontalAlignment(ALIGN_CENTER);
add(new Label("問題の検索を行います"));
{
textBoxQuery.addKeyDownHandler(this);
textBoxCreator.addKeyDownHandler(this);
textBoxQuery.setWidth("200px");
textBoxCreator.setWidth("200px");
listBoxMaxProblemsPerPage.setWidth("200px");
listBoxMaxProblemsPerPage.addItem("10");
listBoxMaxProblemsPerPage.addItem("100");
listBoxMaxProblemsPerPage.addItem("1000");
listBoxMaxProblemsPerPage.setSelectedIndex(1);
final Grid grid = new Grid(3, 2);
grid.addStyleName("gridFrame");
grid.addStyleName("gridFontNormal");
grid.setHTML(0, 0, "問題文");
grid.setWidget(0, 1, textBoxQuery);
grid.setHTML(1, 0, "問題作成者");
grid.setWidget(1, 1, textBoxCreator);
grid.setHTML(2, 0, "1ページあたりの表示問題數");
grid.setWidget(2, 1, listBoxMaxProblemsPerPage);
add(grid);
}
{
listBoxCreatorMatching.addItem("完全一致");
listBoxCreatorMatching.addItem("部分一致");
final HorizontalPanel panel = new HorizontalPanel();
panel.add(new Label("問題作成者の検索方法"));
panel.add(listBoxCreatorMatching);
add(panel);
}
add(multiItemSelectorGenre);
add(multiItemSelectorType);
add(multiItemSelectorRandomFlag);
add(new HTML(new SafeHtmlBuilder().appendEscapedLines(
"複數の単語を空白で區切るとAND検索となります。\n" + "複數の単語を「OR」で區切るとOR検索となります。「OR」は大文字で入力してください。\n"
+ "単語の先頭に「-」(ハイフン)を加えると除外検索となります。").toSafeHtml()));
add(buttonSearch);
add(panelGrid);
}
示例14: onInitialize
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a new panel
widgetMap = new LinkedHashMap<String, Widget>();
absolutePanel = new AbsolutePanel();
absolutePanel.setSize("250px", "250px");
absolutePanel.ensureDebugId("cwAbsolutePanel");
// Add an HTML widget to the panel
String[] widgetNames = constants.cwAbsolutePanelWidgetNames();
HTML text = new HTML(constants.cwAbsolutePanelHelloWorld());
absolutePanel.add(text, 10, 20);
widgetMap.put(widgetNames[0], text);
// Add a Button to the panel
Button button = new Button(constants.cwAbsolutePanelClickMe());
absolutePanel.add(button, 80, 45);
widgetMap.put(widgetNames[1], button);
// Add a Button to the panel
Grid grid = new Grid(2, 3);
grid.setBorderWidth(1);
for (int i = 0; i < 3; i++) {
grid.setHTML(0, i, i + "");
grid.setWidget(1, i, new Image(Showcase.images.gwtLogoThumb()));
}
absolutePanel.add(grid, 60, 100);
widgetMap.put(widgetNames[2], grid);
// Wrap the absolute panel in a DecoratorPanel
DecoratorPanel absolutePanelWrapper = new DecoratorPanel();
absolutePanelWrapper.setWidget(absolutePanel);
// Create the options bar
DecoratorPanel optionsWrapper = new DecoratorPanel();
optionsWrapper.setWidget(createOptionsBar());
// Add the components to a panel and return it
HorizontalPanel mainLayout = new HorizontalPanel();
mainLayout.setSpacing(10);
mainLayout.add(optionsWrapper);
mainLayout.add(absolutePanelWrapper);
return mainLayout;
}
示例15: createAdvancedForm
import com.google.gwt.user.client.ui.Grid; //導入方法依賴的package包/類
/**
* Create a form that contains undisclosed advanced options.
*/
@ShowcaseSource
private Widget createAdvancedForm() {
// Create a table to layout the form options
FlexTable layout = new FlexTable();
layout.setCellSpacing(6);
layout.setWidth("300px");
FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();
// Add a title to the form
layout.setHTML(0, 0, constants.cwDisclosurePanelFormTitle());
cellFormatter.setColSpan(0, 0, 2);
cellFormatter.setHorizontalAlignment(
0, 0, HasHorizontalAlignment.ALIGN_CENTER);
// Add some standard form options
layout.setHTML(1, 0, constants.cwDisclosurePanelFormName());
layout.setWidget(1, 1, new TextBox());
layout.setHTML(2, 0, constants.cwDisclosurePanelFormDescription());
layout.setWidget(2, 1, new TextBox());
// Create some advanced options
HorizontalPanel genderPanel = new HorizontalPanel();
String[] genderOptions = constants.cwDisclosurePanelFormGenderOptions();
for (int i = 0; i < genderOptions.length; i++) {
genderPanel.add(new RadioButton("gender", genderOptions[i]));
}
Grid advancedOptions = new Grid(2, 2);
advancedOptions.setCellSpacing(6);
advancedOptions.setHTML(0, 0, constants.cwDisclosurePanelFormLocation());
advancedOptions.setWidget(0, 1, new TextBox());
advancedOptions.setHTML(1, 0, constants.cwDisclosurePanelFormGender());
advancedOptions.setWidget(1, 1, genderPanel);
// Add advanced options to form in a disclosure panel
DisclosurePanel advancedDisclosure = new DisclosurePanel(
constants.cwDisclosurePanelFormAdvancedCriteria());
advancedDisclosure.setAnimationEnabled(true);
advancedDisclosure.ensureDebugId("cwDisclosurePanel");
advancedDisclosure.setContent(advancedOptions);
layout.setWidget(3, 0, advancedDisclosure);
cellFormatter.setColSpan(3, 0, 2);
// Wrap the contents in a DecoratorPanel
DecoratorPanel decPanel = new DecoratorPanel();
decPanel.setWidget(layout);
return decPanel;
}