本文整理匯總了Java中com.google.gwt.dom.client.DivElement.setInnerText方法的典型用法代碼示例。如果您正苦於以下問題:Java DivElement.setInnerText方法的具體用法?Java DivElement.setInnerText怎麽用?Java DivElement.setInnerText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.dom.client.DivElement
的用法示例。
在下文中一共展示了DivElement.setInnerText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: wrapHotKey
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private static Element wrapHotKey(String hotKey, String description, boolean global) {
final DivElement containerDiv = Document.get().createDivElement();
final DivElement hotKeyDiv = Document.get().createDivElement();
final DivElement descriptionDiv = Document.get().createDivElement();
hotKeyDiv.setInnerText(hotKey);
descriptionDiv.setInnerText(description);
containerDiv.setClassName("divRow");
hotKeyDiv.setClassName("divCell");
hotKeyDiv.addClassName("hotKey");
descriptionDiv.setClassName("divCell");
descriptionDiv.addClassName("description");
containerDiv.appendChild(hotKeyDiv);
containerDiv.appendChild(descriptionDiv);
return containerDiv;
}
示例2: createInfoTextElement
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private Element createInfoTextElement(NodePresentation presentation) {
DivElement textElement = Document.get().createDivElement();
StringBuilder sb = new StringBuilder();
if (presentation.getInfoTextWrapper() != null) {
sb.append(presentation.getInfoTextWrapper().first);
}
if (!Strings.isNullOrEmpty(presentation.getInfoText())) {
sb.append(presentation.getInfoText());
}
if (presentation.getInfoTextWrapper() != null) {
sb.append(presentation.getInfoTextWrapper().second);
}
textElement.setInnerText(sb.toString());
textElement.setAttribute("style", presentation.getInfoTextCss());
// TODO support text colorization
return textElement;
}
示例3: redrawMonthPicker
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void redrawMonthPicker() {
this.monthPicker.getStyle().setWidth(this.calendarTable.getClientWidth(), Unit.PX);
this.calendarTable.getStyle().setDisplay(Display.NONE);
this.monthPicker.getStyle().clearDisplay();
int currentYear = this.cursor.getYear() + InputDatePicker.YEAR_OFFSET;
if (this.monthPickerInner.getChildCount() == 0) {
for (int year = currentYear - 100; year < currentYear + 100; year++) {
DivElement yearDiv = Document.get().createDivElement();
yearDiv.setInnerText(String.valueOf(year));
StyleUtils.addStyle(yearDiv, InputDatePicker.STYLE_YEAR_BUTTON);
Event.sinkEvents(yearDiv, Event.ONCLICK);
this.monthPickerInner.appendChild(yearDiv);
yearDiv.setAttribute(InputDatePicker.ATTRIBUTE_DATA_YEAR, String.valueOf(year));
}
}
this.openMonthOfYear(this.cursor.getYear() + InputDatePicker.YEAR_OFFSET);
}
示例4: initHeader
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void initHeader()
{
headerRow = Document.get().createDivElement();
headerRow.addClassName(AppStyles.HEADER_ROW);
for (FieldDescriptor<T> fd : itemDescriptor.fields)
{
DivElement headerCell = Document.get().createDivElement();
headerCell.addClassName(fd.getStyle());
headerCell.setInnerText(fd.getHeaderText());
headerRow.appendChild(headerCell);
}
}
示例5: refresh
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void refresh()
{
// Clear any previous items
selectedItems.clear();
lastSelectedIndex = 0;
data.clear();
data.getElement().appendChild(headerRow);
itemDivs = new DivElement[this.showingItems.size()];
for (int i = 0; i < this.showingItems.size(); i++)
{
T item = this.showingItems.get(i);
DivElement itemDiv = Document.get().createDivElement();
itemDiv.addClassName(itemDescriptor.getItemStyle());
String[] values = itemDescriptor.getValues(item);
for (int j = 0; j < values.length; j++)
{
FieldDescriptor<T> f = itemDescriptor.getFields().get(j);
DivElement fieldDiv = Document.get().createDivElement();
fieldDiv.setId(f.getId() + ":" + i);
fieldDiv.addClassName(f.getStyle());
fieldDiv.setInnerText(values[j]);
itemDiv.appendChild(fieldDiv);
}
itemDivs[i] = itemDiv;
}
expando(data, itemDivs);
}
示例6: renderElement
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
@Override
public void renderElement(Element element, HotKeyItem hotKeyItem) {
element.setInnerText(hotKeyItem.getActionDescription());
element.addClassName(hotKeyResources.css().description());
if (hotKeyItem.isGlobal()) {
element.addClassName(hotKeyResources.css().isGlobal());
}
DivElement hotKeyElem = Document.get().createDivElement();
hotKeyElem.setInnerText(hotKeyItem.getHotKey());
hotKeyElem.addClassName(hotKeyResources.css().hotKey());
hotKeyElem.addClassName(hotKeyResources.css().floatRight());
element.appendChild(hotKeyElem);
}
示例7: createStyledTextElement
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private Element createStyledTextElement(String content, StyleConfigurator styleConfigurator) {
DivElement textElement = Document.get().createDivElement();
textElement.setInnerText(nullToEmpty(content));
if (styleConfigurator != null) {
styleConfigurator
.getCssConfiguration()
.forEach((p, v) -> textElement.getStyle().setProperty(p, v));
}
return textElement;
}
示例8: createNameOfElement
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private Element createNameOfElement(String fullPath) {
DivElement textElement = Document.get().createDivElement();
int lastSeparator = fullPath.lastIndexOf('/');
if (lastSeparator < 0 || !fullPath.endsWith(".jar")) {
textElement.setInnerText(fullPath);
return textElement;
}
String name = fullPath.substring(lastSeparator + 1);
String path = fullPath.substring(0, lastSeparator);
textElement.setInnerText(name + " - " + path);
return textElement;
}
示例9: appendText
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void appendText( final String text, final String color )
{
final DivElement div = Document.get().createDivElement();
div.setInnerText( text );
div.setAttribute( "style", "color:" + color );
_messages.getElement().appendChild( div );
_scrollPanel.scrollToBottom();
}
示例10: createSpacerBlock
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private DivElement createSpacerBlock(String className) {
DivElement block = DivElement.as(DOM.createDiv());
block.setClassName(STYLE_ROW + " " + STYLE_YEAR);
block.addClassName(STYLE_SPACER);
block.setInnerText(" ");
block.getStyle().setDisplay(Display.NONE); // not visible by default
spacerBlocks.add(block);
return block;
}
示例11: createTimelineBlock
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private DivElement createTimelineBlock(String key, String text, String styleSuffix, BlockRowData rowData) {
DivElement div = DivElement.as(DOM.createDiv());
div.setClassName(STYLE_ROW + " " + styleSuffix);
div.setInnerText(text);
rowData.setBlockLength(key, 1);
rowData.setBlock(key, div);
return div;
}
示例12: fillDayResolutionBlock
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void fillDayResolutionBlock(DivElement resBlock, Date date, int index, boolean weekend, int left) {
resBlock.setInnerText(getLocaleDataProvider().formatDate(date, getDayDateTimeFormat()));
if (weekend) {
resBlock.addClassName(STYLE_WEEKEND);
} else {
resBlock.removeClassName(STYLE_WEEKEND);
}
if (styleElementForLeft == null && isTimelineOverflowingHorizontally()) {
resBlock.getStyle().setPosition(Position.RELATIVE);
resBlock.getStyle().setLeft(left, Unit.PX);
}
}
示例13: fillWeekResolutionBlock
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void fillWeekResolutionBlock(DivElement resBlock, Date date, int index, Weekday weekDay, boolean firstWeek,
boolean lastBlock, int left, boolean even) {
if (resBlock != null) {
resBlock.setInnerText(formatWeekCaption(date));
if (even) {
resBlock.addClassName(STYLE_EVEN);
} else {
resBlock.removeClassName(STYLE_EVEN);
}
if (styleElementForLeft == null && isTimelineOverflowingHorizontally()) {
resBlock.getStyle().setPosition(Position.RELATIVE);
resBlock.getStyle().setLeft(left, Unit.PX);
}
resBlock.removeClassName(STYLE_FIRST);
resBlock.removeClassName(STYLE_LAST);
}
if (firstWeek && (weekDay == Weekday.Last || lastBlock)) {
Element firstEl = resolutionDiv.getFirstChildElement();
if (!firstEl.hasClassName(STYLE_FIRST)) {
firstEl.addClassName(STYLE_FIRST);
}
} else if (lastBlock) {
Element lastEl = Element.as(resolutionDiv.getLastChild());
if (!lastEl.hasClassName(STYLE_LAST)) {
lastEl.addClassName(STYLE_LAST);
}
}
}
示例14: fillHourResolutionBlock
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void fillHourResolutionBlock(DivElement resBlock, Date date, int index, int hourCounter, boolean lastBlock,
int left, boolean even) {
if (getLocaleDataProvider().isTwelveHourClock()) {
resBlock.setInnerText(getLocaleDataProvider().formatDate(date, getHour12DateTimeFormat()));
} else {
resBlock.setInnerText(getLocaleDataProvider().formatDate(date, getHour24DateTimeFormat()));
}
if (even) {
resBlock.addClassName(STYLE_EVEN);
} else {
resBlock.removeClassName(STYLE_EVEN);
}
if (firstDay && (hourCounter == 24 || lastBlock)) {
firstDay = false;
firstResBlockCount = index + 1;
} else if (lastBlock) {
lastResBlockCount = (index + 1 - firstResBlockCount) % 24;
}
if (styleElementForLeft == null && isTimelineOverflowingHorizontally()) {
resBlock.getStyle().setPosition(Position.RELATIVE);
resBlock.getStyle().setLeft(left, Unit.PX);
}
}
示例15: calculateResolutionMinWidth
import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private int calculateResolutionMinWidth() {
boolean removeResolutionDiv = false;
if (!resolutionDiv.hasParentElement()) {
removeResolutionDiv = true;
getElement().appendChild(resolutionDiv);
}
DivElement resBlockMeasure = DivElement.as(DOM.createDiv());
if (resolution == Resolution.Week) {
// configurable with '.col.w.measure' selector
resBlockMeasure.setClassName(STYLE_COL + " " + STYLE_WEEK + " " + STYLE_MEASURE);
} else {
// measure for text 'MM'
resBlockMeasure.setInnerText("MM");
// configurable with '.col.measure' selector
resBlockMeasure.setClassName(STYLE_COL + " " + STYLE_MEASURE);
}
resolutionDiv.appendChild(resBlockMeasure);
int width = resBlockMeasure.getClientWidth();
if (resolution == Resolution.Week) {
// divide given width by number of days in week
width = width / DAYS_IN_WEEK;
}
width = (width < RESOLUTION_WEEK_DAYBLOCK_WIDTH) ? RESOLUTION_WEEK_DAYBLOCK_WIDTH : width;
resBlockMeasure.removeFromParent();
if (removeResolutionDiv) {
resolutionDiv.removeFromParent();
}
return width;
}