.v-menubar-popup .popupContent:focus,
.v-menubar-popup .popupContent .v-menubar-submenu:focus{
outline: none;
--}
++}
++/* Checkboxes for checkable/checked menu items */
++/* Checked/unchecked requires combined style selected-(un)checked for IE6 */
++.v-menubar-submenu-check-column .v-menubar-menuitem {
++ padding-left: 6px;
++}
++.v-menubar-submenu-check-column .v-menubar-menuitem-caption {
++ padding-left: 18px;
++}
++.v-menubar-submenu .v-menubar-menuitem-checked .v-menubar-menuitem-caption {
++ background: transparent url(img/check.gif) no-repeat left;
++}
}
.v-menubar-submenu .v-menubar-menuitem-selected .v-menubar-submenu-indicator {
background-image: url(img/submenu-icon-hover.png);
--}
++}
++
++/* Checkboxes for checkable/checked menu items */
++.v-menubar-submenu-check-column .v-menubar-menuitem {
++ padding-left: 6px;
++}
++.v-menubar-submenu-check-column .v-menubar-menuitem-caption {
++ padding-left: 18px;
++}
++.v-menubar-submenu .v-menubar-menuitem-checked .v-menubar-menuitem-caption {
++ background: transparent url(img/checked.png) no-repeat left;
++}
++.v-menubar-submenu .v-menubar-menuitem-unchecked .v-menubar-menuitem-caption {
++ background: transparent url(img/unchecked.png) no-repeat left;
++}
++.v-menubar-submenu .v-menubar-menuitem-selected-checked .v-menubar-menuitem-caption {
++ background: transparent url(img/checked-selected.png) no-repeat left;
++}
++.v-menubar-submenu .v-menubar-menuitem-selected-unchecked .v-menubar-menuitem-caption {
++ background: transparent url(img/unchecked-selected.png) no-repeat left;
++}
border: none;
height: 20px;
margin: 0;
-- padding: 3px 0 0 2px;
++ padding: 2px 0 1px 2px;
font-size: 13px;
}
.v-filterselect-prompt .v-filterselect-input {
<include name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
<include name="VAADIN/themes/base/**/*" />
<include name="VAADIN/themes/default/**/*" />
++ <include name="VAADIN/themes/liferay/**/*" />
<include name="VAADIN/themes/runo/**/*" />
<include name="VAADIN/themes/reindeer/**/*" />
</patternset>
if (filteredChildren != null) {
filteredChildren = null;
}
++ if (filteredParent != null) {
++ filteredParent = null;
++ }
}
enableAndFireContentsChangeEvents();
return success;
if (c != null) {
c.remove(itemId);
++ if (c.isEmpty()) {
++ children.remove(parentItemId);
++ }
++
// Found in the children list so might also be in the
// filteredChildren list
if (filteredChildren != null) {
LinkedList<Object> f = filteredChildren
.get(parentItemId);
if (f != null) {
-- f.remove(parentItemId);
++ f.remove(itemId);
++ if (f.isEmpty()) {
++ filteredChildren.remove(parentItemId);
++ }
}
}
}
}
parent.remove(itemId);
++ if (filteredParent != null) {
++ // Item id no longer has a parent as the item id is not in the
++ // container.
++ filteredParent.remove(itemId);
++ }
noChildrenAllowed.remove(itemId);
}
// All filters removed
filteredRoots = null;
filteredChildren = null;
++ filteredParent = null;
return super.doFilterContainer(hasFilters);
}
// values currently only via transaction listener.
String parameters = "repaintAll=1&" + "sh=" + screenHeight + "&sw="
+ screenWidth + "&cw=" + clientWidth + "&ch=" + clientHeight
- + "&vw=" + offsetWidth + "&vh=" + offsetHeight + "&fr=" + token;
+ + "&vw=" + offsetWidth + "&vh=" + offsetHeight + "&fr=" + token
+ + "&tzo=" + tzOffset + "&rtzo=" + rtzOffset + "&dstd="
+ + dstDiff + "&dston=" + dstInEffect + "&curdate=" + curDate
- + "&wsver=" + widgetsetVersion;
++ + "&wsver=" + widgetsetVersion
++ + (BrowserInfo.get().isTouchDevice() ? "&td=1" : "");
return parameters;
}
import java.util.List;
import java.util.Stack;
++import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.NodeList;
// associated
protected static final Command emptyCommand = null;
+ public static final String OPEN_ROOT_MENU_ON_HOWER = "ormoh";
+
++ public static final String ATTRIBUTE_CHECKED = "checked";
++
/** Widget fields **/
protected boolean subMenu;
protected ArrayList<CustomMenuItem> items;
}
itemHTML.append(moreItemText);
-- moreItem = new CustomMenuItem(itemHTML.toString(), emptyCommand);
- collapsedRootItems = new VMenuBar(true, (VMenuBar) client
- .getPaintable(uidlId));
++ moreItem = GWT.create(CustomMenuItem.class);
++ moreItem.setHTML(itemHTML.toString());
++ moreItem.setCommand(emptyCommand);
++
+ collapsedRootItems = new VMenuBar(true,
+ (VMenuBar) client.getPaintable(uidlId));
moreItem.setSubMenu(collapsedRootItems);
moreItem.addStyleName(CLASSNAME + "-more-menuitem");
}
UIDL item = (UIDL) itr.next();
CustomMenuItem currentItem = null;
-- String itemText = item.getStringAttribute("text");
final int itemId = item.getIntAttribute("id");
boolean itemHasCommand = item.hasAttribute("command");
++ boolean itemIsCheckable = item.hasAttribute(ATTRIBUTE_CHECKED);
-- // Construct html from the text and the optional icon
-- StringBuffer itemHTML = new StringBuffer();
-- Command cmd = null;
--
-- if (item.hasAttribute("separator")) {
-- itemHTML.append("<span>---</span>");
-- } else {
-- // Add submenu indicator
-- if (item.getChildCount() > 0) {
-- // FIXME For compatibility reasons: remove in version 7
-- String bgStyle = "";
-- if (submenuIcon != null) {
-- bgStyle = " style=\"background-image: url("
-- + submenuIcon
-- + "); text-indent: -999px; width: 1em;\"";
-- }
-- itemHTML.append("<span class=\"" + CLASSNAME
-- + "-submenu-indicator\"" + bgStyle
-- + ">►</span>");
-- }
--
-- itemHTML.append("<span class=\"" + CLASSNAME
-- + "-menuitem-caption\">");
-- if (item.hasAttribute("icon")) {
- itemHTML
- .append("<img src=\""
- + client.translateVaadinUri(item
- .getStringAttribute("icon"))
- + "\" class=\"" + Icon.CLASSNAME
- + "\" alt=\"\" />");
- itemHTML.append("<img src=\""
- + client.translateVaadinUri(item
- .getStringAttribute("icon"))
- + "\" class=\"" + Icon.CLASSNAME + "\" alt=\"\" />");
-- }
-- itemHTML.append(Util.escapeHTML(itemText) + "</span>");
++ String itemHTML = buildItemHTML(item);
-- if (itemHasCommand) {
++ Command cmd = null;
++ if (!item.hasAttribute("separator")) {
++ if (itemHasCommand || itemIsCheckable) {
// Construct a command that fires onMenuClick(int) with the
// item's id-number
cmd = new Command() {
}
while (!itr.hasNext() && !iteratorStack.empty()) {
++ boolean hasCheckableItem = false;
++ for (CustomMenuItem menuItem : currentMenu.getItems()) {
++ hasCheckableItem = hasCheckableItem
++ || menuItem.isCheckable();
++ }
++ if (hasCheckableItem) {
++ currentMenu.addStyleDependentName("check-column");
++ } else {
++ currentMenu.removeStyleDependentName("check-column");
++ }
++
itr = iteratorStack.pop();
currentMenu = menuStack.pop();
}
}// updateFromUIDL
++ /**
++ * Build the HTML content for a menu item.
++ *
++ * @param item
++ * @return
++ */
++ protected String buildItemHTML(UIDL item) {
++ // Construct html from the text and the optional icon
++ StringBuffer itemHTML = new StringBuffer();
++ if (item.hasAttribute("separator")) {
++ itemHTML.append("<span>---</span>");
++ } else {
++ // Add submenu indicator
++ if (item.getChildCount() > 0) {
++ // FIXME For compatibility reasons: remove in version 7
++ String bgStyle = "";
++ if (submenuIcon != null) {
++ bgStyle = " style=\"background-image: url(" + submenuIcon
++ + "); text-indent: -999px; width: 1em;\"";
++ }
++ itemHTML.append("<span class=\"" + CLASSNAME
++ + "-submenu-indicator\"" + bgStyle + ">►</span>");
++ }
++
++ itemHTML.append("<span class=\"" + CLASSNAME
++ + "-menuitem-caption\">");
++ if (item.hasAttribute("icon")) {
++ itemHTML.append("<img src=\""
++ + client.translateVaadinUri(item
++ .getStringAttribute("icon")) + "\" class=\""
++ + Icon.CLASSNAME + "\" alt=\"\" />");
++ }
++ String itemText = item.getStringAttribute("text");
++ itemHTML.append(Util.escapeHTML(itemText));
++ itemHTML.append("</span>");
++ }
++ return itemHTML.toString();
++ }
++
/**
* This is called by the items in the menu and it communicates the
* information to the server
* @return the item created
*/
public CustomMenuItem addItem(String html, Command cmd) {
-- CustomMenuItem item = new CustomMenuItem(html, cmd);
++ CustomMenuItem item = GWT.create(CustomMenuItem.class);
++ item.setHTML(html);
++ item.setCommand(cmd);
++
addItem(item);
return item;
}
protected VMenuBar parentMenu = null;
protected boolean enabled = true;
protected boolean isSeparator = false;
++ protected boolean checkable = false;
++ protected boolean checked = false;
++
++ /**
++ * Default menu item {@link Widget} constructor for GWT.create().
++ *
++ * Use {@link #setHTML(String)} and {@link #setCommand(Command)} after
++ * constructing a menu item.
++ */
++ public CustomMenuItem() {
++ this("", null);
++ }
++ /**
++ * Creates a menu item {@link Widget}.
++ *
++ * @param html
++ * @param cmd
++ * @deprecated use the default constructor and {@link #setHTML(String)}
++ * and {@link #setCommand(Command)} instead
++ */
++ @Deprecated
public CustomMenuItem(String html, Command cmd) {
// We need spans to allow inline-block in IE
setElement(DOM.createSpan());
setStyleName(CLASSNAME + "-menuitem");
sinkEvents(VTooltip.TOOLTIP_EVENTS);
--
-- // Sink the onload event for any icons. The onload
-- // events are handled by the parent VMenuBar.
-- Util.sinkOnloadForImages(getElement());
}
public void setSelected(boolean selected) {
if (selected && !isSeparator) {
addStyleDependentName("selected");
++ // needed for IE6 to have a single style name to match for an
++ // element
++ if (checkable) {
++ if (checked) {
++ removeStyleDependentName("selected-unchecked");
++ addStyleDependentName("selected-checked");
++ } else {
++ removeStyleDependentName("selected-checked");
++ addStyleDependentName("selected-unchecked");
++ }
++ }
} else {
removeStyleDependentName("selected");
++ // needed for IE6 to have a single style name to match for an
++ // element
++ removeStyleDependentName("selected-checked");
++ removeStyleDependentName("selected-unchecked");
+ }
+ }
+
++ public void setChecked(boolean checked) {
++ if (checkable && !isSeparator) {
++ this.checked = checked;
++
++ if (checked) {
++ addStyleDependentName("checked");
++ removeStyleDependentName("unchecked");
++ } else {
++ addStyleDependentName("unchecked");
++ removeStyleDependentName("checked");
++ }
++ } else {
++ this.checked = false;
++ }
++ }
++
++ public boolean isChecked() {
++ return checked;
++ }
++
++ public void setCheckable(boolean checkable) {
++ if (checkable && !isSeparator) {
++ this.checkable = true;
++ } else {
++ setChecked(false);
++ this.checkable = false;
+ }
+ }
+
++ public boolean isCheckable() {
++ return checkable;
++ }
++
/*
* setters and getters for the fields
*/
public void setHTML(String html) {
this.html = html;
DOM.setInnerHTML(getElement(), html);
++
++ // Sink the onload event for any icons. The onload
++ // events are handled by the parent VMenuBar.
++ Util.sinkOnloadForImages(getElement());
}
public String getText() {
setSeparator(uidl.hasAttribute("separator"));
setEnabled(!uidl.hasAttribute("disabled"));
++ if (!isSeparator() && uidl.hasAttribute(ATTRIBUTE_CHECKED)) {
++ // if the selected attribute is present (either true or false),
++ // the item is selectable
++ setCheckable(true);
++ setChecked(uidl.getBooleanAttribute(ATTRIBUTE_CHECKED));
++ } else {
++ setCheckable(false);
++ }
++
if (uidl.hasAttribute("style")) {
String itemStyle = uidl.getStringAttribute("style");
addStyleDependentName(itemStyle);
* .dom.client.FocusEvent)
*/
public void onFocus(FocusEvent event) {
- // Focus the first element directly, so the keyboard focus becomes
- // visible
- setSelected(items.get(0));
++
}
private final String SUBPART_PREFIX = "item";
* temporary float over other components like context menus etc. This is to deal
* stacking order correctly with VWindow objects.
*/
--public class VOverlay extends PopupPanel {
++public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> {
/*
* The z-index value from where all overlays live. This can be overridden in
public VOverlay(boolean autoHide, boolean modal, boolean showShadow) {
super(autoHide, modal);
-- if (showShadow) {
-- shadow = DOM.createDiv();
-- shadow.setClassName(CLASSNAME_SHADOW);
-- shadow.setInnerHTML(SHADOW_HTML);
-- DOM.setStyleAttribute(shadow, "position", "absolute");
--
-- addCloseHandler(new CloseHandler<PopupPanel>() {
-- public void onClose(CloseEvent<PopupPanel> event) {
-- if (shadow.getParentElement() != null) {
-- shadow.getParentElement().removeChild(shadow);
-- }
-- }
-- });
-- }
++ setShadowEnabled(showShadow);
adjustZIndex();
}
++ /**
++ * Method to controle 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
++ */
++ protected void setShadowEnabled(boolean enabled) {
++ if (enabled != isShadowEnabled()) {
++ if (enabled) {
++ shadow = DOM.createDiv();
++ shadow.setClassName(CLASSNAME_SHADOW);
++ shadow.setInnerHTML(SHADOW_HTML);
++ DOM.setStyleAttribute(shadow, "position", "absolute");
++ addCloseHandler(this);
++ } else {
++ removeShadowIfPresent();
++ shadow = null;
++ }
++ }
++ }
++
++ protected boolean isShadowEnabled() {
++ return shadow != null;
++ }
++
++ private void removeShadowIfPresent() {
++ if (isShadowEnabled() && shadow.getParentElement() != null) {
++ shadow.getParentElement().removeChild(shadow);
++ }
++ }
++
private void adjustZIndex() {
setZIndex(Z_INDEX);
}
*/
protected void setZIndex(int zIndex) {
DOM.setStyleAttribute(getElement(), "zIndex", "" + zIndex);
-- if (shadow != null) {
++ if (isShadowEnabled()) {
DOM.setStyleAttribute(shadow, "zIndex", "" + zIndex);
}
}
@Override
public void setPopupPosition(int left, int top) {
+ // TODO, this should in fact be part of
+ // Document.get().getBodyOffsetLeft/Top(). Would require overriding DOM
+ // for all permutations. Now adding fix as margin instead of fixing
+ // left/top because parent class saves the position.
+ Style style = getElement().getStyle();
+ style.setMarginLeft(-adjustByRelativeLeftBodyMargin(), Unit.PX);
+ style.setMarginTop(-adjustByRelativeTopBodyMargin(), Unit.PX);
super.setPopupPosition(left, top);
-- if (shadow != null) {
-- updateShadowSizeAndPosition(isAnimationEnabled() ? 0 : 1);
- }
++ updateShadowSizeAndPosition(isAnimationEnabled() ? 0 : 1);
+ }
+
+ private static int adjustByRelativeTopBodyMargin() {
+ if (topFix == -1) {
- topFix = detectRelativeBodyFixes("top");
++ boolean ie6OrIe7 = BrowserInfo.get().isIE()
++ && BrowserInfo.get().getIEVersion() <= 7;
++ topFix = detectRelativeBodyFixes("top", ie6OrIe7);
}
- private native static int detectRelativeBodyFixes(String axis)
+ return topFix;
+ }
+
- return b.getBoundingClientRect()[axis];
++ private native static int detectRelativeBodyFixes(String axis,
++ boolean removeClientLeftOrTop)
+ /*-{
+ try {
+ var b = $wnd.document.body;
+ var cstyle = b.currentStyle ? b.currentStyle : getComputedStyle(b);
+ if(cstyle && cstyle.position == 'relative') {
- leftFix = detectRelativeBodyFixes("left");
++ var offset = b.getBoundingClientRect()[axis];
++ if (removeClientLeftOrTop) {
++ // IE6 and IE7 include the top left border of the client area into the boundingClientRect
++ var clientTopOrLeft = 0;
++ if (axis == "top")
++ clientTopOrLeft = $wnd.document.documentElement.clientTop;
++ else
++ clientTopOrLeft = $wnd.document.documentElement.clientLeft;
++
++ offset -= clientTopOrLeft;
++ }
++ return offset;
+ }
+ } catch(e){}
+ return 0;
+ }-*/;
+
+ private static int adjustByRelativeLeftBodyMargin() {
+ if (leftFix == -1) {
++ boolean ie6OrIe7 = BrowserInfo.get().isIE()
++ && BrowserInfo.get().getIEVersion() <= 7;
++ leftFix = detectRelativeBodyFixes("left", ie6OrIe7);
++
+ }
+ return leftFix;
}
@Override
public void show() {
super.show();
-- if (shadow != null) {
++ if (isShadowEnabled()) {
if (isAnimationEnabled()) {
ShadowAnimation sa = new ShadowAnimation();
sa.run(200);
Util.runIE7ZeroSizedBodyFix();
}
++ @Override
++ protected void onDetach() {
++ super.onDetach();
++
++ // Always ensure shadow is removed when the overlay is removed.
++ removeShadowIfPresent();
++ }
++
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
-- if (shadow != null) {
++ if (isShadowEnabled()) {
shadow.getStyle().setProperty("visibility",
visible ? "visible" : "hidden");
}
@Override
public void setWidth(String width) {
super.setWidth(width);
-- if (shadow != null) {
-- updateShadowSizeAndPosition(1.0);
-- }
++ updateShadowSizeAndPosition(1.0);
}
@Override
public void setHeight(String height) {
super.setHeight(height);
-- if (shadow != null) {
-- updateShadowSizeAndPosition(1.0);
-- }
++ updateShadowSizeAndPosition(1.0);
}
/**
* name=='v-shadow-foobar'.
*/
protected void setShadowStyle(String style) {
-- if (shadow != null) {
++ if (isShadowEnabled()) {
shadow.setClassName(CLASSNAME_SHADOW + "-" + style);
}
}
*/
private void updateShadowSizeAndPosition(final double progress) {
// Don't do anything if overlay element is not attached
-- if (!isAttached()) {
++ if (!isAttached() || shadow == null) {
return;
}
// Calculate proper z-index
protected class ShadowAnimation extends Animation {
@Override
protected void onUpdate(double progress) {
-- if (shadow != null) {
-- updateShadowSizeAndPosition(progress);
-- }
++ updateShadowSizeAndPosition(progress);
}
}
++
++ public void onClose(CloseEvent<PopupPanel> event) {
++ removeShadowIfPresent();
++ }
}
tabIndex = uidl.hasAttribute("tabindex") ? uidl
.getIntAttribute("tabindex") : 0;
- multiselectmode = uidl.hasAttribute("multiselectmode") ? uidl
- .getIntAttribute("multiselectmode") : MULTISELECT_MODE_DEFAULT;
+ if (!BrowserInfo.get().isTouchDevice()) {
+ multiselectmode = uidl.hasAttribute("multiselectmode") ? uidl
+ .getIntAttribute("multiselectmode")
+ : MULTISELECT_MODE_DEFAULT;
+ }
+
+ if (uidl.hasAttribute("alb")) {
+ bodyActionKeys = uidl.getStringArrayAttribute("alb");
++ } else {
++ // Need to clear the actions if the action handlers have been
++ // removed
++ bodyActionKeys = null;
+ }
setCacheRate(uidl.hasAttribute("cr") ? uidl.getDoubleAttribute("cr")
: CACHE_RATE_DEFAULT);
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
++import com.google.gwt.event.dom.client.KeyCodes;
++import com.google.gwt.event.dom.client.KeyDownEvent;
++import com.google.gwt.event.dom.client.KeyDownHandler;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
*
*/
public class VTextField extends TextBoxBase implements Paintable, Field,
-- ChangeHandler, FocusHandler, BlurHandler, BeforeShortcutActionListener {
++ ChangeHandler, FocusHandler, BlurHandler, BeforeShortcutActionListener,
++ KeyDownHandler {
public static final String VAR_CUR_TEXT = "curText";
/**
}
setStyleName(CLASSNAME);
addChangeHandler(this);
++ if (BrowserInfo.get().isIE()) {
++ // IE does not send change events when pressing enter in a text
++ // input so we handle it using a key listener instead
++ addKeyDownHandler(this);
++ }
addFocusHandler(this);
addBlurHandler(this);
sinkEvents(VTooltip.TOOLTIP_EVENTS);
}
wordwrap = enabled;
}
++
++ public void onKeyDown(KeyDownEvent event) {
++ if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
++ valueChange(false);
++ }
++ }
}
import java.util.Set;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
+ import com.google.gwt.event.dom.client.DomEvent.Type;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyDownEvent;
if (uidl.getBooleanAttribute("resizable") != resizable) {
setResizable(!resizable);
}
+ resizeLazy = uidl.hasAttribute(VView.RESIZE_LAZY);
setDraggable(!uidl.hasAttribute("fixedposition"));
- }
+
- if (uidl.hasAttribute("caption")) {
- setCaption(uidl.getStringAttribute("caption"), uidl
- .getStringAttribute("icon"));
++ // Caption must be set before required header size is measured. If
++ // the caption attribute is missing the caption should be cleared.
++ setCaption(uidl.getStringAttribute("caption"),
++ uidl.getStringAttribute("icon"));
}
visibilityChangesDisabled = true;
private void showModalityCurtain() {
if (BrowserInfo.get().isFF2()) {
- DOM.setStyleAttribute(getModalityCurtain(), "height", DOM
- .getElementPropertyInt(RootPanel.getBodyElement(),
- "offsetHeight")
- + "px");
+ DOM.setStyleAttribute(
- modalityCurtain,
++ getModalityCurtain(),
+ "height",
+ DOM.getElementPropertyInt(RootPanel.getBodyElement(),
+ "offsetHeight") + "px");
- DOM.setStyleAttribute(modalityCurtain, "position", "absolute");
+ DOM.setStyleAttribute(getModalityCurtain(), "position", "absolute");
}
- DOM.setStyleAttribute(getModalityCurtain(), "zIndex", ""
- + (windowOrder.indexOf(this) + Z_INDEX));
- DOM.setStyleAttribute(modalityCurtain, "zIndex",
++ DOM.setStyleAttribute(getModalityCurtain(), "zIndex",
+ "" + (windowOrder.indexOf(this) + Z_INDEX));
if (isShowing()) {
- RootPanel.getBodyElement().insertBefore(modalityCurtain,
+ RootPanel.getBodyElement().insertBefore(getModalityCurtain(),
getElement());
} else {
- DOM.appendChild(RootPanel.getBodyElement(), modalityCurtain);
+ DOM.appendChild(RootPanel.getBodyElement(), getModalityCurtain());
}
}
private void updateBrowserProperties(WebBrowser browser,
PortletRequest request) {
String userAgent = getHTTPHeader(request, "user-agent");
-- browser.updateBrowserProperties(request.getLocale(), null,
-- request.isSecure(), userAgent,
-- getHTTPRequestParameter(request, "sw"),
- getHTTPRequestParameter(request, "sh"),
- getHTTPRequestParameter(request, "tzo"),
- getHTTPRequestParameter(request, "rtzo"),
- getHTTPRequestParameter(request, "dstd"),
- getHTTPRequestParameter(request, "dstActive"),
- getHTTPRequestParameter(request, "curdate"));
- getHTTPRequestParameter(request, "sh"));
++ browser.updateRequestDetails(request.getLocale(), null,
++ request.isSecure(), userAgent);
++ if (getHTTPRequestParameter(request, "repaintAll") != null) {
++ browser.updateClientSideDetails(
++ getHTTPRequestParameter(request, "sw"),
++ getHTTPRequestParameter(request, "sh"),
++ getHTTPRequestParameter(request, "tzo"),
++ getHTTPRequestParameter(request, "rtzo"),
++ getHTTPRequestParameter(request, "dstd"),
++ getHTTPRequestParameter(request, "dstActive"),
++ getHTTPRequestParameter(request, "curdate"),
++ getHTTPRequestParameter(request, "td") != null);
++ }
}
@Override
private void updateBrowserProperties(WebBrowser browser,
HttpServletRequest request) {
-- browser.updateBrowserProperties(request.getLocale(),
++ // request based details updated always
++ browser.updateRequestDetails(request.getLocale(),
request.getRemoteAddr(), request.isSecure(),
-- request.getHeader("user-agent"), request.getParameter("sw"),
- request.getParameter("sh"), request.getParameter("tzo"),
- request.getParameter("rtzo"), request.getParameter("dstd"),
- request.getParameter("dston"), request.getParameter("curdate"));
- request.getParameter("sh"));
++ request.getHeader("user-agent"));
++ if (request.getParameter("repaintAll") != null) {
++ browser.updateClientSideDetails(request.getParameter("sw"),
++ request.getParameter("sh"), request.getParameter("tzo"),
++ request.getParameter("rtzo"), request.getParameter("dstd"),
++ request.getParameter("dston"),
++ request.getParameter("curdate"),
++ request.getParameter("td") != null);
++ }
}
protected ClassLoader getClassLoader() throws ServletException {
int contentLength = request.getContentLength();
boolean atStart = false;
++ boolean firstFileFieldFound = false;
String rawfilename = "unknown";
String rawMimeType = "application/octet-stream";
rawfilename = rawfilename.substring(1);
rawfilename = rawfilename.substring(0,
rawfilename.indexOf(parenthesis));
-- } else if (readLine.equals("")) {
++ firstFileFieldFound = true;
++ } else if (firstFileFieldFound && readLine.equals("")) {
atStart = true;
} else if (readLine.startsWith("Content-Type")) {
rawMimeType = readLine.split(": ")[1];
private Locale locale;
private String address;
private boolean secureConnection;
- private Date currentDate;
+ private int timezoneOffset = 0;
+ private int rawTimezoneOffset = 0;
+ private int dstSavings;
+ private boolean dstInEffect;
++ private boolean touchDevice;
private VBrowserDetails browserDetails;
++ private long clientServerTimeDelta;
/**
* There is no default-theme for this terminal type.
return browserApplication;
}
-- /**
-- * For internal use by AbstractApplicationServlet/AbstractApplicationPortlet
-- * only. Updates all properties in the class according to the given
-- * information.
-- *
-- * @param locale
-- * The browser primary locale
-- * @param address
-- * The browser ip address
-- * @param secureConnection
-- * true if using an https connection
-- * @param agent
-- * Raw userAgent string from the browser
-- * @param sw
-- * Screen width
-- * @param sh
-- * Screen height
- * @param tzo
- * TimeZone offset in minutes from GMT
- * @param rtzo
- * raw TimeZone offset in minutes from GMT (w/o DST adjustment)
- * @param dstSavings
- * the difference between the raw TimeZone and DST in minutes
- * @param dstInEffect
- * is DST currently active in the region or not?
- * @param curDate
- * the current date in milliseconds since the epoch
-- */
-- void updateBrowserProperties(Locale locale, String address,
- boolean secureConnection, String agent, String sw, String sh,
- String tzo, String rtzo, String dstSavings, String dstInEffect,
- String curDate) {
- boolean secureConnection, String agent, String sw, String sh) {
-- this.locale = locale;
-- this.address = address;
-- this.secureConnection = secureConnection;
-- if (agent != null) {
-- browserApplication = agent;
-- browserDetails = new VBrowserDetails(agent);
-- }
--
-- if (sw != null) {
-- try {
-- screenHeight = Integer.parseInt(sh);
-- screenWidth = Integer.parseInt(sw);
-- } catch (final NumberFormatException e) {
-- screenHeight = screenWidth = 0;
- }
- }
- if (tzo != null) {
- try {
- // browser->java conversion: min->ms, reverse sign
- timezoneOffset = -Integer.parseInt(tzo) * 60 * 1000;
- } catch (final NumberFormatException e) {
- timezoneOffset = 0; // default gmt+0
- }
- }
- if (rtzo != null) {
- try {
- // browser->java conversion: min->ms, reverse sign
- rawTimezoneOffset = -Integer.parseInt(rtzo) * 60 * 1000;
- } catch (final NumberFormatException e) {
- rawTimezoneOffset = 0; // default gmt+0
- }
- }
- if (dstSavings != null) {
- try {
- // browser->java conversion: min->ms
- this.dstSavings = Integer.parseInt(dstSavings) * 60 * 1000;
- } catch (final NumberFormatException e) {
- this.dstSavings = 0; // default no savings
- }
- }
- if (dstInEffect != null) {
- this.dstInEffect = Boolean.parseBoolean(dstInEffect);
- }
- if (curDate != null) {
- try {
- long curTime = Long.parseLong(curDate);
- currentDate = new Date(curTime);
- } catch (final NumberFormatException e) {
- currentDate = new Date();
-- }
-- }
-- }
--
/**
* Gets the IP-address of the web browser. If the application is running
* inside a portlet, this method will return null.
return browserDetails.isWindows();
}
- * close-enough value for most cases.
+ /**
+ * Returns the browser-reported TimeZone offset in milliseconds from GMT.
+ * This includes possible daylight saving adjustments, to figure out which
+ * TimeZone the user actually might be in, see
+ * {@link #getRawTimezoneOffset()}.
+ *
+ * @see WebBrowser#getRawTimezoneOffset()
+ * @return timezone offset in milliseconds, 0 if not available
+ */
+ public Integer getTimezoneOffset() {
+ return timezoneOffset;
+ }
+
+ /**
+ * Returns the browser-reported TimeZone offset in milliseconds from GMT
+ * ignoring possible daylight saving adjustments that may be in effect in
+ * the browser.
+ * <p>
+ * You can use this to figure out which TimeZones the user could actually be
+ * in by calling {@link TimeZone#getAvailableIDs(int)}.
+ * </p>
+ * <p>
+ * If {@link #getRawTimezoneOffset()} and {@link #getTimezoneOffset()}
+ * returns the same value, the browser is either in a zone that does not
+ * currently have daylight saving time, or in a zone that never has daylight
+ * saving time.
+ * </p>
+ *
+ * @return timezone offset in milliseconds excluding DST, 0 if not available
+ */
+ public Integer getRawTimezoneOffset() {
+ return rawTimezoneOffset;
+ }
+
+ /**
+ * Gets the difference in minutes between the browser's GMT TimeZone and
+ * DST.
+ *
+ * @return the amount of minutes that the TimeZone shifts when DST is in
+ * effect
+ */
+ public int getDSTSavings() {
+ return dstSavings;
+ }
+
+ /**
+ * Determines whether daylight savings time (DST) is currently in effect in
+ * the region of the browser or not.
+ *
+ * @return true if the browser resides at a location that currently is in
+ * DST
+ */
+ public boolean isDSTInEffect() {
+ return dstInEffect;
+ }
+
+ /**
+ * Returns the current date and time of the browser. This will not be
+ * entirely accurate due to varying network latencies, but should provide a
- return currentDate;
++ * close-enough value for most cases. Also note that the returned Date
++ * object uses servers default time zone, not the clients.
+ *
+ * @return the current date and time of the browser.
++ * @see #isDSTInEffect()
++ * @see #getDSTSavings()
++ * @see #getTimezoneOffset()
+ */
+ public Date getCurrentDate() {
++ return new Date(new Date().getTime() + clientServerTimeDelta);
++ }
++
++ /**
++ * @return true if the browser is detected to support touch events
++ */
++ public boolean isTouchDevice() {
++ return touchDevice;
++ }
++
++ /**
++ * For internal use by AbstractApplicationServlet/AbstractApplicationPortlet
++ * only. Updates all properties in the class according to the given
++ * information.
++ *
++ * @param sw
++ * Screen width
++ * @param sh
++ * Screen height
++ * @param tzo
++ * TimeZone offset in minutes from GMT
++ * @param rtzo
++ * raw TimeZone offset in minutes from GMT (w/o DST adjustment)
++ * @param dstSavings
++ * the difference between the raw TimeZone and DST in minutes
++ * @param dstInEffect
++ * is DST currently active in the region or not?
++ * @param curDate
++ * the current date in milliseconds since the epoch
++ * @param touchDevice
++ */
++ void updateClientSideDetails(String sw, String sh, String tzo, String rtzo,
++ String dstSavings, String dstInEffect, String curDate,
++ boolean touchDevice) {
++ if (sw != null) {
++ try {
++ screenHeight = Integer.parseInt(sh);
++ screenWidth = Integer.parseInt(sw);
++ } catch (final NumberFormatException e) {
++ screenHeight = screenWidth = 0;
++ }
++ }
++ if (tzo != null) {
++ try {
++ // browser->java conversion: min->ms, reverse sign
++ timezoneOffset = -Integer.parseInt(tzo) * 60 * 1000;
++ } catch (final NumberFormatException e) {
++ timezoneOffset = 0; // default gmt+0
++ }
++ }
++ if (rtzo != null) {
++ try {
++ // browser->java conversion: min->ms, reverse sign
++ rawTimezoneOffset = -Integer.parseInt(rtzo) * 60 * 1000;
++ } catch (final NumberFormatException e) {
++ rawTimezoneOffset = 0; // default gmt+0
++ }
++ }
++ if (dstSavings != null) {
++ try {
++ // browser->java conversion: min->ms
++ this.dstSavings = Integer.parseInt(dstSavings) * 60 * 1000;
++ } catch (final NumberFormatException e) {
++ this.dstSavings = 0; // default no savings
++ }
++ }
++ if (dstInEffect != null) {
++ this.dstInEffect = Boolean.parseBoolean(dstInEffect);
++ }
++ if (curDate != null) {
++ try {
++ long curTime = Long.parseLong(curDate);
++ clientServerTimeDelta = curTime - new Date().getTime();
++ } catch (final NumberFormatException e) {
++ clientServerTimeDelta = 0;
++ }
++ }
++ this.touchDevice = touchDevice;
++
++ }
++
++ /**
++ * For internal use by AbstractApplicationServlet/AbstractApplicationPortlet
++ * only. Updates all properties in the class according to the given
++ * information.
++ *
++ * @param locale
++ * The browser primary locale
++ * @param address
++ * The browser ip address
++ * @param secureConnection
++ * true if using an https connection
++ * @param agent
++ * Raw userAgent string from the browser
++ */
++ void updateRequestDetails(Locale locale, String address,
++ boolean secureConnection, String agent) {
++ this.locale = locale;
++ this.address = address;
++ this.secureConnection = secureConnection;
++ if (agent != null) {
++ browserApplication = agent;
++ browserDetails = new VBrowserDetails(agent);
++ }
++
+ }
+
}
private static final String CLICK_EVENT = EventId.LAYOUT_CLICK;
-- private static final Alignment ALIGNMENT_DEFAULT = Alignment.TOP_LEFT;
++ public static final Alignment ALIGNMENT_DEFAULT = Alignment.TOP_LEFT;
/**
* Custom layout slots containing the components.
if (newValue != null && !newValue.equals(oldValue)
&& !isReadOnly()) {
setValue(newValue);
- fireClick(MouseEventDetails.deSerialize((String) variables
- .get("mousedetails")));
- fireClick();
++ if (variables.containsKey("mousedetails")) {
++ fireClick(MouseEventDetails
++ .deSerialize((String) variables
++ .get("mousedetails")));
++ } else {
++ // for compatibility with custom implementations which
++ // don't send mouse details
++ fireClick();
++ }
}
} else {
// Only send click event if the button is pushed
if (newValue.booleanValue()) {
- fireClick(MouseEventDetails.deSerialize((String) variables
- .get("mousedetails")));
- fireClick();
++ if (variables.containsKey("mousedetails")) {
++ fireClick(MouseEventDetails
++ .deSerialize((String) variables
++ .get("mousedetails")));
++ } else {
++ // for compatibility with custom implementations which
++ // don't send mouse details
++ fireClick();
++ }
}
// If the button is true for some reason, release it
*/
public class ClickEvent extends Component.Event {
- private MouseEventDetails details;
++ private final MouseEventDetails details;
+
/**
* New instance of text change event.
*
*/
public ClickEvent(Component source) {
super(source);
++ details = null;
+ }
+
+ /**
+ * Constructor with mouse details
+ *
+ * @param source
+ * The source where the click took place
+ * @param details
+ * Details about the mouse click
+ */
+ public ClickEvent(Component source, MouseEventDetails details) {
+ super(source);
+ this.details = details;
}
/**
public Button getButton() {
return (Button) getSource();
}
- * @return The mouse cursor x position
+
+ /**
+ * Returns the mouse position (x coordinate) when the click took place.
+ * The position is relative to the browser client area.
+ *
- return details.getClientX();
++ * @return The mouse cursor x position or -1 if unknown
+ */
+ public int getClientX() {
- * @return The mouse cursor y position
++ if (null != details) {
++ return details.getClientX();
++ } else {
++ return -1;
++ }
+ }
+
+ /**
+ * Returns the mouse position (y coordinate) when the click took place.
+ * The position is relative to the browser client area.
+ *
- return details.getClientY();
++ * @return The mouse cursor y position or -1 if unknown
+ */
+ public int getClientY() {
- return details.getRelativeX();
++ if (null != details) {
++ return details.getClientY();
++ } else {
++ return -1;
++ }
+ }
+
+ /**
+ * Returns the relative mouse position (x coordinate) when the click
+ * took place. The position is relative to the clicked component.
+ *
+ * @return The mouse cursor x position relative to the clicked layout
+ * component or -1 if no x coordinate available
+ */
+ public int getRelativeX() {
- return details.getRelativeY();
++ if (null != details) {
++ return details.getRelativeX();
++ } else {
++ return -1;
++ }
+ }
+
+ /**
+ * Returns the relative mouse position (y coordinate) when the click
+ * took place. The position is relative to the clicked component.
+ *
+ * @return The mouse cursor y position relative to the clicked layout
+ * component or -1 if no y coordinate available
+ */
+ public int getRelativeY() {
- return details.isAltKey();
++ if (null != details) {
++ return details.getRelativeY();
++ } else {
++ return -1;
++ }
+ }
+
+ /**
+ * Checks if the Alt key was down when the mouse event took place.
+ *
+ * @return true if Alt was down when the event occured, false otherwise
++ * or if unknown
+ */
+ public boolean isAltKey() {
- * otherwise
++ if (null != details) {
++ return details.isAltKey();
++ } else {
++ return false;
++ }
+ }
+
+ /**
+ * Checks if the Ctrl key was down when the mouse event took place.
+ *
+ * @return true if Ctrl was pressed when the event occured, false
- return details.isCtrlKey();
++ * otherwise or if unknown
+ */
+ public boolean isCtrlKey() {
- * otherwise
++ if (null != details) {
++ return details.isCtrlKey();
++ } else {
++ return false;
++ }
+ }
+
+ /**
+ * Checks if the Meta key was down when the mouse event took place.
+ *
+ * @return true if Meta was pressed when the event occured, false
- return details.isMetaKey();
++ * otherwise or if unknown
+ */
+ public boolean isMetaKey() {
- * otherwise
++ if (null != details) {
++ return details.isMetaKey();
++ } else {
++ return false;
++ }
+ }
+
+ /**
+ * Checks if the Shift key was down when the mouse event took place.
+ *
+ * @return true if Shift was pressed when the event occured, false
- return details.isShiftKey();
++ * otherwise or if unknown
+ */
+ public boolean isShiftKey() {
++ if (null != details) {
++ return details.isShiftKey();
++ } else {
++ return false;
++ }
+ }
}
/**
}
/**
-- * Emits the options change event.
++ * Fires a click event to all listeners without any event details.
++ *
++ * In subclasses, override {@link #fireClick(MouseEventDetails)} instead of
++ * this method.
*/
protected void fireClick() {
fireEvent(new Button.ClickEvent(this));
}
- private void fireClick(MouseEventDetails details) {
++ /**
++ * Fires a click event to all listeners.
++ *
++ * @param details
++ * MouseEventDetails from which keyboard modifiers and other
++ * information about the mouse click can be obtained. If the
++ * button was clicked by a keyboard event, some of the fields may
++ * be empty/undefined.
++ */
++ protected void fireClick(MouseEventDetails details) {
+ fireEvent(new Button.ClickEvent(this, details));
+ }
+
@Override
protected void setInternalValue(Object newValue) {
// Make sure only booleans get through
if (description != null && description.length() > 0) {
target.addAttribute("description", description);
}
--
++ if (item.isCheckable()) {
++ // if the "checked" attribute is present (either true or false),
++ // the item is checkable
++ target.addAttribute(VMenuBar.ATTRIBUTE_CHECKED,
++ item.isChecked());
++ }
if (item.hasChildren()) {
for (MenuItem child : item.getChildren()) {
paintItem(target, child);
// If we got the clicked item, launch the command.
if (found && tmpItem.isEnabled()) {
-- tmpItem.getCommand().menuSelected(tmpItem);
++ if (tmpItem.isCheckable()) {
++ tmpItem.setChecked(!tmpItem.isChecked());
++ }
++ if (null != tmpItem.getCommand()) {
++ tmpItem.getCommand().menuSelected(tmpItem);
++ }
}
}// if
}// changeVariables
private boolean isSeparator = false;
private String styleName;
private String description;
++ private boolean checkable = false;
++ private boolean checked = false;
/**
* Constructs a new menu item that can optionally have an icon and a
* the icon for the menu item
* @param command
* the command for the menu item
++ * @throws IllegalStateException
++ * If the item is checkable and thus cannot have children.
*/
public MenuBar.MenuItem addItem(String caption, Resource icon,
-- MenuBar.Command command) {
++ MenuBar.Command command) throws IllegalStateException {
if (isSeparator()) {
throw new UnsupportedOperationException(
"Cannot add items to a separator");
}
++ if (isCheckable()) {
++ throw new IllegalStateException(
++ "A checkable item cannot have children");
++ }
if (caption == null) {
throw new IllegalArgumentException("Caption cannot be null");
}
* the command for the menu item
* @param itemToAddBefore
* the item that will be after the new item
-- *
++ * @throws IllegalStateException
++ * If the item is checkable and thus cannot have children.
*/
public MenuBar.MenuItem addItemBefore(String caption, Resource icon,
-- MenuBar.Command command, MenuBar.MenuItem itemToAddBefore) {
--
++ MenuBar.Command command, MenuBar.MenuItem itemToAddBefore)
++ throws IllegalStateException {
++ if (isCheckable()) {
++ throw new IllegalStateException(
++ "A checkable item cannot have children");
++ }
MenuItem newItem = null;
if (hasChildren() && itsChildren.contains(itemToAddBefore)) {
return description;
}
++ /**
++ * Gets the checkable state of the item - whether the item has checked
++ * and unchecked states. If an item is checkable its checked state (as
++ * returned by {@link #isChecked()}) is indicated in the UI.
++ *
++ * <p>
++ * An item is not checkable by default.
++ * </p>
++ *
++ * @return true if the item is checkable, false otherwise
++ * @since 6.6.2
++ */
++ public boolean isCheckable() {
++ return checkable;
++ }
++
++ /**
++ * Sets the checkable state of the item. If an item is checkable its
++ * checked state (as returned by {@link #isChecked()}) is indicated in
++ * the UI.
++ *
++ * <p>
++ * An item is not checkable by default.
++ * </p>
++ *
++ * <p>
++ * Items with sub items cannot be checkable.
++ * </p>
++ *
++ * @param checkable
++ * true if the item should be checkable, false otherwise
++ * @throws IllegalStateException
++ * If the item has children
++ * @since 6.6.2
++ */
++ public void setCheckable(boolean checkable)
++ throws IllegalStateException {
++ if (hasChildren()) {
++ throw new IllegalStateException(
++ "A menu item with children cannot be checkable");
++ }
++ this.checkable = checkable;
++ requestRepaint();
++ }
++
++ /**
++ * Gets the checked state of the item (checked or unchecked). Only used
++ * if the item is checkable (as indicated by {@link #isCheckable()}).
++ * The checked state is indicated in the UI with the item, if the item
++ * is checkable.
++ *
++ * <p>
++ * An item is not checked by default.
++ * </p>
++ *
++ * <p>
++ * The CSS style corresponding to the checked state is "-checked".
++ * </p>
++ *
++ * @return true if the item is checked, false otherwise
++ * @since 6.6.2
++ */
++ public boolean isChecked() {
++ return checked;
++ }
++
++ /**
++ * Sets the checked state of the item. Only used if the item is
++ * checkable (indicated by {@link #isCheckable()}). The checked state is
++ * indicated in the UI with the item, if the item is checkable.
++ *
++ * <p>
++ * An item is not checked by default.
++ * </p>
++ *
++ * <p>
++ * The CSS style corresponding to the checked state is "-checked".
++ * </p>
++ *
++ * @return true if the item is checked, false otherwise
++ * @since 6.6.2
++ */
++ public void setChecked(boolean checked) {
++ this.checked = checked;
++ requestRepaint();
++ }
++
}// class MenuItem
}// class MenuBar
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
++<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
++<head profile="http://selenium-ide.openqa.org/profiles/test-case">
++<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
++<link rel="selenium.base" href="" />
++<title>New Test</title>
++</head>
++<body>
++<table cellpadding="1" cellspacing="1" border="1">
++<thead>
++<tr><td rowspan="1" colspan="3">New Test</td></tr>
++</thead><tbody>
++<!--Lower-right-->
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.LongTooltip?restartApplication</td>
++ <td></td>
++</tr>
++<!--Show tooltip, which should be on screen-->
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<!--Wait for tooltip to appear-->
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-lower-right-1</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-lower-right-2</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VTextField[0]</td>
++ <td>100,20</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-lower-right-3</td>
++</tr>
++<!--Upper-right-->
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.LongTooltip?restartApplication</td>
++ <td></td>
++</tr>
++<!--Show tooltip, which should be on screen-->
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<!--Wait for tooltip to appear-->
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-upper-right-1</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-upper-right-2</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VTextField[0]</td>
++ <td>100,20</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-upper-right-3</td>
++</tr>
++<!--Lower-left-->
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.LongTooltip?restartApplication</td>
++ <td></td>
++</tr>
++<!--Show tooltip, which should be on screen-->
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<!--Wait for tooltip to appear-->
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-lower-left-1</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-lower-left-2</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VTextField[0]</td>
++ <td>100,20</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-lower-left-3</td>
++</tr>
++<!--Upper-left-->
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.LongTooltip?restartApplication</td>
++ <td></td>
++</tr>
++<!--Show tooltip, which should be on screen-->
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<!--Wait for tooltip to appear-->
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-upper-left-1</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VTextField[0]</td>
++ <td>0,0</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-upper-left-2</td>
++</tr>
++<!--Hide tooltip-->
++<tr>
++ <td>mouseOut</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td>55,43</td>
++</tr>
++<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
++<tr>
++ <td>pause</td>
++ <td>500</td>
++ <td></td>
++</tr>
++<tr>
++ <td>showTooltip</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VTextField[0]</td>
++ <td>100,20</td>
++</tr>
++<tr>
++ <td>waitForVisible</td>
++ <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>tooltip-upper-left-3</td>
++</tr>
++
++</tbody></table>
++</body>
++</html>
--- /dev/null
--- /dev/null
++package com.vaadin.tests.components;\r
++\r
++import com.vaadin.tests.util.LoremIpsum;\r
++import com.vaadin.ui.Alignment;\r
++import com.vaadin.ui.GridLayout;\r
++import com.vaadin.ui.TextField;\r
++\r
++public class LongTooltip extends TestBase {\r
++\r
++ @Override\r
++ public void setup() {\r
++\r
++ GridLayout gl = new GridLayout(2, 2);\r
++ gl.setSizeFull();\r
++ TextField f1 = createField();\r
++ TextField f2 = createField();\r
++ TextField f3 = createField();\r
++ TextField f4 = createField();\r
++ gl.addComponent(f1);\r
++ gl.addComponent(f2);\r
++ gl.addComponent(f3);\r
++ gl.addComponent(f4);\r
++\r
++ gl.setComponentAlignment(f1, Alignment.TOP_LEFT);\r
++ gl.setComponentAlignment(f2, Alignment.TOP_RIGHT);\r
++ gl.setComponentAlignment(f3, Alignment.BOTTOM_LEFT);\r
++ gl.setComponentAlignment(f4, Alignment.BOTTOM_RIGHT);\r
++\r
++ getLayout().setSizeFull();\r
++ getLayout().addComponent(gl);\r
++\r
++ }\r
++\r
++ private TextField createField() {\r
++ final TextField field = new TextField();\r
++ field.setDescription(LoremIpsum.get(1000));\r
++ return field;\r
++ }\r
++\r
++ @Override\r
++ protected String getDescription() {\r
++ return "For a given cursor position the tooltip should always appear with the same size in the same position. The tooltip should also always be completely on screen and not cause any scrollbars to appear.";\r
++ }\r
++\r
++ @Override\r
++ protected Integer getTicketNumber() {\r
++ return 7100;\r
++ }\r
++}\r
@Override
protected void setup() {
HorizontalSplitPanel sp = new HorizontalSplitPanel();
-- sp.setSizeFull();
++ sp.setWidth("100%");
++ sp.setHeight("70px");
Accordion acc = new Accordion();
<tr>
<td>screenCapture</td>
<td></td>
-- <td>combo should have ds1-3 text</td>
++ <td>combo-should-have-ds1-3-text</td>
</tr>
<tr>
<td>click</td>
--- /dev/null
--- /dev/null
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.combobox.ComboBoxUndefinedWidthAndIcon?restartApplication</td>
++ <td></td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]/domChild[1]</td>
++ <td>13,14</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item1</td>
++ <td>32,5</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>item1-selected</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]/domChild[2]</td>
++ <td>12,5</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td>81,6</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>page2</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td>78,6</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>page3</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td>78,6</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>page4</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item3</td>
++ <td>68,8</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>item33-selected</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]/domChild[2]</td>
++ <td>8,7</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td>116,3</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxUndefinedWidthAndIcon::</td>
++ <td>338,241</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>item33-selected-after-popup-opened-and-closed</td>
++</tr>
--- /dev/null
--- /dev/null
++package com.vaadin.tests.components.combobox;\r
++\r
++import com.vaadin.data.Item;\r
++import com.vaadin.terminal.Resource;\r
++import com.vaadin.terminal.ThemeResource;\r
++import com.vaadin.tests.components.TestBase;\r
++import com.vaadin.ui.ComboBox;\r
++\r
++public class ComboBoxUndefinedWidthAndIcon extends TestBase {\r
++ @Override\r
++ protected void setup() {\r
++ ComboBox cb = new ComboBox();\r
++ cb.addContainerProperty("caption", String.class, null);\r
++ cb.addContainerProperty("icon", Resource.class, null);\r
++ for (int i = 1; i < 200 + 1; i++) {\r
++ Item item = cb.addItem(i);\r
++ item.getItemProperty("caption").setValue("Item " + i);\r
++ item.getItemProperty("icon").setValue(\r
++ new ThemeResource("../runo/icons/16/users.png"));\r
++ }\r
++ cb.setItemIconPropertyId("icon");\r
++ cb.setItemCaptionPropertyId("caption");\r
++\r
++ addComponent(cb);\r
++ }\r
++\r
++ @Override\r
++ protected String getDescription() {\r
++ return "The width of the ComboBox should be fixed even though it is set to undefined width. The width should not change when changing pages in the dropdown.";\r
++ }\r
++\r
++ @Override\r
++ protected Integer getTicketNumber() {\r
++ return 7013;\r
++ }\r
++}\r
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
++<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
++<head profile="http://selenium-ide.openqa.org/profiles/test-case">
++<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
++<link rel="selenium.base" href="" />
++<title>MenuBarItemsCheckable</title>
++</head>
++<body>
++<table cellpadding="1" cellspacing="1" border="1">
++<thead>
++<tr><td rowspan="1" colspan="3">MenuBarItemsCheckable</td></tr>
++</thead><tbody>
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.menubar.MenuBarTest?restartApplication</td>
++ <td></td>
++</tr>
++<!--Hide event log to be able to compare screenshots-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item1</td>
++ <td>30,7</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
++ <td>27,3</td>
++</tr>
++<!--Make some items checkable-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item0</td>
++ <td>43,12</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
++ <td>47,9</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item4</td>
++ <td>48,5</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
++ <td>90,11</td>
++</tr>
++<!--Show icons on some items-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item0</td>
++ <td>13,1</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
++ <td>47,3</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
++ <td>26,4</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item3</td>
++ <td>39,7</td>
++</tr>
++<!--Set width to 100%-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item0</td>
++ <td>23,9</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item2</td>
++ <td>36,6</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
++ <td>27,7</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
++ <td>23,3</td>
++</tr>
++<!--Open sub menu 1-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_StestComponent#item0</td>
++ <td>51,10</td>
++</tr>
++<!--Open sub menu 1-1-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
++ <td>51,10</td>
++</tr>
++<tr>
++ <td>pause</td>
++ <td>3000</td>
++ <td></td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>submenu-1-1-checkable-items</td>
++</tr>
++<!--Select item-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
++ <td>51,10</td>
++</tr>
++<!--Open sub menu 1-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_StestComponent#item0</td>
++ <td>51,10</td>
++</tr>
++<!--Open sub menu 1-1-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
++ <td>51,10</td>
++</tr>
++<tr>
++ <td>screenCapture</td>
++ <td></td>
++ <td>submenu-1-1-checked-items</td>
++</tr>
++
++</tbody></table>
++</body>
++</html>
private Integer iconSize;\r
private Integer disabledDensity;\r
private Integer invisibleDensity;\r
++ private Integer checkableDensity;\r
\r
@Override\r
protected Class<MenuBar> getTestClass() {\r
createMenuIconsSizeSelect(CATEGORY_MENU_ITEM_STATES);\r
createMenuItemDisabledDensitySelect(CATEGORY_MENU_ITEM_STATES);\r
createMenuItemInvisibleDensitySelect(CATEGORY_MENU_ITEM_STATES);\r
++ createMenuItemCheckableDensitySelect(CATEGORY_MENU_ITEM_STATES);\r
\r
}\r
\r
setMenuItemInvisibleDensity);\r
}\r
\r
++ private void createMenuItemCheckableDensitySelect(String category) {\r
++ LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();\r
++ options.put("No items checkable", null);\r
++ options.put("All checkable", 1);\r
++ options.put("Every second", 2);\r
++ options.put("Every third", 3);\r
++\r
++ createSelectAction("Checkable", category, options,\r
++ "No items checkable", setMenuItemCheckableDensity);\r
++ }\r
++\r
/* COMMANDS */\r
Command<MenuBar, Integer> createRootMenuItems = new Command<MenuBar, Integer>() {\r
\r
}\r
};\r
\r
++ private Command<MenuBar, Integer> setMenuItemCheckableDensity = new Command<MenuBar, Integer>() {\r
++\r
++ public void execute(MenuBar c, Integer value, Object data) {\r
++ checkableDensity = value;\r
++ createRootItems(c);\r
++ }\r
++ };\r
++\r
private Command<MenuBar, Integer> setSubMenuSeparatorDensity = new Command<MenuBar, Integer>() {\r
\r
public void execute(MenuBar c, Integer value, Object data) {\r
subMenuItem.setCommand(null);\r
createSubItems(subMenuItem, level + 1);\r
}\r
++\r
++ if (!subMenuItem.hasChildren() && level > 0\r
++ && checkableDensity != null && i % checkableDensity == 0) {\r
++ subMenuItem.setCheckable(true);\r
++ }\r
}\r
\r
}\r
<tr>
<td>screenCapture</td>
<td></td>
-- <td>click-287,25</td>
++ <td>click-287-25</td>
</tr>
<tr>
<td>mouseClick</td>
--- /dev/null
--- /dev/null
++package com.vaadin.tests.components.panel;
++
++import com.vaadin.tests.components.AbstractComponentContainerTest;
++import com.vaadin.ui.Panel;
++
++public class PanelTest<T extends Panel> extends
++ AbstractComponentContainerTest<T> {
++
++ @SuppressWarnings("unchecked")
++ @Override
++ protected Class<T> getTestClass() {
++ return (Class<T>) Panel.class;
++ }
++
++}
LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();\r
options.put("Horizontal", Slider.ORIENTATION_HORIZONTAL);\r
options.put("Vertical", Slider.ORIENTATION_VERTICAL);\r
-- createSelectAction("Resolution", category, options, "Horizontal",\r
++ createSelectAction("Orientation", category, options, "Horizontal",\r
orientationCommand);\r
\r
}\r
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
++<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
++<head profile="http://selenium-ide.openqa.org/profiles/test-case">
++<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
++<link rel="selenium.base" href="" />
++<title>New Test</title>
++</head>
++<body>
++<table cellpadding="1" cellspacing="1" border="1">
++<thead>
++<tr><td rowspan="1" colspan="3">New Test</td></tr>
++</thead><tbody>
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.table.Tables?restartApplication</td>
++ <td></td>
++</tr>
++<!--5 items-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td>
++ <td>25,7</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item5</td>
++ <td>50,2</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item1</td>
++ <td>86,10</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item5</td>
++ <td>53,6</td>
++</tr>
++<!--Item 1 context menu-->
++<tr>
++ <td>contextmenu</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td></td>
++</tr>
++<!--Body context menu-->
++<tr>
++ <td>contextmenu</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]</td>
++ <td></td>
++</tr>
++<!--Add context menu-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td>
++ <td>21,8</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td>
++ <td>61,1</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td>
++ <td>68,7</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item5</td>
++ <td>69,12</td>
++</tr>
++<!--Item 1 context menu-->
++<tr>
++ <td>contextmenu</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertVisible</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VContextMenu[0]#option0</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertText</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VContextMenu[0]#option0</td>
++ <td>Edit Item 1</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VContextMenu[0]#option0</td>
++ <td>52,12</td>
++</tr>
++<!--Body context menu-->
++<tr>
++ <td>contextmenu</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertVisible</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VContextMenu[0]#option0</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertText</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VContextMenu[0]#option0</td>
++ <td>New...</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VContextMenu[0]#option0</td>
++ <td>35,12</td>
++</tr>
++<!--Remove context menu-->
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td>
++ <td>20,8</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td>
++ <td>67,3</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item2</td>
++ <td>71,7</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item0</td>
++ <td>16,3</td>
++</tr>
++<!--Item 1 context menu-->
++<tr>
++ <td>contextmenu</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[2]/domChild[0]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertElementNotPresent</td>
++ <td>//div[@id='PID_VAADIN_CM']</td>
++ <td></td>
++</tr>
++<!--Body context menu-->
++<tr>
++ <td>contextmenu</td>
++ <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[1]</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertElementNotPresent</td>
++ <td>//div[@id='PID_VAADIN_CM']</td>
++ <td></td>
++</tr>
++
++</tbody></table>
++</body>
++</html>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>dialog1 should be on top</td>
++ <td>dialog1-should-be-on-top</td>
</tr>
<tr>
<td>mouseClick</td>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>dialog 3 modal</td>
++ <td>dialog-3-modal</td>
</tr>
<tr>
<td>mouseClick</td>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>window5closed window 5 modal</td>
++ <td>window5closed-window-5-modal</td>
</tr>
<tr>
<td>mouseClick</td>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>window2 on top of window1, others closed</td>
++ <td>window2-on-top-of-window1-others-closed</td>
</tr>
</tbody></table>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>add+2 remove</td>
++ <td>add+2-remove</td>
</tr>
<tr>
<td>click</td>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>add-button only</td>
++ <td>add-button-only</td>
</tr>
</tbody></table>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>add+2 remove</td>
++ <td>add+2-remove</td>
</tr>
<tr>
<td>click</td>
<tr>
<td>screenCapture</td>
<td></td>
-- <td>add-button only</td>
++ <td>add-button-only</td>
</tr>
</tbody></table>
--- /dev/null
--- /dev/null
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
++<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
++<head profile="http://selenium-ide.openqa.org/profiles/test-case">
++<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
++<link rel="selenium.base" href="http://arturwin.office.itmill.com:8888/" />
++<title>New Test</title>
++</head>
++<body>
++<table cellpadding="1" cellspacing="1" border="1">
++<thead>
++<tr><td rowspan="1" colspan="3">New Test</td></tr>
++</thead><tbody>
++<tr>
++ <td>open</td>
++ <td>/run/com.vaadin.tests.components.window.WindowTest?restartApplication</td>
++ <td></td>
++</tr>
++<tr>
++ <td>assertText</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
++ <td>Short</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_Smenu#item0</td>
++ <td>52,19</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
++ <td>85,4</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>
++ <td>67,9</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
++ <td>23,11</td>
++</tr>
++<tr>
++ <td>assertText</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
++ <td>This is a semi-long text that might wrap.</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_Smenu#item0</td>
++ <td>52,19</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
++ <td>85,4</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>
++ <td>67,9</td>
++</tr>
++<tr>
++ <td>mouseClick</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::Root/VOverlay[2]/VMenuBar[0]#item0</td>
++ <td>23,11</td>
++</tr>
++<tr>
++ <td>assertText</td>
++ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
++ <td></td>
++</tr>
++
++</tbody></table>
++</body>
++</html>
--- /dev/null
--- /dev/null
++package com.vaadin.tests.components.window;
++
++import com.vaadin.tests.components.panel.PanelTest;
++import com.vaadin.ui.Window;
++
++public class WindowTest extends PanelTest<Window> {
++
++ @Override
++ protected Class<Window> getTestClass() {
++ return Window.class;
++ }
++
++ @Override
++ protected void addTestComponent(Window c) {
++ getMainWindow().addWindow(c);
++ getTestComponents().add(c);
++ }
++
++}
package com.vaadin.tests.server.container;\r
\r
++import com.vaadin.data.Container.Filter;\r
++import com.vaadin.data.Item;\r
import com.vaadin.data.util.HierarchicalContainer;\r
\r
public class TestHierarchicalContainer extends\r
testContainerSortingAndFiltering(new HierarchicalContainer());\r
}\r
\r
++ public void testRemovingItemsFromFilteredContainer() {\r
++ HierarchicalContainer container = new HierarchicalContainer();\r
++ initializeContainer(container);\r
++ container.setIncludeParentsWhenFiltering(true);\r
++ container.addContainerFilter(FULLY_QUALIFIED_NAME, "ab", false, false);\r
++ Object p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertEquals("com.vaadin.ui", p1);\r
++\r
++ container.removeItem("com.vaadin.ui.TabSheet");\r
++ // Parent for the removed item must be null because the item is no\r
++ // longer in the container\r
++ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertNull("Parent should be null, is " + p1, p1);\r
++\r
++ container.removeAllItems();\r
++ p1 = container.getParent("com.vaadin.terminal.gwt.client.Focusable");\r
++ assertNull("Parent should be null, is " + p1, p1);\r
++\r
++ }\r
++\r
++ public void testParentWhenRemovingFilterFromContainer() {\r
++ HierarchicalContainer container = new HierarchicalContainer();\r
++ initializeContainer(container);\r
++ container.setIncludeParentsWhenFiltering(true);\r
++ container.addContainerFilter(FULLY_QUALIFIED_NAME, "ab", false, false);\r
++ Object p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertEquals("com.vaadin.ui", p1);\r
++ p1 = container\r
++ .getParent("com.vaadin.terminal.gwt.client.ui.VPopupCalendar");\r
++ assertNull(p1);\r
++ container.removeAllContainerFilters();\r
++ p1 = container\r
++ .getParent("com.vaadin.terminal.gwt.client.ui.VPopupCalendar");\r
++ assertEquals("com.vaadin.terminal.gwt.client.ui", p1);\r
++\r
++ }\r
++\r
++ public void testChangeParentInFilteredContainer() {\r
++ HierarchicalContainer container = new HierarchicalContainer();\r
++ initializeContainer(container);\r
++ container.setIncludeParentsWhenFiltering(true);\r
++ container.addContainerFilter(FULLY_QUALIFIED_NAME, "Tab", false, false);\r
++\r
++ // Change parent of filtered item\r
++ Object p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertEquals("com.vaadin.ui", p1);\r
++ container.setParent("com.vaadin.ui.TabSheet", "com.vaadin");\r
++ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertEquals("com.vaadin", p1);\r
++ container.setParent("com.vaadin.ui.TabSheet", "com");\r
++ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertEquals("com", p1);\r
++ container.setParent("com.vaadin.ui.TabSheet", null);\r
++ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertNull(p1);\r
++\r
++ // root -> non-root\r
++ container.setParent("com.vaadin.ui.TabSheet", "com");\r
++ p1 = container.getParent("com.vaadin.ui.TabSheet");\r
++ assertEquals("com", p1);\r
++\r
++ }\r
++\r
public void testHierarchicalFilteringWithParents() {\r
HierarchicalContainer container = new HierarchicalContainer();\r
initializeContainer(container);\r
\r
}\r
\r
++ public void testRemoveLastChild() {\r
++ HierarchicalContainer c = new HierarchicalContainer();\r
++\r
++ c.addItem("root");\r
++ assertEquals(false, c.hasChildren("root"));\r
++\r
++ c.addItem("child");\r
++ c.setParent("child", "root");\r
++ assertEquals(true, c.hasChildren("root"));\r
++\r
++ c.removeItem("child");\r
++ assertFalse(c.containsId("child"));\r
++ assertNull(c.getChildren("root"));\r
++ assertNull(c.getChildren("child"));\r
++ assertFalse(c.hasChildren("child"));\r
++ assertFalse(c.hasChildren("root"));\r
++ }\r
++\r
++ public void testRemoveLastChildFromFiltered() {\r
++ HierarchicalContainer c = new HierarchicalContainer();\r
++\r
++ c.addItem("root");\r
++ assertEquals(false, c.hasChildren("root"));\r
++\r
++ c.addItem("child");\r
++ c.setParent("child", "root");\r
++ assertEquals(true, c.hasChildren("root"));\r
++\r
++ // Dummy filter that does not remove any items\r
++ c.addContainerFilter(new Filter() {\r
++\r
++ public boolean passesFilter(Object itemId, Item item)\r
++ throws UnsupportedOperationException {\r
++ return true;\r
++ }\r
++\r
++ public boolean appliesToProperty(Object propertyId) {\r
++ return true;\r
++ }\r
++ });\r
++ c.removeItem("child");\r
++\r
++ assertFalse(c.containsId("child"));\r
++ assertNull(c.getChildren("root"));\r
++ assertNull(c.getChildren("child"));\r
++ assertFalse(c.hasChildren("child"));\r
++ assertFalse(c.hasChildren("root"));\r
++ }\r
++\r
public void testHierarchicalFilteringWithoutParents() {\r
HierarchicalContainer container = new HierarchicalContainer();\r
\r