本文整理汇总了Java中com.google.gwt.user.client.ui.FlexTable.setCellPadding方法的典型用法代码示例。如果您正苦于以下问题:Java FlexTable.setCellPadding方法的具体用法?Java FlexTable.setCellPadding怎么用?Java FlexTable.setCellPadding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.FlexTable
的用法示例。
在下文中一共展示了FlexTable.setCellPadding方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HatredPanel
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
public HatredPanel() {
SimpleCaptionPanel SimpleCaptionPanel = new SimpleCaptionPanel("Hatred/Discipline");
initWidget(SimpleCaptionPanel);
FlexTable flexTable = new FlexTable();
flexTable.setCellPadding(2);
SimpleCaptionPanel.setContentWidget(flexTable);
Label lblHatredPerSecond = new Label("+ Hatred per Second:");
flexTable.setWidget(0, 0, lblHatredPerSecond);
hatredPerSecond = new DoubleSpinner();
hatredPerSecond.setVisibleLength(5);
flexTable.setWidget(0, 1, hatredPerSecond);
Label label = new Label("+ Maximum Discipline:");
flexTable.setWidget(1, 0, label);
equipmentDiscipline = new NumberSpinner();
equipmentDiscipline.setVisibleLength(5);
flexTable.setWidget(1, 1, equipmentDiscipline);
Label lblNewLabel_1 = new Label("Only include increased Hatred per Second and Max Discipline from items. Do not include gains from skills (e.g. Archery) or buffs (e.g. Inspire).");
lblNewLabel_1.setWordWrap(true);
lblNewLabel_1.addStyleName("boldText");
flexTable.setWidget(2, 0, lblNewLabel_1);
flexTable.getFlexCellFormatter().setColSpan(2, 0, 2);
lblNewLabel_1.setWidth("400px");
}
示例2: initModule
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
@Override
public void initModule(Element element) {
FlexTable table = new FlexTable();
table.setStyleName(styleNames.QP_TABLE_TABLE());
Map<String, String> styles = styleSocket.getStyles(element);
if (styles.containsKey(EMPIRIA_TABLE_CELLPADDING)) {
int padding = NumberUtils.tryParseInt(styles.get(EMPIRIA_TABLE_CELLPADDING), -1);
if (padding != -1) {
table.setCellPadding(padding);
}
}
if (styles.containsKey(EMPIRIA_TABLE_CELLSPACING)) {
int spacing = NumberUtils.tryParseInt(styles.get(EMPIRIA_TABLE_CELLSPACING), -1);
if (spacing != -1) {
table.setCellSpacing(spacing);
}
}
NodeList trNodes = element.getElementsByTagName("tr");
for (int r = 0; r < trNodes.getLength(); r++) {
NodeList tdNodes = ((Element) trNodes.item(r)).getElementsByTagName("td");
for (int d = 0; d < tdNodes.getLength(); d++) {
Panel dPanel = new FlowPanel();
dPanel.setStyleName(styleNames.QP_TABLE_CELL());
getBodyGenerator().generateBody(tdNodes.item(d), dPanel);
table.setWidget(r, d, dPanel);
int colspan = 1;
if (tdNodes.item(d).getNodeType() == Node.ELEMENT_NODE && ((Element) tdNodes.item(d)).hasAttribute("colspan")) {
colspan = NumberUtils.tryParseInt(((Element) tdNodes.item(d)).getAttribute("colspan"), 1);
}
if (colspan > 1) {
table.getFlexCellFormatter().setColSpan(r, d, colspan);
}
int rowspan = 1;
if (tdNodes.item(d).getNodeType() == Node.ELEMENT_NODE && ((Element) tdNodes.item(d)).hasAttribute("rowspan")) {
rowspan = NumberUtils.tryParseInt(((Element) tdNodes.item(d)).getAttribute("rowspan"), 1);
}
if (rowspan > 1) {
table.getFlexCellFormatter().setRowSpan(r, d, rowspan);
}
}
}
tablePanel.add(table);
}
示例3: GridPanelComponent
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
public GridPanelComponent() {
FlexTable grid = new FlexTable();
grid.setCellPadding(0);
grid.setCellSpacing(0);
setPanelWidget(grid);
}
示例4: buildPanel
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
@Override
public void buildPanel() {
csVPanel = new ViewerPanel();
createPrimitives(csVPanel.getViewer().scene());
applyColorMaterial(rectangle);
commonMaterialLBox = new ListBox();
commonMaterialLBox.addChangeHandler(new MChangeHandler());
commonMaterialLBox.addItem("Select", "0");
commonMaterialLBox.addItem("Color", "1");
commonMaterialLBox.addItem("Image", "2");
proceduralTexturesLBox = new ListBox();
proceduralTexturesLBox.addChangeHandler(new MChangeHandler());
proceduralTexturesLBox.addItem("Select", "0");
proceduralTexturesLBox.addItem("Checkerboard", "1");
proceduralTexturesLBox.addItem("Dot", "2");
proceduralTexturesLBox.addItem("Grid", "3");
proceduralTexturesLBox.addItem("Stripe", "4");
baseMaterialsLBox = new ListBox();
baseMaterialsLBox.addChangeHandler(new MChangeHandler());
baseMaterialsLBox.addItem("Select", "0");
baseMaterialsLBox.addItem("Alpha Map", "1");
baseMaterialsLBox.addItem("Bump Map", "2");
baseMaterialsLBox.addItem("Diffuse", "3");
baseMaterialsLBox.addItem("Emission Map", "4");
baseMaterialsLBox.addItem("Normal Map", "5");
baseMaterialsLBox.addItem("Specular Map", "6");
miscMaterialsLBox = new ListBox();
miscMaterialsLBox.addChangeHandler(new MChangeHandler());
miscMaterialsLBox.addItem("Select", "0");
miscMaterialsLBox.addItem("Rim Lighting", "1");
miscMaterialsLBox.addItem("Water", "2");
exampleCompositeMaterialsLBox = new ListBox();
exampleCompositeMaterialsLBox.addChangeHandler(new MChangeHandler());
exampleCompositeMaterialsLBox.addItem("Select", "0");
exampleCompositeMaterialsLBox.addItem("Composite Example", "1");
polylineMaterialsLBox = new ListBox();
polylineMaterialsLBox.addChangeHandler(new MChangeHandler());
polylineMaterialsLBox.addItem("Select", "0");
polylineMaterialsLBox.addItem("Polyline Arrow", "1");
polylineMaterialsLBox.addItem("Polyline Glow", "2");
polylineMaterialsLBox.addItem("Polyline Outline", "3");
FlexTable flexTable = new FlexTable();
flexTable.setCellSpacing(1);
flexTable.setCellPadding(1);
flexTable.setHTML(1, 0, "<font color=\"white\">Common materials</font>");
flexTable.setWidget(1, 1, commonMaterialLBox);
flexTable.setHTML(2, 0, "<font color=\"white\">Procedural textures</font>");
flexTable.setWidget(2, 1, proceduralTexturesLBox);
flexTable.setHTML(3, 0, "<font color=\"white\">Base materials</font>");
flexTable.setWidget(3, 1, baseMaterialsLBox);
flexTable.setHTML(4, 0, "<font color=\"white\">Misc materials</font>");
flexTable.setWidget(4, 1, miscMaterialsLBox);
flexTable.setHTML(5, 0, "<font color=\"white\">Example composite materials</font>");
flexTable.setWidget(5, 1, exampleCompositeMaterialsLBox);
flexTable.setHTML(6, 0, "<font color=\"white\">Polyline materials</font>");
flexTable.setWidget(6, 1, polylineMaterialsLBox);
//
AbsolutePanel aPanel = new AbsolutePanel();
aPanel.add(csVPanel);
aPanel.add(flexTable, 20, 20);
contentPanel.add(new HTML("<p>Browse Cesium's built in materials and define new ones using the Fabric schema.</p>"));
contentPanel.add(aPanel);
initWidget(contentPanel);
}
示例5: displayDetailsDialog
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
/**
* Displays a Details dialog box.<br>
* Renders a table with 2 columns: name and value pairs.
* @param caption title of the dialog
* @param values values to be displayed; each element is an array (name-value pair) which defines a row
*/
public static void displayDetailsDialog( final String caption, final Object[][] values ) {
final DialogBox dialogBox = new DialogBox( true );
dialogBox.setText( caption );
dialogBox.setGlassEnabled( true );
final VerticalPanel content = new VerticalPanel();
content.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
final FlexTable table = new FlexTable();
table.setBorderWidth( 1 );
table.setCellSpacing( 0 );
table.setCellPadding( 3 );
final CellFormatter cellFormatter = table.getCellFormatter();
for ( int i = 0; i < values.length; i++ ) {
// Name
table.setWidget( i, 0, new Label( values[ i ][ 0 ].toString() ) );
cellFormatter.addStyleName( i, 0, "headerRow" );
final Object value = values[ i ] [ 1 ];
if ( value == null )
table.setWidget( i, 1, new Label() );
else if ( value instanceof Widget )
table.setWidget( i, 1, (Widget) value );
else if ( value instanceof Date )
table.setWidget( i, 1, createTimestampWidget( (Date) value ) );
else {
String stringValue;
if ( value instanceof String )
stringValue = (String) value;
else if ( value instanceof Number )
stringValue = NUMBER_FORMAT .format( (Number) value );
else
stringValue = value.toString();
table.setWidget( i, 1, new Label( stringValue ) );
}
cellFormatter.addStyleName( i, 1, "row" + ( i & 0x01 ) );
cellFormatter.setHorizontalAlignment( i, 1, HasHorizontalAlignment.ALIGN_LEFT );
}
content.add( table );
content.add( createVerticalEmptyWidget( 8 ) );
content.add( ClientUtils.createDialogCloseButton( dialogBox, "Close" ) );
content.add( createVerticalEmptyWidget( 8 ) );
dialogBox.setWidget( content );
dialogBox.center();
}