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


Java DOM.createDiv方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.DOM.createDiv方法的典型用法代码示例。如果您正苦于以下问题:Java DOM.createDiv方法的具体用法?Java DOM.createDiv怎么用?Java DOM.createDiv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.DOM的用法示例。


在下文中一共展示了DOM.createDiv方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setToday

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public void setToday(Date today, int width) {
    this.today = today;
    addStyleDependentName("today");
    Element lastChild = (Element) getElement().getLastChild();
    if (lastChild.getClassName().equals("v-calendar-current-time")) {
        todaybar = lastChild;
    } else {
        todaybar = DOM.createDiv();
        todaybar.setClassName("v-calendar-current-time");
        getElement().appendChild(todaybar);
    }

    if (width != -1) {
        todaybar.getStyle().setWidth(width, Unit.PX);
    }

    // position is calculated later, when we know the cell heights
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:19,代码来源:DateCell.java

示例2: DateCellDayItem

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public DateCellDayItem(DateCell dateCell, WeekGrid parent, CalendarItem calendarItem) {
    super();
    this.dateCell = dateCell;

    handlers = new LinkedList<>();

    setStylePrimaryName("v-calendar-event");

    setCalendarItem(calendarItem);

    weekGrid = parent;

    Style s = getElement().getStyle();
    if (calendarItem.getStyleName().length() > 0) {
        addStyleDependentName(calendarItem.getStyleName());
    }
    s.setPosition(Position.ABSOLUTE);

    caption = DOM.createDiv();
    caption.addClassName("v-calendar-event-caption");
    getElement().appendChild(caption);

    eventContent = DOM.createDiv();
    eventContent.addClassName("v-calendar-event-content");
    getElement().appendChild(eventContent);

    if (weekGrid.getCalendar().isItemResizeAllowed() && getCalendarItem().isResizeable()) {
        topResizeBar = DOM.createDiv();
        bottomResizeBar = DOM.createDiv();

        topResizeBar.addClassName("v-calendar-event-resizetop");
        bottomResizeBar.addClassName("v-calendar-event-resizebottom");

        getElement().appendChild(topResizeBar);
        getElement().appendChild(bottomResizeBar);
    }

    eventIndex = calendarItem.getIndex();

}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:41,代码来源:DateCellDayItem.java

示例3: MiniProgressBar

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
/**
 * Create a progress bar within the given range starting at the specified
 * progress amount.
 *
 * @param minProgress the minimum progress
 * @param maxProgress the maximum progress
 * @param curProgress the current progress
 * @param textFormatter the text formatter
 */
public MiniProgressBar(double minProgress, double maxProgress,
  double curProgress, TextFormatter textFormatter) {
  this.minProgress = minProgress;
  this.maxProgress = maxProgress;
  this.curProgress = curProgress;
  setTextFormatter(textFormatter);

  // Create the outer shell
  setElement(DOM.createDiv());
  DOM.setStyleAttribute(getElement(), "position", "relative");
  setStyleName("gwt-ProgressBar-shell");

  // Create the bar element
  barElement = DOM.createDiv();
  DOM.appendChild(getElement(), barElement);
  DOM.setStyleAttribute(barElement, "height", "100%");
  setBarStyleName("gwt-ProgressBar-bar");

  // Create the text element
  textElement = DOM.createDiv();
  DOM.appendChild(getElement(), textElement);
  DOM.setStyleAttribute(textElement, "position", "absolute");
  DOM.setStyleAttribute(textElement, "top", "0px");

  //Set the current progress
  setProgress(curProgress);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:37,代码来源:MiniProgressBar.java

示例4: ensureDropTargetArea

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
private void ensureDropTargetArea() {
  if (dropTargetArea == null) {
    dropTargetArea = DOM.createDiv();
    setDropTargetAreaVisible(false);
    DOM.setStyleAttribute(dropTargetArea, "border", "2px solid " + DROP_TARGET_AREA_COLOR);
    DOM.appendChild(container.getRootPanel().getElement(), dropTargetArea);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:9,代码来源:MockTableLayout.java

示例5: ensureDividerInited

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
private void ensureDividerInited() {
  if (dividerElement == null) {
    dividerElement = DOM.createDiv();
    DOM.setStyleAttribute(dividerElement, "backgroundColor", DIVIDER_COLOR);
    setDividerVisible(false);
    DOM.appendChild(container.getRootPanel().getElement(), dividerElement);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:9,代码来源:MockHVLayoutBase.java

示例6: DateCell

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
public DateCell(WeekGrid parent, Date date, Set<Long> blockedSlots) {
    weekgrid = parent;
    Element mainElement = DOM.createDiv();
    setElement(mainElement);
    makeFocusable();
    setDate(date);

    addStyleName("v-calendar-day-times");

    handlers = new LinkedList<>();

    // 2 slots / hour
    firstHour = weekgrid.getFirstHour();
    lastHour = weekgrid.getLastHour();
    numberOfSlots = (lastHour - firstHour + 1) * 2;

    long slotTime = Math.round(((lastHour - firstHour + 1) * 3600000.0) / numberOfSlots);

    slotElements = new Element[numberOfSlots];
    slotElementHeights = new int[numberOfSlots];

    slots.clear();

    long dateTime = getDate().getTime();
    long start = dateTime + firstHour * 3600000;
    long end = start + slotTime;

    for (int i = 0; i < numberOfSlots; i++) {

        boolean blocked = blockedSlots != null && blockedSlots.contains(start-dateTime);

        DateCellSlot slot = new DateCellSlot(this, new Date(start), new Date(end), blocked);
        if (i % 2 == 0) {
            slot.setStyleName(blocked ? "v-datecellslot-blocked-even" : "v-datecellslot-even");
        } else {
            slot.setStyleName(blocked ? "v-datecellslot-blocked" : "v-datecellslot");
        }

        Event.sinkEvents(slot.getElement(), Event.MOUSEEVENTS);

        mainElement.appendChild(slot.getElement());
        slotElements[i] = slot.getElement();
        slots.add(slot);
        start = end;
        end = start + slotTime;
    }

    // Sink items for tooltip handling
    Event.sinkEvents(mainElement, Event.MOUSEEVENTS);
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:51,代码来源:DateCell.java

示例7: createTimeBar

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
private void createTimeBar(boolean format24h) {
    setStylePrimaryName("v-calendar-times");

    // Fist "time" is empty
    Element e = DOM.createDiv();
    setStyleName(e, "v-calendar-time");
    e.setInnerText("");
    getElement().appendChild(e);

    DateTimeService dts = new DateTimeService();

    if (format24h) {
        for (int i = firstHour + 1; i <= lastHour; i++) {
            e = DOM.createDiv();
            setStyleName(e, "v-calendar-time");
            String delimiter = dts.getClockDelimeter();
            e.setInnerHTML("<span>" + i + "</span>" + delimiter + "00");
            getElement().appendChild(e);
        }
    } else {
        // FIXME Use dts.getAmPmStrings(); and make sure that
        // DateTimeService has a some Locale set.
        String[] ampm = new String[] { "AM", "PM" };

        int amStop = (lastHour < 11) ? lastHour : 11;
        int pmStart = (firstHour > 11) ? firstHour % 11 : 0;

        if (firstHour < 12) {
            for (int i = firstHour + 1; i <= amStop; i++) {
                e = DOM.createDiv();
                setStyleName(e, "v-calendar-time");
                e.setInnerHTML("<span>" + timesFor12h[i] + "</span>"
                        + " " + ampm[0]);
                getElement().appendChild(e);
            }
        }

        if (lastHour > 11) {
            for (int i = pmStart; i < lastHour - 11; i++) {
                e = DOM.createDiv();
                setStyleName(e, "v-calendar-time");
                e.setInnerHTML("<span>" + timesFor12h[i] + "</span>"
                        + " " + ampm[1]);
                getElement().appendChild(e);
            }
        }
    }
}
 
开发者ID:blackbluegl,项目名称:calendar-component,代码行数:49,代码来源:WeekGrid.java

示例8: appendDecorationElement

import com.google.gwt.user.client.DOM; //导入方法依赖的package包/类
/**
 * Helper method for adding style elements (in particular the rounded corners).
 */
private void appendDecorationElement(String styleClass) {
  Element element = DOM.createDiv();
  element.setClassName(styleClass);
  getElement().appendChild(element);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:9,代码来源:Box.java


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