当前位置: 首页>>代码示例>>Java>>正文


Java DivElement.addClassName方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:31,代码来源:DomLogger.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:HotKeysDialogPresenter.java

示例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();
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:ItemsList.java

示例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();
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:27,代码来源:VSwitch.java

示例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);
}
 
开发者ID:WhitesteinTechnologies,项目名称:wt-pdf-viewer,代码行数:33,代码来源:WTPdfViewerWidget.java

示例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");
}
 
开发者ID:WhitesteinTechnologies,项目名称:wt-pdf-viewer,代码行数:43,代码来源:WTPdfViewerWidget.java

示例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;
}
 
开发者ID:WhitesteinTechnologies,项目名称:wt-pdf-viewer,代码行数:8,代码来源:WTPdfViewerWidget.java

示例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);
	}
}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:13,代码来源:ItemsTable.java

示例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);
}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:29,代码来源:ItemsTable.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:HotKeysDialogViewImpl.java

示例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;
}
 
开发者ID:tltv,项目名称:gantt,代码行数:10,代码来源:TimelineWidget.java

示例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);
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:14,代码来源:TimelineWidget.java

示例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);
        }
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:33,代码来源:TimelineWidget.java

示例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);
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:28,代码来源:TimelineWidget.java

示例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;
}
 
开发者ID:WhitesteinTechnologies,项目名称:wt-pdf-viewer,代码行数:7,代码来源:WTPdfViewerWidget.java


注:本文中的com.google.gwt.dom.client.DivElement.addClassName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。