/*
* Copyright 2000-2014 Vaadin Ltd.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* temporary float over other components like context menus etc. This is to deal
* stacking order correctly with VWindow objects.
* </p>
- *
+ *
* <h3>Shadow</h3>
* <p>
* The separate shadow element underneath the main overlay element is <strong>
* supports, add <code>-webkit-box-shadow</code> and the standard
* <code>box-shadow</code> properties.
* </p>
- *
+ *
* <p>
* For IE8, which doesn't support CSS box-shadow, you can use the proprietary
* DropShadow filter. It doesn't provide the exact same features as box-shadow,
* border or a pseudo-element underneath the overlay which mimics a shadow, or
* any combination of these.
* </p>
- *
+ *
* <p>
* Read more about the DropShadow filter from <a
* href="http://msdn.microsoft.com/en-us/library/ms532985(v=vs.85).aspx"
* Shadow element style. If an extending class wishes to use a different
* style of shadow, it can use setShadowStyle(String) to give the shadow
* element a new style name.
- *
+ *
* @deprecated See main JavaDoc for VOverlay
*/
@Deprecated
/**
* The shadow element for this overlay.
- *
+ *
* @deprecated See main JavaDoc for VOverlay
- *
+ *
*/
@Deprecated
private Element shadow;
/**
* The HTML snippet that is used to render the actual shadow. In consists of
* nine different DIV-elements with the following class names:
- *
+ *
* <pre>
* .v-shadow[-stylename]
* ----------------------------------------------
* | .bottom-left | .bottom | .bottom-right |
* ----------------------------------------------
* </pre>
- *
+ *
* See default theme 'shadow.css' for implementation example.
- *
+ *
* @deprecated See main JavaDoc for VOverlay
*/
@Deprecated
@Deprecated
public VOverlay(boolean autoHide, boolean modal, boolean showShadow) {
super(autoHide, modal);
- setShadowEnabled(showShadow);
+ setShadowEnabled(showShadow && useShadowDiv());
adjustZIndex();
}
/**
- * Method to controle whether DOM elements for shadow are added. With this
+ * Return true if a separate shadow div should be used. Since Vaadin 7.3,
+ * shadows are implemented with CSS box-shadow. Thus, a shadow div is only
+ * used for IE8 by default.
+ *
+ * @deprecated See main JavaDoc for VOverlay
+ * @since 7.3
+ * @return true to use a shadow div
+ */
+ @Deprecated
+ protected boolean useShadowDiv() {
+ return BrowserInfo.get().isIE8();
+ }
+
+ /**
+ * Method to control whether DOM elements for shadow are added. With this
* method subclasses can control displaying of shadow also after the
* constructor.
- *
+ *
* @param enabled
* true if shadow should be displayed
- *
+ *
* @deprecated See main JavaDoc for VOverlay
*/
@Deprecated
/**
* Set the z-index (visual stack position) for this overlay.
- *
+ *
* @param zIndex
* The new z-index
*/
* A "thread local" of sorts, set temporarily so that VOverlayImpl knows
* which VOverlay is using it, so that it can be attached to the correct
* overlay container.
- *
+ *
* TODO this is a strange pattern that we should get rid of when possible.
*/
protected static VOverlay current;
* Sets the shadow style for this overlay. Will override any previous style
* for the shadow. The default style name is defined by CLASSNAME_SHADOW.
* The given style will be prefixed with CLASSNAME_SHADOW.
- *
+ *
* @param style
* The new style name for the shadow element. Will be prefixed by
* CLASSNAME_SHADOW, e.g. style=='foobar' -> actual style
* name=='v-shadow-foobar'.
- *
+ *
* @deprecated See main JavaDoc for VOverlay
*/
@Deprecated
* Extending classes should always call this method after they change the
* size of overlay without using normal 'setWidth(String)' and
* 'setHeight(String)' methods (if not calling super.setWidth/Height).
- *
+ *
*/
public void positionOrSizeUpdated() {
positionOrSizeUpdated(1.0);
* elements. Can be used to animate the related elements, using the
* 'progress' parameter (used to animate the shadow in sync with GWT
* PopupPanel's default animation 'PopupPanel.AnimationType.CENTER').
- *
+ *
* @param progress
* A value between 0.0 and 1.0, indicating the progress of the
* animation (0=start, 1=end).
* Returns true if we should add a shim iframe below the overlay to deal
* with zindex issues with PDFs and applets. Can be overriden to disable
* shim iframes if they are not needed.
- *
+ *
* @return true if a shim iframe should be added, false otherwise
*/
protected boolean needsShimElement() {
/**
* Enables or disables sinking the events of the shadow to the same
* onBrowserEvent as events to the actual overlay goes.
- *
+ *
* Please note, that if you enable this, you can't assume that e.g.
* event.getEventTarget returns an element inside the DOM structure of the
* overlay
- *
+ *
* @param sinkShadowEvents
- *
+ *
* @deprecated See main JavaDoc for VOverlay
*/
@Deprecated
/**
* Get owner (Widget that made this VOverlay, not the layout parent) of
* VOverlay
- *
+ *
* @return Owner (creator) or null if not defined
*/
public Widget getOwner() {
/**
* Set owner (Widget that made this VOverlay, not the layout parent) of
* VOverlay
- *
+ *
* @param owner
* Owner (creator) of VOverlay
*/
/**
* Get the {@link ApplicationConnection} that this overlay belongs to. If
* it's not set, {@link #getOwner()} is used to figure it out.
- *
+ *
* @return
*/
protected ApplicationConnection getApplicationConnection() {
/**
* Gets the 'overlay container' element. Tries to find the current
* {@link ApplicationConnection} using {@link #getApplicationConnection()}.
- *
+ *
* @return the overlay container element for the current
* {@link ApplicationConnection} or another element if the current
* {@link ApplicationConnection} cannot be determined.
* {@link ApplicationConnection}. Each overlay should be created in a
* overlay container element, so that the correct theme and styles can be
* applied.
- *
+ *
* @param ac
* A reference to {@link ApplicationConnection}
* @return The overlay container
/**
* Set the label of the container element, where tooltip, notification and
* dialgs are added to.
- *
+ *
* @param applicationConnection
* the application connection for which to change the label
* @param overlayContainerLabel
/**
* Gets the visual viewport width, which is useful for e.g iOS where the
* view can be zoomed in while keeping the layout viewport intact.
- *
+ *
* Falls back to layout viewport; for those browsers/devices the difference
* is that the scrollbar with is included (if there is a scrollbar).
- *
+ *
* @since 7.0.7
* @return
*/
/**
* Gets the visual viewport height, which is useful for e.g iOS where the
* view can be zoomed in while keeping the layout viewport intact.
- *
+ *
* Falls back to layout viewport; for those browsers/devices the difference
* is that the scrollbar with is included (if there is a scrollbar).
- *
+ *
* @since 7.0.7
* @return
*/
/*
* (non-Javadoc)
- *
+ *
* @see com.google.gwt.user.client.ui.PopupPanel#hide()
*/
@Override
/*
* (non-Javadoc)
- *
+ *
* @see com.google.gwt.user.client.ui.PopupPanel#hide(boolean)
*/
@Override