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

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

Introduction

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

Prototype

public void setOverflow(Overflow value) 

Source Link

Usage

From source file:jetbrains.jetpad.projectional.view.toGwt.ScrollViewMapper.java

License:Apache License

@Override
protected void registerSynchronizers(SynchronizersConfiguration conf) {
    super.registerSynchronizers(conf);

    final Style style = getTarget().getStyle();
    conf.add(Synchronizers.forPropsOneWay(getSource().scroll(), new WritableProperty<Boolean>() {
        @Override/* w  ww . ja  v a 2 s.  co  m*/
        public void set(Boolean value) {
            style.setOverflow(value ? Style.Overflow.HIDDEN : Style.Overflow.VISIBLE);
        }
    }));
    conf.add(Synchronizers.forPropsOneWay(getSource().maxDimension(), new WritableProperty<Vector>() {
        @Override
        public void set(Vector value) {
            style.setProperty("maxWidth", value.x + "px");
            style.setProperty("maxHeight", value.y + "px");
        }
    }));
}

From source file:jetbrains.jetpad.projectional.view.toGwt.ViewContainerToElementMapper.java

License:Apache License

public ViewContainerToElementMapper(ViewContainer source, Element target, final boolean eventsDisabled) {
    super(source, target);

    myCtx = new ViewToDomContext() {
        @Override/*from  w  ww.  ja  v  a 2  s.  com*/
        public ReadableProperty<Rectangle> visibleArea() {
            return myVisibleArea;
        }

        @Override
        public MapperFactory<View, Element> getFactory() {
            return ViewMapperFactory.factory(this);
        }

        @Override
        public Boolean areEventsDisabled() {
            return eventsDisabled;
        }
    };

    disablePopup(myRootDiv);
    target.appendChild(myRootDiv);
    myRootDiv.setTabIndex(0);

    final Style rootDivStyle = myRootDiv.getStyle();
    rootDivStyle.setPosition(Style.Position.RELATIVE);
    rootDivStyle.setPadding(0, Style.Unit.PX);
    rootDivStyle.setOverflow(Style.Overflow.VISIBLE);
    rootDivStyle.setOutlineStyle(Style.OutlineStyle.NONE);
}

From source file:org.cruxframework.crux.widgets.client.slider.TouchSlider.java

License:Apache License

/**
 * Constructor//  w  w  w .  j av  a2 s  .  co m
 */
public TouchSlider() {
    touchPanel = new FocusPanel();
    contentPanel = new FlowPanel();

    touchPanel.add(contentPanel);
    initWidget(touchPanel);

    Style style = contentPanel.getElement().getStyle();
    style.setPosition(Position.RELATIVE);
    style.setOverflow(Overflow.HIDDEN);
    style.setWidth(100, Unit.PCT);
    style.setHeight(100, Unit.PCT);

    touchPanel.addTouchStartHandler(this);

    addAttachHandler(new Handler() {
        private HandlerRegistration orientationHandlerRegistration;

        @Override
        public void onAttachOrDetach(AttachEvent event) {
            if (event.isAttached()) {
                orientationHandlerRegistration = Screen.addOrientationChangeHandler(TouchSlider.this);
            } else if (orientationHandlerRegistration != null) {
                orientationHandlerRegistration.removeHandler();
                orientationHandlerRegistration = null;
            }
        }
    });

}

From source file:org.cruxframework.crux.widgets.client.swappanel.HorizontalSwapPanel.java

License:Apache License

/**
 * Constructor//w w w. ja  v a2s.c  o m
 */
public HorizontalSwapPanel() {
    contentPanel = new FlowPanel();
    initWidget(contentPanel);
    setStyleName("crux-HorizontalSwapPanel");

    Style style = contentPanel.getElement().getStyle();
    style.setPosition(Position.RELATIVE);
    style.setOverflow(Overflow.HIDDEN);
    style.setWidth(100, Unit.PCT);
    style.setVisibility(Visibility.VISIBLE);
    style.setOpacity(1);

    configureCurrentPanel();
    configureNextPanel();

    Transition.hideBackface(currentPanel);
    Transition.hideBackface(nextPanel);

    contentPanel.add(currentPanel);
    contentPanel.add(nextPanel);
}

From source file:org.glom.web.client.ui.details.SingleLineText.java

License:Open Source License

public SingleLineText(final String text) {
    Widget dataWidget;/*from w ww .j  av a  2  s . c  om*/
    if (text.startsWith("http://") || text.startsWith("ftp://")) {
        dataWidget = new Anchor(text, text, "_blank");
        dataWidget.setStyleName("dataLink");
    } else if (text.startsWith("www.")) {
        dataWidget = new Anchor(text, "http://" + text, "_blank");
        dataWidget.setStyleName("dataLink");
    } else {
        final Label dataLabel = new Label();
        dataLabel.setText(text);
        dataWidget = dataLabel;
    }

    final Style style = dataWidget.getElement().getStyle();
    style.setOverflow(Overflow.HIDDEN);
    style.setProperty("textOverflow", "ellipsis");

    initWidget(dataWidget);
}

From source file:org.guvnor.client.editors.GeneralTextEditorScreenView.java

License:Apache License

@PostConstruct
public void setup() {
    initWidget(editor);/*from   w  w w  .  j a  v  a 2  s .  co m*/

    final Style s = getElement().getStyle();
    s.setPosition(Style.Position.ABSOLUTE);
    s.setOverflow(Style.Overflow.HIDDEN);
    s.setTop(0.0, Style.Unit.PX);
    s.setLeft(0.0, Style.Unit.PX);
    s.setWidth(100.0, Style.Unit.PCT);
    s.setHeight(100.0, Style.Unit.PCT);

    editor.startEditor();
    editor.setTheme(AceEditorTheme.CLOUD9_NIGHT);
}

From source file:org.guvnor.client.editors.GeneralTextEditorScreenView.java

License:Apache License

@Override
public void onAttach() {
    super.onAttach();
    final Style s = editor.getElement().getParentElement().getStyle();
    s.setPosition(Style.Position.ABSOLUTE);
    s.setOverflow(Style.Overflow.HIDDEN);
    s.setTop(0.0, Style.Unit.PX);
    s.setLeft(0.0, Style.Unit.PX);
    s.setWidth(100.0, Style.Unit.PCT);
    s.setHeight(100.0, Style.Unit.PCT);
}

From source file:org.kie.workbench.common.stunner.client.widgets.presenters.session.impl.SessionPresenterView.java

License:Apache License

@Override
public void setContentScrollType(final ScrollType type) {
    final Style style = sessionContainer.getElement().getStyle();
    switch (type) {
    case AUTO://from   w  w  w .j  av a2  s .c  o  m
        style.setOverflow(Style.Overflow.AUTO);
        break;
    case CUSTOM:
        style.setOverflow(Style.Overflow.HIDDEN);
    }
}

From source file:org.komodo.web.client.panels.vdb.VdbEditPanel.java

License:Apache License

private Widget createObjectPropertiesPanel() {
    Style objPropPanelStyle = objectPropertiesPanel.getElement().getStyle();

    /*/*from www.  j  ava2s .  co m*/
     * Want to position the properties panel so its always to the right
     * of the diagram panel, even when zoomed in. Float: left fails to
     * work at this point since zoom in enough and the properties
     * panel jumps down below.
     */

    /*
     * Set the position of the properties panel to absolute so that we
     * are now in charge of its location
     */
    objPropPanelStyle.setPosition(Position.ABSOLUTE);

    /*
     * Set its position as being on same level as diagram panel
     */
    objPropPanelStyle.setTop(0, Unit.EM);

    /*
     * Move it to the right of the diagram panel which is the
     * diagram panel width + border width + an extra 2 units
     * to account for the vertical scrollbar width
     */
    objPropPanelStyle.setLeft(DIAGRAM_PANEL_WIDTH + BORDER_WIDTH + 2, Unit.EM);

    /*
     * Set its width and height to appropriate values
     */
    objPropPanelStyle.setWidth((DIAGRAM_PANEL_WIDTH * 3) / 5, Unit.EM);
    objPropPanelStyle.setHeight(EDIT_PANEL_HEIGHT, Unit.EM);

    /*
     * Set its background colour to a subtle shade that just frames the panel
     */
    objPropPanelStyle.setBackgroundColor("#fAfAfA"); //$NON-NLS-1$

    /*
     * Set overflow to use scrollbars if required
     */
    objPropPanelStyle.setOverflow(Overflow.AUTO);

    /*
     * Add the title
     */
    Label propertyTitle = new Label("Property Editor"); //$NON-NLS-1$
    Style titleStyle = propertyTitle.getElement().getStyle();

    /*
     * Centre the title
     * Set its font size and make it bold
     * Set its height as this ensures a value we can know when
     * passing on the remaining content area to the sub panels, ie.
     * SUB_PANEL_HEIGHT = DIAGRAM_PANEL_HEIGHT
     *                                          - PROPERTY_TITLE_HEIGHT + (BORDER_WIDTH * 2)
     */
    titleStyle.setTextAlign(TextAlign.CENTER);
    titleStyle.setFontSize(1, Unit.EM);
    titleStyle.setFontWeight(FontWeight.BOLD);
    titleStyle.setLineHeight(PROPERTY_TITLE_HEIGHT, Unit.EM);
    titleStyle.setHeight(PROPERTY_TITLE_HEIGHT, Unit.EM);
    objectPropertiesPanel.add(propertyTitle);

    return objectPropertiesPanel;
}

From source file:org.opencms.gwt.client.ui.CmsPreviewDialog.java

License:Open Source License

/**
 * Initializes the preview content.<p>
 *
 * @param previewInfo the preview info//from  w  ww  .jav  a 2s  .com
 */
private void initContent(CmsPreviewInfo previewInfo) {

    setSitePath(previewInfo.getSitePath());
    HTML content = new HTML();
    Style style = content.getElement().getStyle();
    int height = DIALOG_HEIGHT;
    int width = DIALOG_WIDTH;
    if (previewInfo.hasPreviewContent()) {
        content.setHTML(previewInfo.getPreviewContent());
        style.setOverflow(Overflow.AUTO);
        // try to measure dimensions
        width = DIALOG_PREVIEW_CONTENT_WIDTH;
        style.setWidth(width, Unit.PX);
        RootPanel.get().add(content);
        height = content.getOffsetHeight();
    } else {
        content.setHTML(
                "<iframe src=\"" + previewInfo.getPreviewUrl() + "\" style=\"height:100%; width:100%;\" />");
    }
    if (previewInfo.hasDimensions()) {
        height = previewInfo.getHeight();
        width = previewInfo.getWidth();
    }
    // check if window is big enough for requested dimensions
    int availableHeight = Window.getClientHeight() - 200;
    if (height > availableHeight) {
        height = availableHeight;
    }
    int availableWidth = Window.getClientWidth() - 50;
    if (width > availableWidth) {
        width = availableWidth;
    }
    style.setHeight(height, Unit.PX);
    style.setWidth(width, Unit.PX);
    setWidth(width + 12);
    setMainContent(content);
}