本文整理汇总了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);
}
示例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);
}
示例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()));
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}