本文整理汇总了Java中com.google.gwt.user.client.ui.FlexTable.setText方法的典型用法代码示例。如果您正苦于以下问题:Java FlexTable.setText方法的具体用法?Java FlexTable.setText怎么用?Java FlexTable.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.FlexTable
的用法示例。
在下文中一共展示了FlexTable.setText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOperatorFrequencyTable
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
/**
* Adds the operator frequency table.
*
* @param expressions
* the expressions
*/
private void addOperatorFrequencyTable(List<Expression> expressions)
{
Map<String, Integer> operatorFrequencies = getOperatorFrequencies(expressions);
FlexTable t = new FlexTable();
t.setStylePrimaryName("operatorFrequencyTable");
int row = 0;
t.setText(row, 0, "Operator");
t.setText(row, 1, "Frequency");
row++;
for (String key : operatorFrequencies.keySet())
{
t.setText(row, 0, key);
t.setText(row, 1, "" + operatorFrequencies.get(key));
row++;
}
add(t);
}
示例2: MediaFileListPopup
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
public MediaFileListPopup(String formId) {
SecureGWT.getFormAdminService().getFormMediaFileList(formId,
new MediaFileCallback());
fileList = new FlexTable();
fileList.setWidget(0, 0, new ClosePopupButton(this));
fileList.getCellFormatter().getElement(0, 0).setAttribute("align",
"right");
fileList.setText(1, 0, "Media Filename");
fileList.setText(1, 1, "Content Type");
fileList.setText(1, 2, "Length");
fileList.getRowFormatter().addStyleName(1, "titleBar");
setWidget(fileList);
}
示例3: addScores
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
/**
* Adds the scores.
*
* @param expressions
* the expressions
*/
private void addScores(List<Expression> expressions)
{
int correct = getCorrectCount(expressions);
int incorrect = getIncorrectCount(expressions);
FlexTable t = new FlexTable();
t.setText(0, 0, "Correct:");
t.setText(0, 1, "" + correct);
t.setText(1, 0, "Incorrect:");
t.setText(1, 1, "" + incorrect);
add(t);
}
示例4: asWidget
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
@Override
public Widget asWidget() {
VerticalPanel layout = new VerticalPanel();
layout.setStyleName("fill-layout-width"); //$NON-NLS-1$
layout.add(new HTML("<div class='metric-table-title'>" + _title + "</div>")); //$NON-NLS-1$ //$NON-NLS-2$
_grid = new FlexTable();
_grid.getElement().setAttribute("width", _width + _unit.getType() + ""); //$NON-NLS-1$ //$NON-NLS-2$
// header columns
_grid.setHTML(0, 0, Singleton.MESSAGES.label_metric());
_grid.setHTML(0, 1, Singleton.MESSAGES.label_actual());
_grid.setHTML(0, 2, " "); //$NON-NLS-1$
_grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
// actual values
int row = _rowOffset;
for (Column c : _columns) {
_grid.setHTML(row, 0, "<div class='metric-table-label'>" + c.getLabel() + ":</div>"); //$NON-NLS-1$ //$NON-NLS-2$
_grid.setHTML(row, 1, ""); //$NON-NLS-1$
_stacks.add(new StackedBar());
if (c.getComparisonColumn() != null) {
StackedBar stack = _stacks.get(row - _rowOffset);
_grid.setWidget(row, 2, stack.asWidget());
stack.setRatio(0, 0);
} else {
_grid.setText(row, 2, ""); //$NON-NLS-1$
}
_grid.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_RIGHT);
if (!c.isVisible()) {
_grid.getRowFormatter().setVisible(row, false);
}
if (c.isBaseline()) {
_grid.getRowFormatter().addStyleName(row, "metric-table-baseline"); //$NON-NLS-1$
}
_columnIndexes.put(c, row - _rowOffset);
row++;
}
_grid.getCellFormatter().setStyleName(0, 0, "metric-table-header"); //$NON-NLS-1$
_grid.getCellFormatter().setStyleName(0, 1, "metric-table-header"); //$NON-NLS-1$
_grid.getCellFormatter().setStyleName(0, 2, "metric-table-header"); //$NON-NLS-1$
_grid.getCellFormatter().setWidth(0, 2, "50%"); //$NON-NLS-1$
if (null == _staticHelp && _address != null) {
MetricHelpPanel helpPanel = new MetricHelpPanel(_address, this._columns);
// helpPanel.setAligned(true);
layout.add(helpPanel.asWidget());
} else if (_staticHelp != null) {
layout.add(_staticHelp.asWidget());
}
layout.add(_grid);
return layout;
}
示例5: asWidget
import com.google.gwt.user.client.ui.FlexTable; //导入方法依赖的package包/类
@Override
public Widget asWidget() {
VerticalPanel layout = new VerticalPanel();
layout.setStyleName("fill-layout-width");
layout.add(new HTML("<div class='metric-table-title'>"+title+"</div>"));
grid = new FlexTable();
grid.getElement().setAttribute("width", width+unit.getType()+"");
// header columns
grid.setHTML(0, 0, "Metric");
grid.setHTML(0, 1, "Actual");
grid.setHTML(0, 2, " ");
grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);
// actual values
int row = ROW_OFFSET;
for(Column c : columns)
{
grid.setHTML(row, 0, "<div class='metric-table-label'>"+c.getLabel() + ":</div>");
grid.setHTML(row, 1, "");
stacks.add(new StackedBar());
if(c.getComparisonColumn()!=null)
{
StackedBar stack = stacks.get(row - ROW_OFFSET);
grid.setWidget(row, 2, stack.asWidget());
stack.setRatio(0,0);
}
else
grid.setText(row, 2, "");
grid.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_RIGHT);
if(!c.isVisible())
grid.getRowFormatter().setVisible(row, false);
if(c.isBaseline())
grid.getRowFormatter().addStyleName(row, "metric-table-baseline");
columnIndexes.put(c, row - ROW_OFFSET);
row++;
}
grid.getCellFormatter().setStyleName(0,0,"metric-table-header");
grid.getCellFormatter().setStyleName(0,1,"metric-table-header");
grid.getCellFormatter().setStyleName(0,2,"metric-table-header");
grid.getCellFormatter().setWidth(0, 2, "50%");
if(null==staticHelp && address!=null)
{
MetricHelpPanel helpPanel = new MetricHelpPanel(address, this.columns);
//helpPanel.setAligned(true);
layout.add(helpPanel.asWidget());
}
else if(staticHelp!=null)
{
layout.add(staticHelp.asWidget());
}
layout.add(grid);
return layout;
}