本文整理汇总了Java中com.google.gwt.user.client.ui.HTML.setWidth方法的典型用法代码示例。如果您正苦于以下问题:Java HTML.setWidth方法的具体用法?Java HTML.setWidth怎么用?Java HTML.setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HTML
的用法示例。
在下文中一共展示了HTML.setWidth方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleDayCell
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public SimpleDayCell(VCalendar calendar, int row, int cell) {
this.calendar = calendar;
this.row = row;
this.cell = cell;
setStylePrimaryName("v-calendar-month-day");
caption = new Label();
caption.setStyleName("v-calendar-day-number");
caption.addMouseDownHandler(this);
caption.addMouseUpHandler(this);
add(caption);
bottomspacer = new HTML();
bottomspacer.setStyleName("v-calendar-bottom-spacer-empty");
bottomspacer.setWidth(3 + "em");
add(bottomspacer);
}
示例2: OdeLog
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Creates a new output panel for displaying internal messages.
*/
private OdeLog() {
// Initialize UI
Button clearButton = new Button(MESSAGES.clearButton());
clearButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
clear();
}
});
text = new HTML();
text.setWidth("100%");
VerticalPanel panel = new VerticalPanel();
panel.add(clearButton);
panel.add(text);
panel.setSize("100%", "100%");
panel.setCellHeight(text, "100%");
panel.setCellWidth(text, "100%");
initWidget(panel);
}
示例3: turnOffRow
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
private void turnOffRow(int row) {
CellFormatter formatter = datatable.getCellFormatter();
int dataRow = row - headerRows;
String[] oldnew = dirtyrows.get(row);
HTML html = new HTML(oldnew[0]);
html.setTitle(oldnew[0]);
int width = headertable.getWidget(0, 1).getOffsetWidth();
html.setWidth(width+"px");
// Put the old value back in the data structure used to make the JSON payload.
List<String[]> affectedrow = allrows.get(ids.getValue());
String[] parts = affectedrow.get(dataRow);
for (int i = 0; i < parts.length; i++) {
if ( headers[i].contains("WOCE") ) {
parts[i] = oldnew[0];
}
}
formatter.removeStyleName(row, 1, "dirty");
datatable.setWidget(row, 1, html);
}
示例4: handleDoubleClick
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
protected void handleDoubleClick(TableData.Row row) {
VerticalPanel vp = new VerticalPanel();
final Image previewImage = new Image(getFullSizeUrl(row));
final HTML caption = new HTML(getPopUpCaption(row));
String title = getThumbnailDesc(row).replace("<em>", "").replace("</em>", "");
caption.setWidth("320px");
previewImage.addLoadHandler(new LoadHandler() {
public void onLoad(LoadEvent ev) {
caption.setWidth(previewImage.getWidth() + "px");
}
});
GwtUtil.setStyle(vp, "margin", "8px");
vp.setCellHorizontalAlignment(previewImage, HasHorizontalAlignment.ALIGN_CENTER);
vp.setCellVerticalAlignment(previewImage, HasVerticalAlignment.ALIGN_MIDDLE);
vp.add(previewImage);
vp.add(caption);
PopupPane popupPane = new PopupPane(title, vp, PopupType.STANDARD, false, false);
popupPane.show();
}
示例5: MyCell
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public MyCell(CurriculumInterface curriculum, CurriculumClassificationInterface classification) {
iCurriculum = curriculum;
iClasf = classification;
iPanel = new HorizontalPanel();
iTextBox = new UniTimeTextBox(6, ValueBoxBase.TextAlignment.RIGHT);
iTextBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
try {
if (iTextBox.getText().isEmpty()) {
iClasf.setExpected(null);
} else {
iClasf.setExpected(Integer.valueOf(iTextBox.getText()));
}
} catch (Exception e) {
iClasf.setExpected(null);
}
update();
for (MySumCell sum: iSums)
sum.update();
}
});
iRearLabel = new HTML("", false);
iRearLabel.setWidth("50px");
iRearLabel.setStyleName("unitime-Label");
iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
iPanel.add(iTextBox);
iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);
iPanel.add(iRearLabel);
iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);
initWidget(iPanel);
update();
}
示例6: MySumCell
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public MySumCell(List<MyCell> cells) {
iCells = cells;
for (MyCell cell: iCells)
cell.iSums.add(this);
iPanel = new HorizontalPanel();
iTextBox = new HTML("", false);
iTextBox.setWidth("60px");
iTextBox.setStyleName("unitime-Label");
iTextBox.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
iRearLabel = new HTML("", false);
iRearLabel.setWidth("55px");
iRearLabel.setStyleName("unitime-Label");
iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
iPanel.add(iTextBox);
iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);
iPanel.add(iRearLabel);
iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);
initWidget(iPanel);
update();
}
示例7: updateHeaderTable
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
protected void updateHeaderTable(List<ColumnDefinition<TableData.Row, ?>> colDefs, boolean force) {
if (!colDefs.equals(lastColDefs) || force) {
lastColDefs = colDefs;
int numColumns = colDefs.size();
// clear the headers
clearTable(headers, numColumns);
// Add the column and group headers
for (int i = 0; i < numColumns; i++) {
// Add the name
ColDef colDef = (ColDef) colDefs.get(i);
if (colDef == null) continue; // skip if colDef is null
String title = colDef.isImmutable() ? "" : "<b>" + colDef.getTitle() + "</b>";
HTML label = new HTML(title, false);
label.setTitle(colDef.getShortDesc());
label.setWidth("10px");
DOM.setStyleAttribute(label.getElement(), "display", "inline");
headers.setWidget(LABEL_IDX, i, label);
setColumnWidth(i, colDef.getPreferredColumnWidth());
headers.getFlexCellFormatter().setHorizontalAlignment(LABEL_IDX, i, HorizontalPanel.ALIGN_CENTER);
if (isShowUnits()) {
String u = colDef.getColumn() == null || StringUtils.isEmpty(colDef.getColumn().getUnits()) ? " " : "(" + colDef.getColumn().getUnits() + ")";
label.setHTML(label.getHTML() + "<br>" + u);
}
GwtUtil.setStyle(label, "display", "inline-table");
}
filterSupport.onUpdateHeaders(colDefs);
}
filterSupport.ensureFilterShow();
}
示例8: XYPlotBasicWidget
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public XYPlotBasicWidget(XYPlotMeta meta) {
super(300,180);
// super(300, 180);
_meta = meta;
GChart.setCanvasFactory(ChartingFactory.getInstance());
_popoutWidgetSet = false;
_actionHelp = new HTML();
_actionHelp.setWidth("100%");
_actionHelp.addStyleName(_ffCss.fadedText());
/**
final CheckBox outOfBoundCheck = GwtUtil.makeCheckBox("Connect Out of Bounds Points",
"Take into account out of bounds points that are reasonably close", false);
outOfBoundCheck.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent valueChangeEvent) {
if (_chart != null && _data != null) {
preserveOutOfBoundPoints = outOfBoundCheck.getValue();
if (preserveOutOfBoundPoints) {
_chart.getYAxis().setOutOfBoundsMultiplier(Double.NaN);
_chart.getY2Axis().setAxisMin(_chart.getY2Axis().getAxisMin());
_chart.update();
} else {
_chart.getYAxis().setOutOfBoundsMultiplier(0);
_chart.getY2Axis().setAxisMin(_chart.getY2Axis().getAxisMin());
_chart.update();
}
}
}
});
*/
}
示例9: BarcodeDialogBox
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
BarcodeDialogBox(String projectName, String appInstallUrl) {
super(false, true);
setStylePrimaryName("ode-DialogBox");
setText(MESSAGES.barcodeTitle(projectName));
ClickHandler buttonHandler = new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
};
Button cancelButton = new Button(MESSAGES.cancelButton());
cancelButton.addClickHandler(buttonHandler);
Button okButton = new Button(MESSAGES.okButton());
okButton.addClickHandler(buttonHandler);
HTML barcodeQrcode = new HTML("<center>" + BlocklyPanel.getQRCode(appInstallUrl) + "</center>");
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
HTML warningLabel = new HTML(MESSAGES.barcodeWarning(
"<a href=\"" + "http://appinventor.mit.edu/explore/ai2/share.html" +
"\" target=\"_blank\">",
"</a>"));
warningLabel.setWordWrap(true);
warningLabel.setWidth("200px"); // set width to get the text to wrap
HorizontalPanel warningPanel = new HorizontalPanel();
warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
warningPanel.add(warningLabel);
// The cancel button is removed from the panel since it has no meaning in this
// context. But the logic is still here in case we want to restore it, and as
// an example of how to code this stuff in GWT.
// buttonPanel.add(cancelButton);
buttonPanel.add(okButton);
buttonPanel.setSize("100%", "24px");
VerticalPanel contentPanel = new VerticalPanel();
contentPanel.add(barcodeQrcode);
contentPanel.add(buttonPanel);
contentPanel.add(warningPanel);
// contentPanel.setSize("320px", "100%");
add(contentPanel);
}
示例10: ProgressBarDialogBox
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public ProgressBarDialogBox(String serviceName, ProjectNode projectNode) {
super(false, true);
this.serviceName = serviceName;
setStylePrimaryName("ode-DialogBox");
setText(projectNode.getName() + " " + MESSAGES.ProgressBarFor());
//click handler for the mini html buttons
ClickHandler buttonHandler = new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
progressBarShow++;
}
};
//declare the ok button
dismissButton.addClickHandler(buttonHandler);
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
dismissButton.setVisible(false); // we don't need the button unless we get an error
//warning label
warningLabel = new HTML("");
warningLabel.setWordWrap(true);
warningLabel.setWidth("60em"); // set width to get the text to wrap
//warning panel
HorizontalPanel warningPanel = new HorizontalPanel();
warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
warningPanel.add(warningLabel);
// button panel
buttonPanel.add(dismissButton);
buttonPanel.setSize("100%", "24px");
//content panel
VerticalPanel contentPanel = new VerticalPanel();
contentPanel.add(mpb);
contentPanel.add(warningPanel);
contentPanel.add(buttonPanel);
setWidget(contentPanel);
}
示例11: space
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Creates an square spacer
*
* @param width The desired width space
* @param height The desired height space
* @return an HTML element meaning the with and height
*/
public static HTML space(String width, String height) {
HTML spacer = new HTML("");
spacer.setWidth(width);
spacer.setHeight(height);
return spacer;
}
示例12: hSpace
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Creates an horizontal spacer
*
* @param width The desired width space
* @return an HTML element meaning the with
*/
public static HTML hSpace(String width) {
HTML spacer = new HTML("");
spacer.setWidth(width);
return spacer;
}