本文整理匯總了Java中com.google.gwt.user.client.ui.Button.setHTML方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.setHTML方法的具體用法?Java Button.setHTML怎麽用?Java Button.setHTML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.Button
的用法示例。
在下文中一共展示了Button.setHTML方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: render
import com.google.gwt.user.client.ui.Button; //導入方法依賴的package包/類
@Override
public void render(RendererCellReference cell, String text, Button button) {
Element e = button.getElement();
if(e.getPropertyString(ROW_KEY_PROPERTY) != getRowKey((JsonObject) cell.getRow())) {
e.setPropertyString(ROW_KEY_PROPERTY,
getRowKey((JsonObject) cell.getRow()));
}
if(e.getPropertyString(COLUMN_ID_PROPERTY) != getColumnId(getGrid()
.getColumn(cell.getColumnIndex()))) {
e.setPropertyString(COLUMN_ID_PROPERTY, getColumnId(getGrid()
.getColumn(cell.getColumnIndex())));
}
if (htmlContentAllowed) {
button.setHTML(text);
} else {
button.setText(text);
}
button.setEnabled(true);
}
示例2: render
import com.google.gwt.user.client.ui.Button; //導入方法依賴的package包/類
@Override
public void render(RendererCellReference cell, Boolean enable, Button button) {
Element e = button.getElement();
if(e.getPropertyString(ROW_KEY_PROPERTY) != getRowKey((JsonObject) cell.getRow())) {
e.setPropertyString(ROW_KEY_PROPERTY,
getRowKey((JsonObject) cell.getRow()));
}
if(e.getPropertyString(COLUMN_ID_PROPERTY) != getColumnId(getGrid()
.getColumn(cell.getColumnIndex()))) {
e.setPropertyString(COLUMN_ID_PROPERTY, getColumnId(getGrid()
.getColumn(cell.getColumnIndex())));
}
String style = button.getStyleName();
if (style != null && style.contains("delete-confirm")) {
button.removeStyleName("delete-confirm");
}
if (htmlContentAllowed) {
button.setHTML(getState().delete);
} else {
button.setText(getState().delete);
}
button.setEnabled(enable);
}
示例3: genButton
import com.google.gwt.user.client.ui.Button; //導入方法依賴的package包/類
private Button genButton(final int bitm) {
Button btn = GWT.create(Button.class);
btn.setStylePrimaryName("v-nativebutton");
switch (bitm) {
case VIEW_BITM:
btn.addStyleName("v-view");
break;
case EDIT_BITM:
btn.addStyleName("v-edit");
break;
case DELETE_BITM:
btn.addStyleName("v-delete");
break;
}
btn.setHTML("<span></span>");
btn.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
VButtonValueRenderer.this.clickedBITM = bitm;
VButtonValueRenderer.super.onClick(event);
}
});
return btn;
}
示例4: render
import com.google.gwt.user.client.ui.Button; //導入方法依賴的package包/類
@Override
public void render(final RendererCellReference cell, final String text, final Button button) {
final boolean buttonEnable = isButtonEnable(cell.getElement().getClassName());
if (text != null) {
button.setHTML(text);
}
applystyles(button, buttonEnable);
// this is to allow the button to disappear, if the text is null
button.setVisible(text != null);
button.getElement().setId(UIComponentIdProvider.ROLLOUT_ACTION_ID + "." + cell.getColumnIndex());
button.setEnabled(buttonEnable);
}
示例5: render
import com.google.gwt.user.client.ui.Button; //導入方法依賴的package包/類
@Override
public void render(final RendererCellReference cell, final FontIconData iconMetadata, final Button button) {
if (iconMetadata.getFontIconHtml() != null) {
button.setHTML(iconMetadata.getFontIconHtml());
}
applyStyles(button, iconMetadata.isDisabled(), iconMetadata.getStyle());
button.getElement().setId(iconMetadata.getId());
button.getElement().setTitle(iconMetadata.getTitle());
button.setEnabled(!iconMetadata.isDisabled());
// this is to allow the button to disappear, if the text is null
button.setVisible(iconMetadata.getFontIconHtml() != null);
}