本文整理汇总了Java中com.google.gwt.user.client.ui.Grid.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Grid.addStyleName方法的具体用法?Java Grid.addStyleName怎么用?Java Grid.addStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Grid
的用法示例。
在下文中一共展示了Grid.addStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPanel
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private Panel createPanel() {
Label label = new Label("Search Options");
label.addStyleName("search-header");
label.getElement().getStyle().setDisplay(Display.BLOCK);
Grid grid = new Grid(2,2);
grid.setText(0, 0, "Ontology/Codelist:");
grid.setWidget(0, 1, ontologiesDropBox);
grid.setText(1, 0, "Include Synonyms:");
grid.setWidget(1, 1, includeSynonyms);
grid.addStyleName("search-options");
CellFormatter cellFormatter = grid.getCellFormatter();
for(int i = 0; i < grid.getRowCount(); i++) {
cellFormatter.addStyleName(i, 0, "search-option");
}
Panel panel = new FlowPanel();
panel.add(label);
panel.add(grid);
return panel;
}
示例2: 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;
}
示例3: buildBannerTable
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public HTMLTable buildBannerTable(final int rows, final int cols) {
final Grid gridLayout = new Grid(rows, cols);
gridLayout.addStyleName(ProjectView.STYLE_HEADER_BANNER_FLEX);
gridLayout.setCellPadding(0);
gridLayout.setCellSpacing(0);
gridLayout.setWidth("100%");
gridLayout.setHeight("100%");
for (int i = 0; i < gridLayout.getColumnCount() - 1; i++) {
gridLayout.getColumnFormatter().setWidth(i, "325px");
}
return gridLayout;
}
示例4: createProjectBannerPanel
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Creates the project banner panel.
*
* @return The project banner panel.
*/
private Component createProjectBannerPanel() {
// Main panel.
projectBannerPanel = Panels.content(I18N.CONSTANTS.loading()); // Temporary title.
// Main grid.
projectBannerGrid = new Grid(1, 2);
projectBannerGrid.addStyleName(STYLE_HEADER_BANNER);
projectBannerGrid.setCellPadding(0);
projectBannerGrid.setCellSpacing(0);
projectBannerGrid.setWidth("100%");
projectBannerGrid.setHeight("100%");
// Logo cell style.
projectBannerGrid.getCellFormatter().setStyleName(HEADER_BANNER_LOGO_CELL.left, HEADER_BANNER_LOGO_CELL.right, STYLE_HEADER_BANNER_LOGO);
projectBannerPanel.add(projectBannerGrid);
return projectBannerPanel;
}
示例5: createOrgUnitBannerPanel
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Creates the OrgUnit banner panel.
*
* @return The OrgUnit banner panel.
*/
private Component createOrgUnitBannerPanel() {
// Main panel.
orgUnitBannerPanel = Panels.content(I18N.CONSTANTS.orgunit()); // Temporary title.
// Main grid.
orgUnitBannerGrid = new Grid(1, 2);
orgUnitBannerGrid.addStyleName(ProjectView.STYLE_HEADER_BANNER);
orgUnitBannerGrid.setCellPadding(0);
orgUnitBannerGrid.setCellSpacing(0);
orgUnitBannerGrid.setWidth("100%");
orgUnitBannerGrid.setHeight("100%");
// Logo cell.
orgUnitBannerGrid.getCellFormatter().setStyleName(HEADER_BANNER_LOGO_CELL.left, HEADER_BANNER_LOGO_CELL.right, ProjectView.STYLE_HEADER_BANNER_LOGO);
orgUnitBannerGrid.setWidget(HEADER_BANNER_LOGO_CELL.left, HEADER_BANNER_LOGO_CELL.right, OrgUnitImageBundle.ICONS.orgUnitLarge().createImage());
orgUnitBannerPanel.add(orgUnitBannerGrid);
return orgUnitBannerPanel;
}
示例6: 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);
}
示例7: createPreviousCheckpointsTable
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private Widget createPreviousCheckpointsTable(List<Project> checkpointProjects) {
Grid table = new Grid(1 + checkpointProjects.size(), 3);
table.addStyleName("ode-ProjectTable");
// Set the widgets for the header row.
table.getRowFormatter().setStyleName(0, "ode-ProjectHeaderRow");
table.setWidget(0, 0, new Label(MESSAGES.projectNameHeader()));
table.setWidget(0, 1, new Label(MESSAGES.projectDateCreatedHeader()));
table.setWidget(0, 2, new Label(MESSAGES.projectDateModifiedHeader()));
// Set the widgets for the rows representing previous checkpoints
DateTimeFormat dateTimeFormat = DateTimeFormat.getMediumDateTimeFormat();
int row = 1;
for (Project checkpointProject : checkpointProjects) {
table.getRowFormatter().setStyleName(row, "ode-ProjectRowUnHighlighted");
Label nameLabel = new Label(checkpointProject.getProjectName());
table.setWidget(row, 0, nameLabel);
Date dateCreated = new Date(checkpointProject.getDateCreated());
table.setWidget(row, 1, new Label(dateTimeFormat.format(dateCreated)));
Date dateModified = new Date(checkpointProject.getDateModified());
table.setWidget(row, 2, new Label(dateTimeFormat.format(dateModified)));
row++;
}
return table;
}
示例8: ProjectList
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Creates a new ProjectList
*/
public ProjectList() {
projects = new ArrayList<Project>();
selectedProjects = new ArrayList<Project>();
projectWidgets = new HashMap<Project, ProjectWidgets>();
sortField = SortField.DATE_MODIFIED;
sortOrder = SortOrder.DESCENDING;
// Initialize UI
table = new Grid(1, 5); // The table initially contains just the header row.
table.addStyleName("ode-ProjectTable");
table.setWidth("100%");
table.setCellSpacing(0);
nameSortIndicator = new Label("");
dateCreatedSortIndicator = new Label("");
dateModifiedSortIndicator = new Label("");
publishedSortIndicator = new Label("");
refreshSortIndicators();
setHeaderRow();
VerticalPanel panel = new VerticalPanel();
panel.setWidth("100%");
panel.add(table);
initWidget(panel);
// It is important to listen to project manager events as soon as possible.
Ode.getInstance().getProjectManager().addProjectManagerEventListener(this);
gallery = GalleryClient.getInstance();
}
示例9: SimpleColorPicker
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Instantiates a new simple color picker.
*
* @param colopicker the colopicker
*/
public SimpleColorPicker(ComplexColorPicker colopicker) {
super(colopicker);
style.ensureInjected();
final Grid grid = new Grid(ROWS, COLS);
grid.setCellSpacing(0);
grid.getRowFormatter().getElement(0).addClassName(style.firstRow());
grid.getRowFormatter().getElement(1).addClassName(style.firstRow());
int row;
int col;
int num = 0;
for (final String c : COLORS) {
row = num / COLS;
col = num % COLS;
grid.setWidget(row, col, createCell(c));
num++;
}
grid.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
Cell cell = grid.getCellForEvent(event);
if (cell != null) {
String color = COLORS[cell.getRowIndex() * COLS + cell.getCellIndex()];
onColorChoose(color);
}
}
});
grid.addStyleName(style.grid());
initWidget(grid);
}
示例10: BallotWidget
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public BallotWidget(BallotSheetView bsv, EasyVoteAsyncCallback<Void> cb) {
electionInfo = new VerticalPanel();
this.add(electionInfo);
electionIdLabel = new Label("Election id: " + bsv.getElectionId());
electionInfo.add(electionIdLabel);
electionQuestion = new Label(bsv.getQuestion());
this.add(electionQuestion);
squares = new ArrayList<RadioButton>();
callback = cb;
List<CandidateView> candidateList = bsv.getCandidates();
optionsTable = new Grid(candidateList.size()+1, 2);
optionsTable.addStyleName("BallotWidget-optionsTable");
for (int i = 0; i < candidateList.size(); i++) {
optionsTable.getCellFormatter().addStyleName(i, 0, "BallotWidget-optionsTableCells");
optionsTable.getCellFormatter().addStyleName(i, 1, "BallotWidget-optionsTableCells");
optionsTable.getCellFormatter().setHorizontalAlignment(i, 1, HasHorizontalAlignment.ALIGN_CENTER);
optionsTable.setText(i, 0, candidateList.get(i).getName());
RadioButton button = new RadioButton("candidates");
squares.add(button);
optionsTable.setWidget(i, 1, button);
}
this.add(optionsTable);
submitVoteButton = new Button("Submit Vote");
submitVoteButton.addStyleName("BallotWidget-submitVoteButton");
submitVoteButton.addClickHandler(new SubmitHandler());
this.add(submitVoteButton);
submitBlankVoteButton = new Button("Submit Blank Vote");
submitBlankVoteButton.addStyleName("BallotWidget-submitVoteButton");
submitBlankVoteButton.addClickHandler(new SubmitBlankHandler());
this.add(submitBlankVoteButton);
this.addStyleName("easyvote-BallotWidget");
}
示例11: setSelector
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public void setSelector(IsWidget selector) {
Grid grid = new Grid(1, 2);
grid.getElement().setId("SelectorGrid");
grid.setWidget(0, 0, selector.asWidget());
clear();
add(menu);
add(menuBorder);
add(grid);
if (!hiddenMenu) {
setWidgetTopHeight(menu, 0, Unit.PX, DesignConstants.base(), Unit.PX);
setWidgetTopHeight(
menuBorder,
DesignConstants.base(),
Unit.PX,
DesignConstants.b0d125(),
Unit.PX);
setWidgetTopBottom(
grid,
DesignConstants.base() + DesignConstants.b0d125(),
Unit.PX,
0,
Unit.PX);
} else {
setWidgetTopHeight(menu, 0, Unit.PX, 0, Unit.PX);
setWidgetTopHeight(menuBorder, 0, Unit.PX, 0, Unit.PX);
setWidgetTopBottom(grid, 0, Unit.PX, 0, Unit.PX);
}
grid.setWidget(0, 1, target);
grid.addStyleName(ResourceHelper.getRes().style().menuRendererWidgetContainer());
grid.getCellFormatter().getElement(0, 0).getStyle().setWidth(1, Unit.PX);
grid.getRowFormatter().getElement(0).getStyle().setVerticalAlign(VerticalAlign.TOP);
selectorRendered = true;
}
示例12: 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);
}
示例13: SimpleColorPicker
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Instantiates a new simple color picker.
*
* @param colopicker the colopicker
*/
public SimpleColorPicker(ComplexColorPicker colopicker) {
super(colopicker);
style.ensureInjected();
final Grid grid = new Grid(ROWS, COLS);
grid.setCellSpacing(0);
grid.getRowFormatter().getElement(0).addClassName(style.firstRow());
grid.getRowFormatter().getElement(1).addClassName(style.firstRow());
int row;
int col;
int num = 0;
for (final String c : COLORS) {
row = num / COLS;
col = num % COLS;
grid.setWidget(row, col, createCell(c));
num++;
}
grid.addClickHandler(new ClickHandler() {
public void onClick(final ClickEvent event) {
Cell cell = grid.getCellForEvent(event);
if (cell != null) {
String color = COLORS[cell.getRowIndex() * COLS + cell.getCellIndex()];
onColorChoose(color);
}
}
});
grid.addStyleName(style.grid());
initWidget(grid);
}
示例14: addDialogWidgets
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
VerticalPanel vertPanel = new VerticalPanel();
Grid grid = new Grid(4,2);
HorizontalPanel buttonsHPanel = new HorizontalPanel();
DisclosurePanel recentlyViewedPanel = new DisclosurePanel("Recently Viewed Terms");
DisclosurePanel recentlyCreatedPanel = new DisclosurePanel("Recently Created Terms");
Button cancelButton = new Button("Cancel");
recentlyViewedPanel.getHeader().addStyleName("dialog-label");
recentlyViewedPanel.add(recentlyViewTable);
recentlyCreatedPanel.getHeader().addStyleName("dialog-label");
recentlyCreatedPanel.add(recentlyCreatedTable);
cancelButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
dialogBox.hide();
if(currentTerm != null) {
eventBus.fireEvent(new ViewTermEvent(currentTerm));
}
}
});
grid.addStyleName("gwt-Grid");
errorLabel.addStyleName("dialog-error");
buttonsHPanel.addStyleName("dialog-buttons");
buttonsHPanel.addStyleName("centered-hortz");
vertPanel.addStyleName("dialog-vpanel");
//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
int row = 0, col = 0;
grid.setWidget(row, col, new Label("Ontology:"));
grid.setWidget(++row, col, new Label("Term:"));
grid.setWidget(++row, col, new Label("Relationship:"));
grid.setWidget(++row, col, new Label("Related Term:"));
row = 0;
col = 1;
grid.setWidget(row, col, ontologyLabel);
grid.setWidget(++row, col, termLabel);
grid.setWidget(++row, col, typeDropBox);
grid.setWidget(++row, col, relatedTermLabel);
for(row = col = 0; row < grid.getRowCount(); row++) {
Label label = (Label)grid.getWidget(row, col);
label.addStyleName("dialog-label");
}
buttonsHPanel.add(addButton);
buttonsHPanel.add(cancelButton);
vertPanel.add(grid);
vertPanel.add(recentlyViewedPanel);
vertPanel.add(recentlyCreatedPanel);
vertPanel.add(errorLabel);
vertPanel.add(buttonsHPanel);
dialogBox.setWidget(vertPanel);
}
示例15: addDialogWidgets
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void addDialogWidgets() {
VerticalPanel vertPanel = new VerticalPanel();
SimplePanel decPanel = new SimplePanel();
Grid grid = new Grid(4,2);
HorizontalPanel buttonsHPanel = new HorizontalPanel();
Label commentsLabel = new Label("Comments:");
Button cancelButton = new Button("Cancel");
decPanel.addStyleName("decorator-panel");
replacementLabel.addStyleName("dialog-label");
commentsLabel.addStyleName("dialog-label");
cancelButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
dialogBox.hide();
relationship = null;
commentsField.setValue(null);
errorLabel.setVisible(false);
}
});
grid.addStyleName("gwt-Grid");
buttonsHPanel.addStyleName("dialog-buttons");
buttonsHPanel.addStyleName("centered-hortz");
vertPanel.addStyleName("dialog-vpanel");
//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
int row = 0, col = 0;
grid.setWidget(row, col, new Label("Ontology:"));
grid.setWidget(++row, col, new Label("Term:"));
grid.setWidget(++row, col, new Label("Relationship:"));
grid.setWidget(++row, col, new Label("Related Term:"));
row = 0;
col = 1;
grid.setWidget(row, col, ontologyLabel);
grid.setWidget(++row, col, termLabel);
grid.setWidget(++row, col, typeLabel);
grid.setWidget(++row, col, relatedTermLabel);
for(row = col = 0; row < grid.getRowCount(); row++) {
Label label = (Label)grid.getWidget(row, col);
label.addStyleName("dialog-label");
}
buttonsHPanel.add(obsoleteButton);
buttonsHPanel.add(cancelButton);
decPanel.setWidget(grid);
//vertPanel.add(grid);
vertPanel.add(decPanel);
vertPanel.add(replacementLabel);
vertPanel.add(table);
vertPanel.add(commentsLabel);
vertPanel.add(commentsField);
vertPanel.add(errorLabel);
vertPanel.add(buttonsHPanel);
dialogBox.setWidget(vertPanel);
}