本文整理汇总了Java中com.google.gwt.user.client.ui.Grid.setCellSpacing方法的典型用法代码示例。如果您正苦于以下问题:Java Grid.setCellSpacing方法的具体用法?Java Grid.setCellSpacing怎么用?Java Grid.setCellSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Grid
的用法示例。
在下文中一共展示了Grid.setCellSpacing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ColourPickerTableView
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public ColourPickerTableView() {
Grid grid = new Grid(50, 50);
grid.setBorderWidth(0);
grid.setCellPadding(0);
grid.setCellSpacing(0);
final double columnCount = grid.getColumnCount();
final double rowCount = grid.getRowCount();
for (int row = 0; row < rowCount; row++) {
for (int column = 0; column < columnCount; column++) {
final Element element = grid.getCellFormatter().getElement(row, column);
final int rowValue = 255 - (int) (row / (rowCount - 1) * 255);
final int columnValue = (int) (column / (columnCount - 1) * 255);
final int colourValue = (int) (columnValue * (1 - row / (rowCount - 1)));
element.setAttribute("style", "height:5px;width:5px;border:0px none;font-size:1px;color:#FFFFFF;background:rgb(" + colourValue + "," + rowValue + "," + rowValue + ")");
}
}
add(grid);
}
开发者ID:languageininteraction,项目名称:GraphemeColourSynaesthesiaApp,代码行数:19,代码来源:ColourPickerTableView.java
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: ClearableField
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public ClearableField(final Field<T> field) {
super(new Grid(1, 2));
setLabelSeparator(field.getLabelSeparator());
setFieldLabel(field.getFieldLabel());
this.field = field;
this.deleteIcon = IconImageBundle.ICONS.deleteIcon().createImage();
Grid grid = (Grid) widget;
grid.setWidget(0, 0, field);
grid.setWidget(0, 1, deleteIcon);
grid.setCellSpacing(1);
grid.getCellFormatter().setWidth(0, 1, "5px");
addClearHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
field.clear();
}
});
}
示例6: buildStructure
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
private void buildStructure(Rendering rendering) {
switch (rendering) {
case HORIZONTAL:
Grid g = new Grid(1, 2);
g.setWidget(0, 0, tb);
g.setWidget(0, 1, img);
initWidget(g);
g.setCellSpacing(0);
g.setCellPadding(0);
g.setBorderWidth(0);
break;
case VERTICAL:
default:
FlowPanel fp = new FlowPanel();
fp.add(img);
fp.add(tb);
initWidget(fp);
setPixelSize(150, 80);
break;
}
}
示例7: 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();
}
示例8: 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);
}
示例9: setProjectType
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setProjectType(final ProjectModelType type) {
final Grid iconGrid = new Grid(1, 2);
iconGrid.setCellPadding(0);
iconGrid.setCellSpacing(0);
iconGrid.setWidget(0, 0, FundingIconProvider.getProjectTypeIcon(type, IconSize.MEDIUM).createImage());
DOM.setStyleAttribute(iconGrid.getCellFormatter().getElement(0, 0), "paddingTop", "2px");
iconGrid.setText(0, 1, ProjectModelType.getName(type));
DOM.setStyleAttribute(iconGrid.getCellFormatter().getElement(0, 1), "paddingLeft", "5px");
projectTypeField.setValue(iconGrid.getElement().getString());
}
示例10: MouseListBox
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Used by {@link ListBoxDragController} to create a draggable listbox
* containing the selected items.
*/
MouseListBox(int size) {
grid = new Grid(size, 1);
initWidget(grid);
grid.setCellPadding(0);
grid.setCellSpacing(0);
addStyleName(CSS_DEMO_MOUSELISTBOX);
for (int i = 0; i < size; i++) {
grid.getCellFormatter().addStyleName(i, 0, CSS_DEMO_DUAL_LIST_EXAMPLE_ITEM);
setWidget(i, null);
}
}
示例11: 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);
}
示例12: FormPanelComponent
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public FormPanelComponent() {
Grid grid = new Grid(1,1);
grid.setCellPadding(0);
grid.setCellSpacing(0);
setPanelWidget(grid);
}
示例13: onModuleLoad
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
public void onModuleLoad() {
final Mediator mediator = new Mediator();
final Header header = new Header(mediator);
final MainWidget mainWidget = new MainWidget(mediator);
final Grid majorLayoutPanel = new Grid(2, 1);
majorLayoutPanel.setCellSpacing(0);
majorLayoutPanel.setWidget(0, 0, header);
majorLayoutPanel.getCellFormatter().setStyleName(0, 0, "headerCell");
majorLayoutPanel.setWidget(1, 0, mainWidget);
majorLayoutPanel.getCellFormatter().setStyleName(1, 0, "mainWidgetCell");
majorLayoutPanel.setStylePrimaryName("majorLayout");
mediator.setMajorLayoutPanel(majorLayoutPanel);
History.addHistoryListener(new HistoryListener(mediator));
RootPanel.get("client").add(majorLayoutPanel);
}
示例14: 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;
}
示例15: Application
import com.google.gwt.user.client.ui.Grid; //导入方法依赖的package包/类
/**
* Constructor.
*/
public Application() {
// Setup the main layout widget
FlowPanel layout = new FlowPanel();
initWidget(layout);
// Setup the top panel with the title and links
createTopPanel();
layout.add(topPanel);
// Add the main menu
bottomPanel = new HorizontalPanel();
bottomPanel.setWidth("100%");
bottomPanel.setSpacing(0);
bottomPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
layout.add(bottomPanel);
createMainMenu();
bottomPanel.add(mainMenu);
// Setup the content layout
contentLayout = new Grid(2, 1);
contentLayout.setCellPadding(0);
contentLayout.setCellSpacing(0);
contentDecorator = new DecoratorPanel();
contentDecorator.setWidget(contentLayout);
contentDecorator.addStyleName(DEFAULT_STYLE_NAME + "-content-decorator");
bottomPanel.add(contentDecorator);
if (LocaleInfo.getCurrentLocale().isRTL()) {
bottomPanel.setCellHorizontalAlignment(contentDecorator,
HasHorizontalAlignment.ALIGN_LEFT);
contentDecorator.getElement().setAttribute("align", "LEFT");
} else {
bottomPanel.setCellHorizontalAlignment(contentDecorator,
HasHorizontalAlignment.ALIGN_RIGHT);
contentDecorator.getElement().setAttribute("align", "RIGHT");
}
CellFormatter formatter = contentLayout.getCellFormatter();
formatter.setStyleName(0, 0, DEFAULT_STYLE_NAME + "-content-title");
setContentTitle(new HTML("jCommerce Administation"));
// Add the content wrapper
contentWrapper = new SimplePanel();
contentLayout.setWidget(1, 0, contentWrapper);
formatter.setStyleName(1, 0, DEFAULT_STYLE_NAME + "-content-wrapper");
setContent(null);
rightButton.setVisible(false);
}