本文整理汇总了Java中com.google.gwt.user.client.ui.Grid类的典型用法代码示例。如果您正苦于以下问题:Java Grid类的具体用法?Java Grid怎么用?Java Grid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Grid类属于com.google.gwt.user.client.ui包,在下文中一共展示了Grid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGrid
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
/**
* Create a Grid that describes the job
*/
@SuppressWarnings("deprecation")
private Grid createGrid() {
Grid grid = new Grid(2, 2);
grid.setWidth("280px");
grid.setWidget(0, 0, new Label(Constants.studioUIMsg.jobName()));
/**
* Panel information
*/
namebox.setStyleName("boxstyle");
grid.setWidget(0, 1, namebox);
grid.setWidget(1, 0, new Label(Constants.studioUIMsg.jobDescription()));
SubmitListener sl = new SubmitListener();
namebox.addKeyboardListener(sl);
descArea.setStyleName("boxstyle");
descArea.setHeight("auto");
grid.setWidget(1, 1, descArea);
grid.setStyleName("bda-newjob-grid");
return grid;
}
示例2: initGridHead
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
protected void initGridHead(int size){
this.setSpacing(3);
paramsGrid = new Grid(size, 3);
paramsGrid.setStyleName("gridstyle");
paramsGrid.setBorderWidth(1);
paramsGrid.setWidth("250px");
Label nameLabel = new Label(Constants.studioUIMsg.parameter());
nameLabel.setWidth("65px");
paramsGrid.setWidget(0, 0, nameLabel);
Label typeLabel = new Label(Constants.studioUIMsg.type());
typeLabel.setWidth("40px");
paramsGrid.setWidget(0, 1, typeLabel);
Label valueLabel = new Label(Constants.studioUIMsg.value());
paramsGrid.setWidget(0, 2, valueLabel);
paramsGrid.setVisible(false);
}
示例3: 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;
}
示例4: DefaultCardGrid
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
@Inject
public DefaultCardGrid(@BackOfCard Provider<Image> backOfCard,
@Rows int rows, @Columns int columns) {
// we use a Provider to avoid weird results with duplicate images in Grid
this.backOfCard = backOfCard;
this.grid = new Grid(rows, columns);
this.rows = rows;
this.columns = columns;
grid.addStyleName("cardGrid");
reset();
initWidget(grid);
}
示例5: loadLayoutStructure
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
private void loadLayoutStructure() {
page = new VerticalPanel();
mainView = new HorizontalPanel();
leftPanel = new VerticalPanel();
mainView.setStyleName("mainViewLayer");
mainView.setWidth("100%");
leftPanel.setStyleName("leftPanelLayer");
leftPanel.setWidth("700px");
page.setWidth("100%");
Label title = new Label("Import configuration");
title.setStyleName("title");
//Main layout
page.add(title);
page.add(mainView);
//Left layout
mainView.add(leftPanel);
grid = new Grid(1,2);
grid.setCellPadding(5);
leftPanel.add(grid);
}
示例6: showRiskData
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
protected void showRiskData( JsonRiskDataList list ) {
VerticalPanel p = new VerticalPanel();
p.setWidth("100%");
Grid grid = new Grid( list.size(), 2 );
// grid.getColumnFormatter().setWidth(0, "20%");
// grid.getColumnFormatter().setWidth(1, "80%");
for( int i = 0; i < list.size(); i++ ) {
JsonRiskDataList.RiskDataItem item = list.get( i );
grid.setWidget( i, 0, new Label( item.getId() ) );
grid.setWidget( i, 1, new Label( item.getValue() ) );
}
Label title = new Label(entity);
title.setStyleName("smallTitle");
p.add(title);
p.add(grid);
panel.setWidget( p );
}
示例7: loadValues
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
public void loadValues( ArrayList<JAHPComparison> list ) {
if( container.getWidget() != null ) {
container.getWidget().removeFromParent();
}
Grid grid = new Grid( 0, 3 );
int i = 0;
for( JAHPComparison c : list ) {
if( c.getId1().equals( c.getId2() ) ) continue;
grid.resize( grid.getRowCount() +1, 3 );
ComparisonRow row = new ComparisonRow( c );
grid.setWidget( i, 0, row.getLeftWidget() );
grid.setWidget( i, 1, row.getSlider() );
grid.setWidget( i, 2, row.getRightWidget() );
i++;
}
this.preferences = list;
container.setWidget( grid );
}
示例8: reinitGridSize
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
private void reinitGridSize(int rows) {
totalRows = rows+1;
// scaleDisplayPos = totalRows;
gridList.clear();
gridPanel.clear();
int gridCnt= totalRows / 2 + totalRows%2;
for(int i=0; i<gridCnt; i++) {
Grid g= new Grid(2,2);
for (int r = 0; (r < 2); r++) {
g.getCellFormatter().setHorizontalAlignment(r, LABEL_IDX, HasHorizontalAlignment.ALIGN_RIGHT);
}
GwtUtil.setStyles(g, "lineHeight", "1",
"display", "inline-block" );
gridList.add(g);
gridPanel.add(g);
}
}
示例9: onInitUI
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
protected void onInitUI() {
final FlowPanel me = (FlowPanel) getWidget();
me.add(header = new Grid(1, Cols.values().length));
me.add(body);
headerText = new InlineLabel();
if (titleWidget == null) {
titleWidget = headerText;
}
FlowPanel title = new FlowPanel();
title.add(titleWidget);
title.setStyleName(Gerrit.RESOURCES.css().screenHeader());
header.setWidget(0, Cols.Title.ordinal(), title);
header.setStyleName(Gerrit.RESOURCES.css().screenHeader());
header
.getCellFormatter()
.setHorizontalAlignment(0, Cols.FarEast.ordinal(), HasHorizontalAlignment.ALIGN_RIGHT);
// force FarEast all the way to the right
header.getCellFormatter().setWidth(0, Cols.FarEast.ordinal(), "100%");
}
示例10: createView
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
public void createView() {
leftButton = new Button( getLeftButtonName() );
rightButton = new Button( getRightButtonName() );
Grid grid = new Grid( 2, 2 );
grid.setText( 0, 0, "Name :" );
grid.setWidget( 0, 1, createAndGetNameWidget() );
HorizontalPanel buttons = new HorizontalPanel();
buttons.add( leftButton );
buttons.add( rightButton );
grid.setWidget( 1, 1, buttons );
setWidget( grid );
}
示例11: createView
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
public void createView() {
selectButton = new Button( "Select Name");
leftButton = new Button( getLeftButtonName() );
rightButton = new Button( getRightButtonName() );
Grid grid = new Grid( 2, 2 );
grid.setText( 0, 0, "Name :" );
grid.setWidget( 0, 1, createAndGetNameWidget() );
HorizontalPanel buttons = new HorizontalPanel();
buttons.add( selectButton );
buttons.add( leftButton );
buttons.add( rightButton );
grid.setWidget( 1, 1, buttons );
initWidget( grid );
}
示例12: UserCreateView
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
public UserCreateView() {
id = new Label();
lastName = new TextBox();
firstName = new TextBox();
Grid grid = new Grid( 3, 2 );
grid.setText( 0, 0, "Last Name: " );
grid.setText( 1, 0, "First Name: " );
grid.setWidget( 0, 1, lastName );
grid.setWidget( 1, 1, firstName );
create = new Button( "Create" );
VerticalPanel mainPanel = new VerticalPanel();
mainPanel.add( grid );
mainPanel.add( create );
initWidget( mainPanel );
}
示例13: UserDisplayView
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
public UserDisplayView() {
id = new Label();
lastName = new Label();
firstName = new Label();
Grid grid = new Grid( 3, 2 );
grid.setText( 0, 0, "Last Name: " );
grid.setText( 1, 0, "First Name: " );
grid.setText( 2, 0, "Generated Id: " );
grid.setWidget( 0, 1, lastName );
grid.setWidget( 1, 1, firstName );
grid.setWidget( 2, 1, id );
create = new Button( "New" );
VerticalPanel mainPanel = new VerticalPanel();
mainPanel.add( grid );
mainPanel.add( create );
initWidget( mainPanel );
}
示例14: addMenu
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
public static void addMenu(ComponentGVO vo, UIObject ui, String uuid, String parent) {
if (vo != null && ui != null) {
if (vo.getMenu() != null) {
MenuBar menu = new MenuBar();
menu.setAutoOpen(true);
menu.setWidth("100%");
UIObject renderedComponent = new MenuItemRenderer().render(vo.getMenu(), uuid, parent, vo.getContext());
if (renderedComponent instanceof MenuBar) {
menu.addItem(vo.getMenu().getDisplayname(), (MenuBar) renderedComponent);
} else if (renderedComponent instanceof MenuItem) {
menu.addItem((MenuItem) renderedComponent);
}
if (ui instanceof DockPanel) {
((DockPanel) ui).add(menu, DockPanel.NORTH);
} else if (ui instanceof Grid || ui instanceof VerticalPanel || ui instanceof HorizontalPanel)
((Panel) ui).add(menu);
}
}
}
示例15: getValue
import com.google.gwt.user.client.ui.Grid; //导入依赖的package包/类
private static String getValue(FormPanel formPanel) {
String value = null;
if (formPanel instanceof HasWidgets) {
HasWidgets hasWidgets = formPanel;
Iterator<Widget> itr = hasWidgets.iterator();
while (itr.hasNext()) {
Widget widget = itr.next();
if (widget instanceof Grid) {
Grid gridPanel = (Grid) widget;
FileUpload fileUpload = (FileUpload) gridPanel.getWidget(0, 0);
value = DOM.getElementAttribute(fileUpload.getElement(), "fu-uuid");
handleSimpleValue(formPanel, value);
}
}
}
return value;
}