當前位置: 首頁>>代碼示例>>Java>>正文


Java DivElement.setClassName方法代碼示例

本文整理匯總了Java中com.google.gwt.dom.client.DivElement.setClassName方法的典型用法代碼示例。如果您正苦於以下問題:Java DivElement.setClassName方法的具體用法?Java DivElement.setClassName怎麽用?Java DivElement.setClassName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.dom.client.DivElement的用法示例。


在下文中一共展示了DivElement.setClassName方法的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: TaskList

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
protected TaskList(PageTransitionPanel parent, Controls controls,
    Controller controller, TaskList.Resources resources) {
  super(parent, controls, resources);
  this.controller = controller;
  this.resources = resources;

  urgentNotImportantTasks = Document.get().createDivElement();
  urgentImportantTasks = Document.get().createDivElement();
  notUrgentNotImportantTasks = Document.get().createDivElement();
  notUrgentImportantTasks = Document.get().createDivElement();
  Element container = getContentContainer();
  container.appendChild(urgentImportantTasks);
  container.appendChild(notUrgentImportantTasks);
  container.appendChild(urgentNotImportantTasks);
  container.appendChild(notUrgentNotImportantTasks);

  userEmail = Document.get().createDivElement();
  userEmail.getStyle().setProperty("display", "inline-block");
  userEmail.setInnerText("Loading...");
  logoutLink = Document.get().createAnchorElement();
  DivElement userInfoContainer = Document.get().createDivElement();
  userInfoContainer.appendChild(userEmail);
  userInfoContainer.appendChild(logoutLink);
  userInfoContainer.setClassName(resources.taskListCss().user());
  container.appendChild(userInfoContainer);
}
 
開發者ID:dougkoellmer,項目名稱:swarm,代碼行數:27,代碼來源:TaskList.java

示例3: appendToDocument

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private void appendToDocument(HTML target, PluginContext pluginContext, CajolerResponse response) {
  DivElement domitaVdocElement = Document.get().createDivElement();
  domitaVdocElement.setClassName("innerHull");

  target.getElement().setInnerHTML("");
  target.getElement().setClassName("outerHull");
  target.getElement().appendChild(domitaVdocElement);

  initializeDoodadEnvironment(
      cajaFrame, domitaVdocElement, pluginContext.getJSOInterface());

  // Render HTML
  domitaVdocElement.setInnerHTML(response.getHtml());

  // Inject JS
  Document cajaFrameDoc = cajaFrame.getContentDocument();
  cajaFrameDoc.getBody().appendChild(cajaFrameDoc.createScriptElement(response.getJs()));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:19,代碼來源:CajolerFacade.java

示例4: 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

示例5: TaskRow

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
public TaskRow(Element parentElem, Task data) {
  super(parentElem);
  this.data = data;
  Element myElem = getElement();
  TaskList.Css css = resources.taskListCss();
  myElem.setClassName(css.taskRow());
  titleElem = Document.get().createDivElement();
  titleElem.setClassName(css.title());
  DivElement rightMask = Document.get().createDivElement();
  rightMask.setClassName(css.checkBoxContainer());
  checkMark = Document.get().createDivElement();
  rightMask.appendChild(checkMark);

  myElem.appendChild(titleElem);
  myElem.appendChild(rightMask);

  renderTask();

  hookEventListeners();
}
 
開發者ID:dougkoellmer,項目名稱:swarm,代碼行數:21,代碼來源:TaskList.java

示例6: setCaption

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
public final boolean setCaption(String caption, Icon icon,
        String captionStyleName) {
    DivElement captionElement = getFirstChildElement().cast();

    boolean hasIcon = icon != null;
    boolean needsCaption = hasIcon
            || (caption != null && !caption.isEmpty());

    if (needsCaption) {
        String captionHtml = hasIcon ? icon.getElement().getString()
                : "";
        captionHtml += caption == null ? "" : caption;
        captionElement.setInnerHTML(captionHtml);
        captionElement.getStyle().setProperty("display", null);
        // copy v-caption prefixed styles from widget to caption
        captionElement.setClassName(captionStyleName);
        setClassName(ROW_CLASSNAME + " " + ROW_WITH_CAPTION_STYLENAME);
    } else {
        setClassName(ROW_CLASSNAME + " "
                + ROW_WITHOUT_CAPTION_STYLENAME);
    }
    return needsCaption;
}
 
開發者ID:vaadin,項目名稱:touchkit,代碼行數:24,代碼來源:VerticalComponentGroupWidget.java

示例7: getRootContainer

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Element getRootContainer(String domID) {
  DivElement divElement = Document.get().createDivElement();
  divElement.setId(domID);
  divElement.setClassName(treeStyles.styles().rootContainer());
  return divElement;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:9,代碼來源:AbstractPresentationRenderer.java

示例8: getNodeContainer

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Element getNodeContainer() {
  DivElement divElement = Document.get().createDivElement();
  divElement.setClassName(treeStyles.styles().nodeContainer());
  return divElement;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:8,代碼來源:AbstractPresentationRenderer.java

示例9: getPresentableTextContainer

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Element getPresentableTextContainer(Element content) {
  DivElement divElement = Document.get().createDivElement();
  divElement.setClassName(treeStyles.styles().presentableTextContainer());
  divElement.appendChild(content);
  return divElement;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:9,代碼來源:AbstractPresentationRenderer.java

示例10: getInfoTextContainer

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Element getInfoTextContainer(Element content) {
  DivElement divElement = Document.get().createDivElement();
  divElement.setClassName(treeStyles.styles().infoTextContainer());
  divElement.appendChild(content);
  return divElement;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:9,代碼來源:AbstractPresentationRenderer.java

示例11: getDescendantsContainer

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Element getDescendantsContainer() {
  DivElement divElement = Document.get().createDivElement();
  divElement.setClassName(treeStyles.styles().descendantsContainer());
  return divElement;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:8,代碼來源:AbstractPresentationRenderer.java

示例12: createItemDiv

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private DivElement createItemDiv(Element[] items) {
    DivElement mi = Document.get().createDivElement();
    mi.setClassName("list-view-pf-main-info");
    mi.getStyle().setPaddingTop(5, Style.Unit.PX);
    mi.getStyle().setPaddingBottom(5, Style.Unit.PX);
    for (Element item : items) {
        mi.appendChild(item);
    }

    DivElement gi = Document.get().createDivElement();
    gi.setClassName("list-group-item");
    gi.appendChild(mi);
    return gi;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:15,代碼來源:PerspectivesExplorerView.java

示例13: AbstractStepWidget

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
public AbstractStepWidget() {
    DivElement bar = DivElement.as(DOM.createDiv());
    bar.setClassName(STYLE_BAR);
    setElement(bar);

    caption = DivElement.as(DOM.createDiv());
    caption.setClassName(STYLE_BAR_LABEL);
    bar.appendChild(caption);

    // hide by default
    bar.getStyle().setVisibility(Visibility.HIDDEN);
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:13,代碼來源:AbstractStepWidget.java

示例14: 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

示例15: 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;
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:9,代碼來源:TimelineWidget.java


注:本文中的com.google.gwt.dom.client.DivElement.setClassName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。