本文整理汇总了Java中com.google.gwt.dom.client.DivElement.addClassName方法的典型用法代码示例。如果您正苦于以下问题:Java DivElement.addClassName方法的具体用法?Java DivElement.addClassName怎么用?Java DivElement.addClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.DivElement
的用法示例。
在下文中一共展示了DivElement.addClassName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: appendEntry
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
/**
* Appends an entry to the log panel.
* @param formatted
* @param level
*/
public static void appendEntry(String formatted, Level level) {
DivElement entry = Document.get().createDivElement();
entry.setClassName(RESOURCES.css().entry());
entry.setInnerHTML(formatted);
// Add the style name associated with the log level.
switch (level) {
case ERROR:
entry.addClassName(RESOURCES.css().error());
break;
case FATAL:
entry.addClassName(RESOURCES.css().fatal());
break;
case TRACE:
entry.addClassName(RESOURCES.css().trace());
break;
}
// Make fatals detectable by WebDriver, so that tests can early out on
// failure:
if (level.equals(Level.FATAL)) {
latestFatalError = formatted;
}
writeOrCacheOutput(entry);
}
示例2: 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;
}
示例3: ItemWidget
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
ItemWidget(MenuItem item) {
this.item = item;
addStyleName(resources.css().popupItem());
final Element itemLabel = Document.get().createDivElement();
itemLabel.setInnerText(item.getName());
itemLabel.getStyle().setFloat(Style.Float.LEFT);
getElement().appendChild(itemLabel);
if (dataProvider.isGroup(item)) {
DivElement arrow = Document.get().createDivElement();
arrow.setInnerHTML(FontAwesome.PLAY);
arrow.addClassName(resources.css().arrow());
getElement().appendChild(arrow);
}
attachEventHandlers();
}
示例4: VSwitch
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
/**
* The constructor should first call super() to initialize the component and
* then handle any initialization relevant to Vaadin.
*/
public VSwitch() {
// Change to proper element or remove if extending another widget
setElement(Document.get().createDivElement());
DivElement el = Document.get().createDivElement();
el.addClassName(CLASSNAME + "-wrapper");
mainElement = Document.get().createDivElement();
// This method call of the Paintable interface sets the component
// style name in DOM tree
mainElement.setClassName(CLASSNAME);
el.appendChild(mainElement);
getElement().appendChild(el);
// build the DOM
slider = Document.get().createDivElement();
slider.setClassName(CLASSNAME + "-slider");
mainElement.appendChild(slider);
updateVisibleState(true); // Set the initial position without animation.
addHandlers();
}
示例5: createMainToolbar
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private void createMainToolbar(Document document, DivElement mainContainer) {
toolbar = createChildDiv(document, mainContainer, "toolbar");
toolbarContainer = createChildDiv(document, toolbar, "toolbarContainer");
toolbarViewer = createChildDiv(document, toolbarContainer, "toolbarViewer");
toolbarViewerLeft = createChildDiv(document, toolbarViewer, "toolbarViewerLeft");
sidebarToggleBtn = createChildButton(document, toolbarViewerLeft, "sidebarToggle");
sidebarToggleBtn.addClassName("toolbarButton");
sidebarToggleBtn.setTabIndex(11);
toolbarButtonSpacer = createChildDiv(document, toolbarViewerLeft, "toolbarButtonSpacer");
viewFind = createChildDiv(document, toolbarViewerLeft, "viewFind");
viewFind.addClassName("toolbarButton");
viewFind.setTabIndex(12);
viewFind.setTitle("Find in Document");
//paging - previous, next, current page number, jump and all pages
createPagingSection(document, toolbarViewerLeft);
toolbarViewerMiddle = createChildDiv(document, toolbarViewer, "toolbarViewerMiddle");
createZoomingSection(document, toolbarViewerLeft);
toolbarViewerRight = createChildDiv(document, toolbarViewer, "toolbarViewerRight");
DivElement verticalToolbarSeparator = createChildDiv(document, toolbarViewerRight, "verticalToolbarSeparator");
verticalToolbarSeparator.addClassName("hiddenSmallView");
secondaryToolbarToggle = createChildButton(document, toolbarViewerRight, "secondaryToolbarToggle");
secondaryToolbarToggle.addClassName("toolbarButton");
secondaryToolbarToggle.setTitle("Tools");
secondaryToolbarToggle.setTabIndex(36);
}
示例6: createPagingSection
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
/**
*
<div class="splitToolbarButton hiddenSmallView">
<button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
<span data-l10n-id="previous_label">Previous</span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button class="toolbarButton pageDown" title="Next Page" id="next" tabindex="14" data-l10n-id="next">
<span data-l10n-id="next_label">Next</span>
</button>
</div>
<input type="number" id="pageNumber" class="toolbarField pageNumber" title="Page" value="1" size="4" min="1" tabindex="15" data-l10n-id="page">
<span id="numPages" class="toolbarLabel"></span>
*
*/
private void createPagingSection(Document document, DivElement parent) {
DivElement splitToolbarButton = createChildDiv(document, parent, "splitToolbarButton");
splitToolbarButton.addClassName("hiddenSmallView");
previousPage = createChildButton(document, splitToolbarButton, "pageUp");
previousPage.addClassName("toolbarButton");
previousPage.setTabIndex(13);
previousPage.setTitle("Previous Page");
createChildDiv(document, splitToolbarButton, "splitToolbarButtonSeparator");
nextPage = createChildButton(document, splitToolbarButton, "pageDown");
nextPage.addClassName("toolbarButton");
nextPage.setTabIndex(14);
nextPage.setTitle("Next Page");
pageNumber = createChildNumber(document, splitToolbarButton, "pageNumber");
pageNumber.addClassName("toolbarField");
pageNumber.setTitle("Page");
pageNumber.setValue("1");
pageNumber.setSize(4);
pageNumber.setAttribute("min", "1");
pageNumber.setTabIndex(15);
numPages = createChildSpan(document, splitToolbarButton, "numPages");
numPages.addClassName("toolbarLabel");
}
示例7: createDiv_withId
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private DivElement createDiv_withId(Document document, String nameId) {
DivElement result = document.createDivElement();
result.setId(nameId);
result.addClassName(nameId);
return result;
}
示例8: 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);
}
}
示例9: 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);
}
示例10: 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);
}
示例11: 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;
}
示例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: createDiv
import com.google.gwt.dom.client.DivElement; //导入方法依赖的package包/类
private DivElement createDiv(Document document, String nameId) {
DivElement result = document.createDivElement();
result.addClassName(nameId);
return result;
}