Example usage for com.google.gwt.dom.client Style setZIndex

List of usage examples for com.google.gwt.dom.client Style setZIndex

Introduction

In this page you can find the example usage for com.google.gwt.dom.client Style setZIndex.

Prototype

public void setZIndex(int value) 

Source Link

Usage

From source file:org.jboss.errai.mvp.client.presenters.RootView.java

License:Apache License

public void ensureGlass() {
    if (glass == null) {
        glass = Document.get().createDivElement();

        Style style = glass.getStyle();
        style.setPosition(Style.Position.ABSOLUTE);
        style.setLeft(0, Style.Unit.PX);
        style.setTop(0, Style.Unit.PX);
        style.setRight(0, Style.Unit.PX);
        style.setBottom(0, Style.Unit.PX);
        style.setZIndex(2147483647); // Maximum z-index
    }/*from w  ww .  j  a v  a  2s.  c om*/
}

From source file:org.kie.uberfire.wires.core.client.palette.StencilPaletteBuilder.java

License:Apache License

private void setDragProxyPosition(final LienzoPanel dragProxyParentPanel, final LienzoPanel dragProxyPanel,
        final double proxyWidth, final double proxyHeight, final NodeMouseDownEvent event) {
    Style style = dragProxyPanel.getElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setLeft(dragProxyParentPanel.getAbsoluteLeft() + event.getX() - (proxyWidth / 2), Style.Unit.PX);
    style.setTop(dragProxyParentPanel.getAbsoluteTop() + event.getY() - (proxyHeight / 2), Style.Unit.PX);
    style.setZIndex(ZINDEX);
}

From source file:org.kie.workbench.common.stunner.client.lienzo.components.glyph.ShapeGlyphDragHandlerImpl.java

License:Apache License

private void setDragProxyPosition(final LienzoPanel dragProxyPanel, final double proxyWidth,
        final double proxyHeight, final double x, final double y) {
    Style style = dragProxyPanel.getElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setLeft(x - (proxyWidth / 2), Style.Unit.PX);
    style.setTop(y - (proxyHeight / 2), Style.Unit.PX);
    style.setZIndex(ZINDEX);
}

From source file:org.opencms.ade.containerpage.client.CmsContainerpageDNDController.java

License:Open Source License

/**
 * Sets styles of helper elements, appends the to the drop target and puts them into a drag info bean.<p>
 * /*from   w  ww.  j a v a  2  s.c o m*/
 * @param dragHelper the drag helper element
 * @param placeholder the placeholder element
 * @param target the drop target
 * @param handler the drag and drop handler
 */
private void prepareDragInfo(Element dragHelper, Element placeholder, I_CmsDropTarget target,
        CmsDNDHandler handler) {

    target.getElement().appendChild(dragHelper);
    // preparing helper styles
    int width = CmsDomUtil.getCurrentStyleInt(dragHelper, CmsDomUtil.Style.width);
    Style style = dragHelper.getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setMargin(0, Unit.PX);
    style.setWidth(width, Unit.PX);
    style.setZIndex(I_CmsLayoutBundle.INSTANCE.constants().css().zIndexDND());
    dragHelper.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragging());
    dragHelper.addClassName(org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.generalCss().shadow());
    if (!CmsDomUtil.hasBackgroundImage(dragHelper)) {
        dragHelper.getStyle().setBackgroundColor(CmsDomUtil.getEffectiveBackgroundColor(dragHelper));
    }
    if (!CmsDomUtil.hasBorder(dragHelper)) {
        dragHelper.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragElementBorder());
    }
    style.setDisplay(Display.NONE);

    String positioning = CmsDomUtil.getCurrentStyle(target.getElement(),
            org.opencms.gwt.client.util.CmsDomUtil.Style.position);
    // set target relative, if not absolute or fixed
    if (!Position.ABSOLUTE.getCssName().equals(positioning)
            && !Position.FIXED.getCssName().equals(positioning)) {
        target.getElement().getStyle().setPosition(Position.RELATIVE);
    }
    setMinHeight(target);
    m_dragInfos.put(target, new DragInfo(dragHelper, placeholder, width - 15, handler.getCursorOffsetY()));
    handler.addTarget(target);

    // adding drag handle
    Element button = DOM.createDiv();
    button.appendChild((new Image(I_CmsImageBundle.INSTANCE.icons().moveIconActive())).getElement());
    button.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragHandle());
    dragHelper.appendChild(button);
}

From source file:org.opencms.ade.containerpage.client.ui.CmsContainerPageElement.java

License:Open Source License

/**
 * @see org.opencms.gwt.client.dnd.I_CmsDraggable#getDragHelper(org.opencms.gwt.client.dnd.I_CmsDropTarget)
 *//*w w w .  j  a  v a2 s  .  c o m*/
public Element getDragHelper(I_CmsDropTarget target) {

    Element helper = CmsDomUtil.clone(getElement());
    target.getElement().appendChild(helper);
    // preparing helper styles
    String width = CmsDomUtil.getCurrentStyle(helper, CmsDomUtil.Style.width);
    Style style = helper.getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setMargin(0, Unit.PX);
    style.setProperty(CmsDomUtil.Style.width.name(), width);
    style.setZIndex(I_CmsLayoutBundle.INSTANCE.constants().css().zIndexDND());
    helper.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragging());
    helper.addClassName(org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.generalCss().shadow());
    if (!CmsDomUtil.hasBackground(helper)) {
        helper.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragElementBackground());
    }

    if (!CmsDomUtil.hasBorder(helper)) {
        helper.addClassName(I_CmsLayoutBundle.INSTANCE.dragdropCss().dragElementBorder());
    }
    return helper;
}

From source file:org.opencms.ade.containerpage.client.ui.CmsGroupcontainerEditor.java

License:Open Source License

/**
 * Constructor.<p>//from   www  . j  a  v  a  2  s. c om
 * 
 * @param groupContainer the group-container
 * @param controller the container-page controller
 * @param handler the container-page handler
 */
private CmsGroupcontainerEditor(CmsGroupContainerElementPanel groupContainer,
        CmsContainerpageController controller, CmsContainerpageHandler handler) {

    m_controller = controller;
    m_editorWidget = uiBinder.createAndBindUi(this);
    initWidget(m_editorWidget);
    m_overlayDiv.getStyle().setZIndex(I_CmsLayoutBundle.INSTANCE.constants().css().zIndexHighlighting());
    m_labelDescription.setText(Messages.get().key(Messages.GUI_GROUPCONTAINER_LABEL_DESCRIPTION_0));
    m_labelTitle.setText(Messages.get().key(Messages.GUI_GROUPCONTAINER_LABEL_TITLE_0));
    m_editorId = HTMLPanel.createUniqueId();
    m_editorWidget.getElement().setId(m_editorId);
    m_groupContainer = groupContainer;
    m_backUpElements = new ArrayList<CmsContainerPageElementPanel>();
    Iterator<Widget> it = m_groupContainer.iterator();
    while (it.hasNext()) {
        Widget w = it.next();
        if (w instanceof CmsContainerPageElementPanel) {
            m_backUpElements.add((CmsContainerPageElementPanel) w);
        }
    }
    m_parentContainer = (CmsContainerPageContainer) m_groupContainer.getParentTarget();
    m_groupContainerPosition = CmsPositionBean.generatePositionInfo(m_groupContainer);
    m_editingPlaceholder = createPlaceholder(m_groupContainer.getElement());
    m_groupContainer.setEditingPlaceholder(m_editingPlaceholder);
    m_groupContainer.setEditingMarker(m_containerMarker);
    m_indexPosition = m_parentContainer.getWidgetIndex(m_groupContainer);
    // inserting placeholder element
    m_parentContainer.getElement().insertBefore(m_editingPlaceholder, m_groupContainer.getElement());
    m_editorWidget.add(m_groupContainer, m_editorId);
    Style style = m_groupContainer.getElement().getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setLeft(m_groupContainerPosition.getLeft(), Unit.PX);
    style.setTop(m_groupContainerPosition.getTop(), Unit.PX);
    style.setWidth(m_groupContainerPosition.getWidth(), Unit.PX);
    style.setZIndex(I_CmsLayoutBundle.INSTANCE.constants().css().zIndexGroupContainer());
    m_containerMarker.getStyle().setLeft(m_groupContainerPosition.getLeft() - 3, Unit.PX);
    m_containerMarker.getStyle().setTop(m_groupContainerPosition.getTop() - 4, Unit.PX);
    m_containerMarker.getStyle().setWidth(m_groupContainerPosition.getWidth() + 4, Unit.PX);
    m_containerMarker.getStyle().setHeight(m_groupContainerPosition.getHeight() + 4, Unit.PX);
    m_groupContainer.getElementOptionBar().setVisible(false);
    m_groupContainer.getElementOptionBar()
            .removeStyleName(I_CmsToolbarButtonLayoutBundle.INSTANCE.toolbarButtonCss().cmsHovering());

    RootPanel.get().addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerEditing());

    // Loading data of all contained elements including group-container element
    m_controller.getElements(getElementIds(), new I_CmsSimpleCallback<Map<String, CmsContainerElementData>>() {

        public void execute(Map<String, CmsContainerElementData> arg) {

            setGroupContainerData(arg);
        }
    });
}

From source file:org.opencms.ade.containerpage.client.ui.groupeditor.A_CmsGroupEditor.java

License:Open Source License

/**
 * Constructor.<p>// w w  w . j av a 2 s  . co m
 *
 * @param groupContainer the group-container
 * @param controller the container-page controller
 * @param handler the container-page handler
 */
protected A_CmsGroupEditor(CmsGroupContainerElementPanel groupContainer, CmsContainerpageController controller,
        CmsContainerpageHandler handler) {

    m_controller = controller;
    m_handler = handler;
    m_editorWidget = uiBinder.createAndBindUi(this);
    initWidget(m_editorWidget);
    m_editorId = HTMLPanel.createUniqueId();
    m_editorWidget.getElement().setId(m_editorId);
    m_groupContainer = groupContainer;
    m_backUpElements = new ArrayList<CmsContainerPageElementPanel>();
    Iterator<Widget> it = m_groupContainer.iterator();
    while (it.hasNext()) {
        Widget w = it.next();
        if (w instanceof CmsContainerPageElementPanel) {
            m_backUpElements.add((CmsContainerPageElementPanel) w);
        }
    }
    m_parentContainer = (CmsContainerPageContainer) m_groupContainer.getParentTarget();
    m_groupContainerPosition = CmsPositionBean.getBoundingClientRect(m_groupContainer.getElement());
    m_editingPlaceholder = createPlaceholder(m_groupContainer.getElement());
    m_groupContainer.setEditingPlaceholder(m_editingPlaceholder);
    m_groupContainer.setEditingMarker(m_containerMarker);
    m_indexPosition = m_parentContainer.getWidgetIndex(m_groupContainer);
    // inserting placeholder element
    m_parentContainer.getElement().insertBefore(m_editingPlaceholder, m_groupContainer.getElement());
    m_editorWidget.add(m_groupContainer, m_editorId);
    Style style = m_groupContainer.getElement().getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setLeft(m_groupContainerPosition.getLeft(), Unit.PX);
    style.setTop(m_groupContainerPosition.getTop(), Unit.PX);
    style.setWidth(m_groupContainerPosition.getWidth(), Unit.PX);
    style.setZIndex(I_CmsLayoutBundle.INSTANCE.constants().css().zIndexGroupContainer());
    m_containerMarker.getStyle().setLeft(m_groupContainerPosition.getLeft() - 3, Unit.PX);
    m_containerMarker.getStyle().setTop(m_groupContainerPosition.getTop() - 4, Unit.PX);
    m_containerMarker.getStyle().setWidth(m_groupContainerPosition.getWidth() + 4, Unit.PX);
    m_containerMarker.getStyle().setHeight(m_groupContainerPosition.getHeight() + 4, Unit.PX);
    m_containerMarker.getStyle()
            .setBackgroundColor(CmsDomUtil.getEffectiveBackgroundColor(m_parentContainer.getElement()));
    m_groupContainer.getElementOptionBar().setVisible(false);
    m_groupContainer.getElementOptionBar()
            .removeStyleName(I_CmsToolbarButtonLayoutBundle.INSTANCE.toolbarButtonCss().cmsHovering());

    RootPanel.get().addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerEditing());
    addInputFields();
    m_editorDialog = new CmsPopup();
    addButtons();
    if (m_saveButton != null) {
        m_saveButton.disable(Messages.get().key(Messages.GUI_GROUPCONTAINER_LOADING_DATA_0));
    }
    m_editorDialog.setGlassEnabled(false);
    m_editorDialog.setModal(false);
    m_editorDialog.addDialogClose(new Command() {

        /**
         * @see com.google.gwt.user.client.Command#execute()
         */
        public void execute() {

            cancelEdit();
        }
    });
}

From source file:org.opencms.gwt.client.util.CmsDebugLog.java

License:Open Source License

/**
 * Constructor.<p>/*from w  w w. j a  v  a 2  s .  c  o  m*/
 */
@SuppressWarnings("unused")
private CmsDebugLog() {

    if (!DEBUG) {
        return;
    }
    m_html = new HTML();
    initWidget(m_html);
    Style style = getElement().getStyle();
    style.setWidth(200, Unit.PX);
    style.setHeight(500, Unit.PX);
    style.setPadding(10, Unit.PX);
    style.setOverflow(Overflow.AUTO);
    style.setBorderStyle(BorderStyle.SOLID);
    style.setBorderColor(I_CmsLayoutBundle.INSTANCE.constants().css().borderColor());
    style.setBorderWidth(1, Unit.PX);
    style.setPosition(Position.FIXED);
    style.setTop(50, Unit.PX);
    style.setRight(50, Unit.PX);
    style.setBackgroundColor(I_CmsLayoutBundle.INSTANCE.constants().css().backgroundColorDialog());
    style.setZIndex(10);
}

From source file:org.opennms.features.vaadin.nodemaps.internal.gwt.client.ui.NodeMapWidget.java

License:Open Source License

private void addSearchControl() {
    LOG.info("NodeMapWidget.addSearchControl()");
    m_searchControl = new SearchControl(m_markerContainer, this, m_eventManager, m_componentTracker);
    final String id = m_searchControl.getElement().getId();
    if (id == null || "".equals(id)) {
        m_searchControl.getElement().setId("search-control");
    } else {//from w ww . j a v a2s.  com
        LOG.info("NodeMapWidget.addSearchControl(): id = " + id);
    }
    final HTMLPanel mapParent = HTMLPanel.wrap(m_mapPanel.getParent().getElement());
    final Style searchStyle = m_searchControl.getElement().getStyle();
    searchStyle.setPosition(Position.ABSOLUTE);
    searchStyle.setTop(5, Unit.PX);
    searchStyle.setLeft(5, Unit.PX);
    searchStyle.setZIndex(1000);
    mapParent.add(m_searchControl);
}

From source file:org.opennms.features.vaadin.nodemaps.internal.gwt.client.ui.NodeMapWidget.java

License:Open Source License

private void addAlarmControl() {
    LOG.info("NodeMapWidget.addAlarmControl()");

    m_alarmControl = new AlarmControl(m_eventManager, m_componentTracker);
    final String id = m_alarmControl.getElement().getId();
    if (id == null || "".equals(id)) {
        m_alarmControl.getElement().setId("alarm-control");
    } else {/*w ww.  ja v a2 s.c o m*/
        LOG.info("NodeMapWidget.addAlarmControl(): id = " + id);
    }

    final HTMLPanel mapParent = HTMLPanel.wrap(m_mapPanel.getParent().getElement());
    final Style searchStyle = m_alarmControl.getElement().getStyle();
    searchStyle.setPosition(Position.ABSOLUTE);
    searchStyle.setTop(5, Unit.PX);
    searchStyle.setRight(5, Unit.PX);
    searchStyle.setZIndex(1000);
    mapParent.add(m_alarmControl);
}