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


Java DivElement.as方法代碼示例

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


在下文中一共展示了DivElement.as方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addStep

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
/**
 * Add new StepWidget into content area.
 *
 * @param stepIndex
 *            Index of step (0 based) (not element index in container)
 * @param widget
 * @param updateAffectedSteps
 *            Updates position of affected steps. Usually it means steps
 *            below the target.
 */
public void addStep(int stepIndex, StepWidget stepWidget, boolean updateAffectedSteps) {
    DivElement bar = DivElement.as(stepWidget.getElement());

    boolean newStep = !bar.hasParentElement();
    boolean moving = !newStep && getStepIndex(stepWidget) != stepIndex;
    boolean insertDOM = newStep || moving;

    if (insertDOM) {
        insert(stepIndex + getAdditonalContentElementCount(), stepWidget);
    }

    deferredUpdateStepTop(stepIndex, updateAffectedSteps, bar, insertDOM);

    if (newStep) {
        registerBarEventListener(bar);
    }
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:28,代碼來源:GanttWidget.java

示例2: GanttWidget

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
public GanttWidget() {

        setElement(DivElement.as(DOM.createDiv()));
        setStyleName(STYLE_GANTT);

        moveElement.setClassName(STYLE_MOVE_ELEMENT);
        // not visible by default
        moveElement.getStyle().setDisplay(Display.NONE);

        timeline = GWT.create(TimelineWidget.class);

        container = DivElement.as(DOM.createDiv());
        container.setClassName(STYLE_GANTT_CONTAINER);

        content = DivElement.as(DOM.createDiv());
        content.setClassName(STYLE_GANTT_CONTENT);
        container.appendChild(content);

        content.appendChild(moveElement);

        scrollbarSpacer = DivElement.as(DOM.createDiv());
        scrollbarSpacer.getStyle().setHeight(AbstractNativeScrollbar.getNativeScrollbarHeight(), Unit.PX);
        scrollbarSpacer.getStyle().setDisplay(Display.NONE);

        getElement().appendChild(timeline.getElement());
        getElement().appendChild(container);
        getElement().appendChild(scrollbarSpacer);
    }
 
開發者ID:tltv,項目名稱:gantt,代碼行數:29,代碼來源:GanttWidget.java

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

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

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

示例6: calculateResolutionMinWidth

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private int calculateResolutionMinWidth() {

        boolean removeResolutionDiv = false;
        if (!resolutionDiv.hasParentElement()) {
            removeResolutionDiv = true;
            getElement().appendChild(resolutionDiv);
        }
        DivElement resBlockMeasure = DivElement.as(DOM.createDiv());
        if (resolution == Resolution.Week) {
            // configurable with '.col.w.measure' selector
            resBlockMeasure.setClassName(STYLE_COL + " " + STYLE_WEEK + " " + STYLE_MEASURE);
        } else {
            // measure for text 'MM'
            resBlockMeasure.setInnerText("MM");
            // configurable with '.col.measure' selector
            resBlockMeasure.setClassName(STYLE_COL + " " + STYLE_MEASURE);
        }
        resolutionDiv.appendChild(resBlockMeasure);
        int width = resBlockMeasure.getClientWidth();
        if (resolution == Resolution.Week) {
            // divide given width by number of days in week
            width = width / DAYS_IN_WEEK;
        }
        width = (width < RESOLUTION_WEEK_DAYBLOCK_WIDTH) ? RESOLUTION_WEEK_DAYBLOCK_WIDTH : width;
        resBlockMeasure.removeFromParent();
        if (removeResolutionDiv) {
            resolutionDiv.removeFromParent();
        }
        return width;
    }
 
開發者ID:tltv,項目名稱:gantt,代碼行數:31,代碼來源:TimelineWidget.java

示例7: createResolutionBlock

import com.google.gwt.dom.client.DivElement; //導入方法依賴的package包/類
private DivElement createResolutionBlock() {
    DivElement resBlock = DivElement.as(DOM.createDiv());
    resBlock.setClassName("col");
    return resBlock;
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:6,代碼來源:TimelineWidget.java


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