Browse Source

Merged some changes from 6.5

svn changeset:17798/svn branch:6.6
tags/6.7.0.beta1
Henri Sara 13 years ago
parent
commit
722adf8a3e
31 changed files with 1275 additions and 1258 deletions
  1. 6
    2
      WebContent/VAADIN/themes/base/styles.css
  2. 4
    0
      WebContent/VAADIN/themes/base/tabsheet/tabsheet.css
  3. 6
    2
      WebContent/VAADIN/themes/liferay/styles.css
  4. 7
    3
      WebContent/VAADIN/themes/reindeer/styles.css
  5. 6
    2
      WebContent/VAADIN/themes/runo/styles.css
  6. BIN
      build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.class
  7. 10
    1
      build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java
  8. BIN
      build/buildhelpers/com/vaadin/buildhelpers/ManifestWriter.class
  9. 139
    29
      src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
  10. 41
    2
      src/com/vaadin/terminal/gwt/client/ui/VPanel.java
  11. 7
    5
      src/com/vaadin/terminal/gwt/client/ui/VTextField.java
  12. 11
    3
      src/com/vaadin/terminal/gwt/client/ui/VView.java
  13. 7
    2
      src/com/vaadin/terminal/gwt/client/ui/VWindow.java
  14. 17
    2
      src/com/vaadin/ui/AbsoluteLayout.java
  15. 51
    18
      src/com/vaadin/ui/Embedded.java
  16. 37
    2
      src/com/vaadin/ui/Panel.java
  17. 26
    2
      src/com/vaadin/ui/Window.java
  18. 4
    4
      tests/eclipse-run-selected-test.properties
  19. 15
    0
      tests/src/com/vaadin/tests/VaadinClasses.java
  20. 86
    0
      tests/src/com/vaadin/tests/components/LayoutAttachListenerInfo.html
  21. 142
    0
      tests/src/com/vaadin/tests/components/LayoutAttachListenerInfo.java
  22. 136
    0
      tests/src/com/vaadin/tests/components/caption/IconsInCaption.java
  23. 33
    0
      tests/src/com/vaadin/tests/components/embedded/FlashIsVisible.html
  24. 31
    0
      tests/src/com/vaadin/tests/components/embedded/FlashIsVisible.java
  25. 5
    0
      tests/src/com/vaadin/tests/components/menubar/IconsInSubMenus.html
  26. 127
    0
      tests/src/com/vaadin/tests/components/menubar/MenuBarResize.html
  27. 0
    65
      tests/src/com/vaadin/tests/components/table/HeaderClick.html
  28. 48
    0
      tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.html
  29. 48
    0
      tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java
  30. 1
    10
      tests/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
  31. 224
    1104
      tests/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html

+ 6
- 2
WebContent/VAADIN/themes/base/styles.css View File

@@ -1,5 +1,5 @@
.v-theme-version:after {content:"6_5_1_dev-20110207";}
.v-theme-version-6_5_1_dev-20110207 {display: none;}
.v-theme-version:after {content:"6_5_2_dev-20110303";}
.v-theme-version-6_5_2_dev-20110303 {display: none;}
/* Automatically compiled css file from subdirectories. */

.v-absolutelayout-wrapper {
@@ -1839,6 +1839,10 @@ div.v-progressindicator-indeterminate-disabled {
border-bottom: none;
position: relative;
}
.v-ie6 .v-tabsheet-content,
.v-ie7 .v-tabsheet-content {
zoom: 1;
}
.v-tabsheet-deco {
height: 1px;
background: #aaa;

+ 4
- 0
WebContent/VAADIN/themes/base/tabsheet/tabsheet.css View File

@@ -111,6 +111,10 @@
border-bottom: none;
position: relative;
}
.v-ie6 .v-tabsheet-content,
.v-ie7 .v-tabsheet-content {
zoom: 1;
}
.v-tabsheet-deco {
height: 1px;
background: #aaa;

+ 6
- 2
WebContent/VAADIN/themes/liferay/styles.css View File

@@ -1,5 +1,5 @@
.v-theme-version:after {content:"6_5_1_dev-20110207";}
.v-theme-version-6_5_1_dev-20110207 {display: none;}
.v-theme-version:after {content:"6_5_2_dev-20110303";}
.v-theme-version-6_5_2_dev-20110303 {display: none;}
/* Automatically compiled css file from subdirectories. */

.v-absolutelayout-wrapper {
@@ -1839,6 +1839,10 @@ div.v-progressindicator-indeterminate-disabled {
border-bottom: none;
position: relative;
}
.v-ie6 .v-tabsheet-content,
.v-ie7 .v-tabsheet-content {
zoom: 1;
}
.v-tabsheet-deco {
height: 1px;
background: #aaa;

+ 7
- 3
WebContent/VAADIN/themes/reindeer/styles.css View File

@@ -1,5 +1,5 @@
.v-theme-version:after {content:"6_5_1_dev-20110207";}
.v-theme-version-6_5_1_dev-20110207 {display: none;}
.v-theme-version:after {content:"6_5_2_dev-20110303";}
.v-theme-version-6_5_2_dev-20110303 {display: none;}
/* Automatically compiled css file from subdirectories. */

.v-absolutelayout-wrapper {
@@ -1839,6 +1839,10 @@ div.v-progressindicator-indeterminate-disabled {
border-bottom: none;
position: relative;
}
.v-ie6 .v-tabsheet-content,
.v-ie7 .v-tabsheet-content {
zoom: 1;
}
.v-tabsheet-deco {
height: 1px;
background: #aaa;
@@ -4467,9 +4471,9 @@ td.v-datefield-calendarpanel-nextyear {
-webkit-border-bottom-right-radius: 4px;
height: 13px;
padding: 4px 30px;
white-space: nowrap;
color: #222;
text-shadow: #fff 0 1px 0;
width: 100px;
position: relative;
top: 1px;
-webkit-box-shadow: rgba(0,0,0,.5) 0 1px 2px;

+ 6
- 2
WebContent/VAADIN/themes/runo/styles.css View File

@@ -1,5 +1,5 @@
.v-theme-version:after {content:"6_5_1_dev-20110207";}
.v-theme-version-6_5_1_dev-20110207 {display: none;}
.v-theme-version:after {content:"6_5_2_dev-20110303";}
.v-theme-version-6_5_2_dev-20110303 {display: none;}
/* Automatically compiled css file from subdirectories. */

.v-absolutelayout-wrapper {
@@ -1839,6 +1839,10 @@ div.v-progressindicator-indeterminate-disabled {
border-bottom: none;
position: relative;
}
.v-ie6 .v-tabsheet-content,
.v-ie7 .v-tabsheet-content {
zoom: 1;
}
.v-tabsheet-deco {
height: 1px;
background: #aaa;

BIN
build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.class View File


+ 10
- 1
build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java View File

@@ -92,6 +92,14 @@ public class GeneratePackageExports {
Name name = (Name) attrit.next();
keys.add(name.toString());
}

// Jar must be closed before updating it below, as it's
// locked in Windows until closed. (#6045)
try {
jar.close();
} catch (IOException e) {
System.err.println("Unable to close JAR '"+jarFilename+"'");
}
// Put the manifest version as the first line
String orderedKeys[] = new String[keys.size()];
@@ -121,7 +129,8 @@ public class GeneratePackageExports {
// the loop above, but it's not guaranteed that it exists.
manifest.writeAttribute("Export-Package", exportPackage);

// Update the manifest in the Jar
// Update the manifest in the Jar. The jar must be closed
// before this is done.
int status = manifest.updateJar(jarFilename);

if (status != 0)

BIN
build/buildhelpers/com/vaadin/buildhelpers/ManifestWriter.class View File


+ 139
- 29
src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java View File

@@ -1,4 +1,4 @@
/*
/*
@ITMillApache2LicenseForJavaFiles@
*/

@@ -137,35 +137,9 @@ public class VEmbedded extends HTML implements Paintable {
} else if (uidl.hasAttribute("mimetype")) {
final String mime = uidl.getStringAttribute("mimetype");
if (mime.equals("application/x-shockwave-flash")) {
addStyleName(CLASSNAME + "-flash");
String html = "<object "
+ "type=\"application/x-shockwave-flash\" "
+ "width=\"" + width + "\" height=\"" + height + "\">";
// Handle embedding of Flash
setHTML(createFlashEmbed(uidl));

Map<String, String> parameters = getParameters(uidl);
if (parameters.get("movie") == null) {
parameters.put("movie", getSrc(uidl, client));
}

// Add the parameters to the Object
for (String name : parameters.keySet()) {
html += "<param name=\"" + escapeAttribute(name)
+ "\" value=\""
+ escapeAttribute(parameters.get(name)) + "\"/>";
}

html += "<embed src=\"" + getSrc(uidl, client) + "\" width=\""
+ width + "\" height=\"" + height + "\" "
+ "type=\"application/x-shockwave-flash\" ";

// Add the parameters to the Embed
for (String name : parameters.keySet()) {
html += escapeAttribute(name) + "=\""
+ escapeAttribute(parameters.get(name)) + "\" ";
}

html += "></embed></object>";
setHTML(html);
} else if (mime.equals("image/svg+xml")) {
addStyleName(CLASSNAME + "-svg");
String data;
@@ -185,6 +159,26 @@ public class VEmbedded extends HTML implements Paintable {
if (height != null) {
obj.getStyle().setProperty("height", "100%");
}
if (uidl.hasAttribute("classid")) {
obj.setAttribute("classid",
uidl.getStringAttribute(escapeAttribute("classid")));
}
if (uidl.hasAttribute("codebase")) {
obj.setAttribute("codebase", uidl
.getStringAttribute(escapeAttribute("codebase")));
}
if (uidl.hasAttribute("codetype")) {
obj.setAttribute("codetype", uidl
.getStringAttribute(escapeAttribute("codetype")));
}
if (uidl.hasAttribute("archive")) {
obj.setAttribute("archive",
uidl.getStringAttribute(escapeAttribute("archive")));
}
if (uidl.hasAttribute("standby")) {
obj.setAttribute("standby",
uidl.getStringAttribute(escapeAttribute("standby")));
}
getElement().appendChild(obj);

} else {
@@ -197,7 +191,123 @@ public class VEmbedded extends HTML implements Paintable {
if (clearBrowserElement) {
browserElement = null;
}
}

/**
* Creates the Object and Embed tags for the Flash plugin so it works
* cross-browser
*
* @param uidl
* The UIDL
* @return Tags concatenated into a string
*/
private String createFlashEmbed(UIDL uidl) {
addStyleName(CLASSNAME + "-flash");

/*
* To ensure cross-browser compatibility we are using the twice-cooked
* method to embed flash i.e. we add a OBJECT tag for IE ActiveX and
* inside it a EMBED for all other browsers.
*/

StringBuilder html = new StringBuilder();

// Start the object tag
html.append("<object ");

/*
* Add classid required for ActiveX to recognize the flash. This is a
* predefined value which ActiveX recognizes and must be the given
* value. More info can be found on
* http://kb2.adobe.com/cps/415/tn_4150.html. Allow user to override
* this by setting his own classid.
*/
if (uidl.hasAttribute("classid")) {
html.append("classid=\""
+ escapeAttribute(uidl.getStringAttribute("classid"))
+ "\" ");
} else {
html.append("classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
}

/*
* Add codebase required for ActiveX and must be exactly this according
* to http://kb2.adobe.com/cps/415/tn_4150.html to work with the above
* given classid. Again, see more info on
* http://kb2.adobe.com/cps/415/tn_4150.html. Limiting Flash version to
* 6.0.0.0 and above. Allow user to override this by setting his own
* codebase
*/
if (uidl.hasAttribute("codebase")) {
html.append("codebase=\""
+ escapeAttribute(uidl.getStringAttribute("codebase"))
+ "\" ");
} else {
html.append("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ");
}

// Add width and height
html.append("width=\"" + width + "\" ");
html.append("height=\"" + height + "\" ");
html.append("type=\"application/x-shockwave-flash\" ");

// Codetype
if (uidl.hasAttribute("codetype")) {
html.append("codetype=\"" + uidl.getStringAttribute("codetype")
+ "\" ");
}

// Standby
if (uidl.hasAttribute("standby")) {
html.append("standby=\"" + uidl.getStringAttribute("standby")
+ "\" ");
}

// Archive
if (uidl.hasAttribute("archive")) {
html.append("archive=\"" + uidl.getStringAttribute("archive")
+ "\" ");
}

// End object tag
html.append(">");

// Ensure we have an movie parameter
Map<String, String> parameters = getParameters(uidl);
if (parameters.get("movie") == null) {
parameters.put("movie", getSrc(uidl, client));
}

// Add parameters to OBJECT
for (String name : parameters.keySet()) {
html.append("<param ");
html.append("name=\"" + escapeAttribute(name) + "\" ");
html.append("value=\"" + escapeAttribute(parameters.get(name))
+ "\" ");
html.append("/>");
}

// Build inner EMBED tag
html.append("<embed ");
html.append("src=\"" + getSrc(uidl, client) + "\" ");
html.append("width=\"" + width + "\" ");
html.append("height=\"" + height + "\" ");
html.append("type=\"application/x-shockwave-flash\" ");

// Add the parameters to the Embed
for (String name : parameters.keySet()) {
html.append(escapeAttribute(name));
html.append("=");
html.append("\"" + escapeAttribute(parameters.get(name)) + "\"");
}

// End embed tag
html.append("></embed>");

// End object tag
html.append("</object>");

return html.toString();
}

/**

+ 41
- 2
src/com/vaadin/terminal/gwt/client/ui/VPanel.java View File

@@ -1,4 +1,4 @@
/*
/*
@ITMillApache2LicenseForJavaFiles@
*/

@@ -21,6 +21,7 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation;
import com.vaadin.terminal.gwt.client.RenderSpace;
@@ -29,7 +30,7 @@ import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;

public class VPanel extends SimplePanel implements Container,
ShortcutActionHandlerOwner {
ShortcutActionHandlerOwner, Focusable {

public static final String CLICK_EVENT_IDENTIFIER = "click";
public static final String CLASSNAME = "v-panel";
@@ -103,7 +104,16 @@ public class VPanel extends SimplePanel implements Container,
bottomDecoration.setClassName(CLASSNAME + "-deco");

getElement().appendChild(captionWrap);

/*
* Make contentNode focusable only by using the setFocus() method. This
* behaviour can be changed by invoking setTabIndex() in the serverside
* implementation
*/
contentNode.setTabIndex(-1);

getElement().appendChild(contentNode);

getElement().appendChild(bottomDecoration);
setStyleName(CLASSNAME);
DOM.sinkEvents(getElement(), Event.ONKEYDOWN);
@@ -117,6 +127,30 @@ public class VPanel extends SimplePanel implements Container,
}, TouchStartEvent.getType());
}

/**
* Sets the keyboard focus on the Panel
*
* @param focus
* Should the panel have focus or not.
*/
public void setFocus(boolean focus) {
if (focus) {
getContainerElement().focus();
} else {
getContainerElement().blur();
}
}

/*
* (non-Javadoc)
*
* @see com.vaadin.terminal.gwt.client.Focusable#focus()
*/
public void focus() {
setFocus(true);

}

@Override
protected Element getContainerElement() {
return contentNode;
@@ -236,6 +270,11 @@ public class VPanel extends SimplePanel implements Container,
// scrollTop
runHacks(false);

// And apply tab index
if (uidl.hasVariable("tabindex")) {
contentNode.setTabIndex(uidl.getIntVariable("tabindex"));
}

rendering = false;

}

+ 7
- 5
src/com/vaadin/terminal/gwt/client/ui/VTextField.java View File

@@ -145,12 +145,14 @@ public class VTextField extends TextBoxBase implements Paintable, Field,

@Override
public void run() {
updateCursorPosition();
boolean textChanged = communicateTextValueToServer();
if (textChanged) {
client.sendPendingVariableChanges();
if (isAttached()) {
updateCursorPosition();
boolean textChanged = communicateTextValueToServer();
if (textChanged) {
client.sendPendingVariableChanges();
}
scheduled = false;
}
scheduled = false;
}
};
private boolean scheduled = false;

+ 11
- 3
src/com/vaadin/terminal/gwt/client/ui/VView.java View File

@@ -43,7 +43,7 @@ import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHan
*
*/
public class VView extends SimplePanel implements Container, ResizeHandler,
Window.ClosingHandler, ShortcutActionHandlerOwner {
Window.ClosingHandler, ShortcutActionHandlerOwner, Focusable {

private static final String CLASSNAME = "v-view";

@@ -110,6 +110,10 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
public VView() {
super();
setStyleName(CLASSNAME);

// Allow focusing the view by using the focus() method, the view
// should not be in the document focus flow
getElement().setTabIndex(-1);
}

/**
@@ -691,9 +695,9 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
DOM.setStyleAttribute(fElem, "position", "absolute");
DOM.setStyleAttribute(fElem, "opacity", "0.1");
DOM.appendChild(getElement(), fElem);
Util.focus(fElem);
fElem.focus();
} else {
Util.focus(getElement());
getElement().focus();
}

parentFrame = getParentFrame();
@@ -703,4 +707,8 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
return actionHandler;
}

public void focus() {
getElement().focus();
}

}

+ 7
- 2
src/com/vaadin/terminal/gwt/client/ui/VWindow.java View File

@@ -1,4 +1,4 @@
/*
/*
@ITMillApache2LicenseForJavaFiles@
*/

@@ -35,6 +35,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
@@ -50,7 +51,7 @@ import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHan
*/
public class VWindow extends VOverlay implements Container,
ShortcutActionHandlerOwner, ScrollHandler, KeyDownHandler,
FocusHandler, BlurHandler, BeforeShortcutActionListener {
FocusHandler, BlurHandler, BeforeShortcutActionListener, Focusable {

/**
* Minimum allowed height of a window. This refers to the content area, not
@@ -1307,4 +1308,8 @@ public class VWindow extends VOverlay implements Container,
// blur/focus )
}

public void focus() {
contentPanel.focus();
}

}

+ 17
- 2
src/com/vaadin/ui/AbsoluteLayout.java View File

@@ -122,8 +122,23 @@ public class AbsoluteLayout extends AbstractLayout implements
* The css position string
*/
public void addComponent(Component c, String cssPosition) {
addComponent(c);
getPosition(c).setCSSString(cssPosition);
/*
* Create position instance and add it to componentToCoordinates map. We
* need to do this before we call addComponent so the attachListeners
* can access this position. #6368
*/
ComponentPosition position = new ComponentPosition();
position.setCSSString(cssPosition);
componentToCoordinates.put(c, position);

try {
addComponent(c);

} catch (IllegalArgumentException e) {
// Remove component coordinates if adding fails
componentToCoordinates.remove(c);
throw e;
}
}

/**

+ 51
- 18
src/com/vaadin/ui/Embedded.java View File

@@ -1,4 +1,4 @@
/*
/*
@ITMillApache2LicenseForJavaFiles@
*/

@@ -205,8 +205,9 @@ public class Embedded extends AbstractComponent {
}

/**
* Gets the codebase, the root-path used to access resources with relative
* paths.
* This attribute specifies the base path used to resolve relative URIs
* specified by the classid, data, and archive attributes. When absent, its
* default value is the base URI of the current document.
*
* @return the code base.
*/
@@ -233,20 +234,22 @@ public class Embedded extends AbstractComponent {
}

/**
* Gets the standby text displayed when the object is loading.
* This attribute specifies a message that a user agent may render while
* loading the object's implementation and data.
*
* @return the standby text.
* @return The text displayed when loading
*/
public String getStandby() {
return standby;
}

/**
* Sets the codebase, the root-path used to access resources with relative
* paths.
* This attribute specifies the base path used to resolve relative URIs
* specified by the classid, data, and archive attributes. When absent, its
* default value is the base URI of the current document.
*
* @param codebase
* the codebase to set.
* The base path
*/
public void setCodebase(String codebase) {
if (codebase != this.codebase
@@ -257,7 +260,11 @@ public class Embedded extends AbstractComponent {
}

/**
* Sets the codetype, the MIME-Type of the code.
* This attribute specifies the content type of data expected when
* downloading the object specified by classid. This attribute is optional
* but recommended when classid is specified since it allows the user agent
* to avoid loading information for unsupported content types. When absent,
* it defaults to the value of the type attribute.
*
* @param codetype
* the codetype to set.
@@ -296,10 +303,11 @@ public class Embedded extends AbstractComponent {
}

/**
* Sets the standby, the text to display while loading the object.
* This attribute specifies a message that a user agent may render while
* loading the object's implementation and data.
*
* @param standby
* the standby to set.
* The text to display while loading
*/
public void setStandby(String standby) {
if (standby != this.standby
@@ -310,16 +318,18 @@ public class Embedded extends AbstractComponent {
}

/**
* Gets the classId attribute.
* This attribute may be used to specify the location of an object's
* implementation via a URI.
*
* @return the class id.
* @return the classid.
*/
public String getClassId() {
return classId;
}

/**
* Sets the classId attribute.
* This attribute may be used to specify the location of an object's
* implementation via a URI.
*
* @param classId
* the classId to set.
@@ -410,19 +420,31 @@ public class Embedded extends AbstractComponent {
}

/**
* Gets the archive attribute.
* This attribute may be used to specify a space-separated list of URIs for
* archives containing resources relevant to the object, which may include
* the resources specified by the classid and data attributes. Preloading
* archives will generally result in reduced load times for objects.
* Archives specified as relative URIs should be interpreted relative to the
* codebase attribute.
*
* @return the archive attribute.
* @return Space-separated list of URIs with resources relevant to the
* object
*/
public String getArchive() {
return archive;
}

/**
* Sets the archive attribute.
* This attribute may be used to specify a space-separated list of URIs for
* archives containing resources relevant to the object, which may include
* the resources specified by the classid and data attributes. Preloading
* archives will generally result in reduced load times for objects.
* Archives specified as relative URIs should be interpreted relative to the
* codebase attribute.
*
* @param archive
* the archive string to set.
* Space-separated list of URIs with resources relevant to the
* object
*/
public void setArchive(String archive) {
if (archive != this.archive
@@ -458,6 +480,12 @@ public class Embedded extends AbstractComponent {
removeListener(CLICK_EVENT, ClickEvent.class, listener);
}

/*
* (non-Javadoc)
*
* @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object,
* java.util.Map)
*/
@SuppressWarnings("unchecked")
@Override
public void changeVariables(Object source, Map<String, Object> variables) {
@@ -468,6 +496,11 @@ public class Embedded extends AbstractComponent {

}

/**
* Notifies click-listeners that a mouse click event has occurred.
*
* @param parameters
*/
private void fireClick(Map<String, Object> parameters) {
MouseEventDetails mouseDetails = MouseEventDetails
.deSerialize((String) parameters.get("mouseDetails"));

+ 37
- 2
src/com/vaadin/ui/Panel.java View File

@@ -1,4 +1,4 @@
/*
/*
@ITMillApache2LicenseForJavaFiles@
*/

@@ -17,6 +17,7 @@ import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Scrollable;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.VPanel;
import com.vaadin.ui.Component.Focusable;
import com.vaadin.ui.themes.Reindeer;
import com.vaadin.ui.themes.Runo;

@@ -32,7 +33,7 @@ import com.vaadin.ui.themes.Runo;
@ClientWidget(VPanel.class)
public class Panel extends AbstractComponentContainer implements Scrollable,
ComponentContainer.ComponentAttachListener,
ComponentContainer.ComponentDetachListener, Action.Notifier {
ComponentContainer.ComponentDetachListener, Action.Notifier, Focusable {

private static final String CLICK_EVENT = VPanel.CLICK_EVENT_IDENTIFIER;

@@ -74,6 +75,13 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
*/
protected ActionManager actionManager;

/**
* By default the Panel is not in the normal document focus flow and can
* only be focused by using the focus()-method. Change this to 0 if you want
* to have the Panel in the normal focus flow.
*/
private int tabIndex = -1;

/**
* Creates a new empty panel. A VerticalLayout is used as content.
*/
@@ -234,6 +242,8 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
public void paintContent(PaintTarget target) throws PaintException {
content.paint(target);

target.addVariable(this, "tabindex", getTabIndex());

if (isScrollable()) {
target.addVariable(this, "scrollLeft", getScrollLeft());
target.addVariable(this, "scrollTop", getScrollTop());
@@ -582,4 +592,29 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
fireEvent(new ClickEvent(this, mouseDetails));
}

/**
* {@inheritDoc}
*/
public int getTabIndex() {
return tabIndex;
}

/**
* {@inheritDoc}
*/
public void setTabIndex(int tabIndex) {
this.tabIndex = tabIndex;
requestRepaint();
}

/**
* Moves keyboard focus to the component. {@see Focusable#focus()}
*
*/
@Override
public void focus() {
super.focus();
}

}

+ 26
- 2
src/com/vaadin/ui/Window.java View File

@@ -1,4 +1,4 @@
/*
/*
@ITMillApache2LicenseForJavaFiles@
*/

@@ -1120,6 +1120,10 @@ public class Window extends Panel implements URIHandler, ParameterHandler,
if (parent == null) {
fireClose();
} else {

// focus is restored to the parent window
parent.focus();
// subwindow is removed from parent
parent.removeWindow(this);
}
@@ -2089,7 +2093,7 @@ public class Window extends Panel implements URIHandler, ParameterHandler,
* <code>
* // within the window using helper
* subWindow.setCloseShortcut(KeyCode.ESCAPE, null);
*
*
* // or globally
* getWindow().addAction(new Window.CloseShortcut(subWindow, KeyCode.ESCAPE));
* </code>
@@ -2180,4 +2184,24 @@ public class Window extends Panel implements URIHandler, ParameterHandler,
removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener);
}

/**
* {@inheritDoc}
*
* If the window is a sub-window focusing will cause the sub-window to be
* brought on top of other sub-windows on gain keyboard focus.
*/
@Override
public void focus() {
if (getParent() != null) {
/*
* When focusing a sub-window it basically means it should be
* brought to the front. Instead of just moving the keyboard focus
* we focus the window and bring it top-most.
*/
bringToFront();
} else {
super.focus();
}
}

}

+ 4
- 4
tests/eclipse-run-selected-test.properties View File

@@ -1,12 +1,12 @@
; Location where vaadin-testbench jar can be found
com.vaadin.testbench.lib.dir=<enter location of testbench here>
com.vaadin.testbench.lib.dir=/home/hesara/dev/software/testbench/vaadin-testbench-2.2.0.development.201103151333
; Deployment url to use for testing. Context path must be /
com.vaadin.testbench.deployment.url=http://<enter your ip here>:8888/
com.vaadin.testbench.deployment.url=http://192.168.2.215:8888/
; Location of the screenshot directory.
; This is the directory that contains the "references" directory
com.vaadin.testbench.screenshot.directory=<enter the full path to the screenshots directory, parent of "references" directory>
com.vaadin.testbench.screenshot.directory=/home/hesara/dev/workspaces/helios_sr1_jee_vaadin/v66_screenshots
; Run the whole test even if
com.vaadin.testbench.screenshot.softfail=true
@@ -23,7 +23,7 @@ com.vaadin.testbench.screenshot.cursor=true
; Uncomment to limit to certain browsers or override in launch configuration
; browsers=winxp-opera10
; Claim that the server has started succesfully. Needed for the tests to run
; Claim that the server has started successfully. Needed for the tests to run
server.start.succeeded=1
test-output-dir=../build/test-output

+ 15
- 0
tests/src/com/vaadin/tests/VaadinClasses.java View File

@@ -20,9 +20,14 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DragAndDropWrapper;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.LoginForm;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.SplitPanel;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;

@SuppressWarnings("deprecation")
public class VaadinClasses {

public static void main(String[] args) {
@@ -68,6 +73,16 @@ public class VaadinClasses {
return classes;
}

public static List<Class<? extends ComponentContainer>> getComponentContainersSupportingUnlimitedNumberOfComponents() {
List<Class<? extends ComponentContainer>> classes = getComponentContainersSupportingAddRemoveComponent();
classes.remove(SplitPanel.class);
classes.remove(VerticalSplitPanel.class);
classes.remove(HorizontalSplitPanel.class);
classes.remove(Window.class);

return classes;
}

@SuppressWarnings({ "unchecked", "rawtypes" })
public static List<Class<? extends AbstractComponentTest<?>>> getBasicComponentTests() {
try {

+ 86
- 0
tests/src/com/vaadin/tests/components/LayoutAttachListenerInfo.html View File

@@ -0,0 +1,86 @@
<?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.LayoutAttachListenerInfo?restartApplication</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>Top50pxLeft50px</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::Root/VNotification[0]/HTML[0]/domChild[0]</td>
<td>351,23</td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VOptionGroup[0]/domChild[1]/domChild[0]</td>
<td>8,7</td>
</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>AttachedToIndex0</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::Root/VNotification[0]/HTML[0]/domChild[0]</td>
<td>351,23</td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VOptionGroup[0]/domChild[2]/domChild[0]</td>
<td>3,5</td>
</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentsLayoutAttachListenerInfo::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>AttachedTo23</td>
</tr>
</tbody></table>
</body>
</html>

+ 142
- 0
tests/src/com/vaadin/tests/components/LayoutAttachListenerInfo.java View File

@@ -0,0 +1,142 @@
package com.vaadin.tests.components;

import java.util.Arrays;

import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.ComponentContainer.ComponentAttachEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window.Notification;


public class LayoutAttachListenerInfo extends TestBase {

private VerticalLayout content = new VerticalLayout();

@Override
protected void setup() {

OptionGroup layouts = new OptionGroup("Layouts", Arrays.asList(
"AbsoluteLayout", "OrderedLayout", "GridLayout"));
layouts.select("AbsoluteLayout");
layouts.setImmediate(true);
layouts.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
if (event.getProperty().getValue().equals("AbsoluteLayout")) {
testAbsoluteLayout();
} else if (event.getProperty().getValue()
.equals("OrderedLayout")) {
testOrderedLayout();
} else if (event.getProperty().getValue().equals("GridLayout")) {
testGridLayout();
}
}
});

addComponent(layouts);
addComponent(content);

testAbsoluteLayout();
}

@Override
protected String getDescription() {
return "When pressing the attach button a Label with the value \"X\" "
+ "should get added to the selected layout and a notification of the position"
+ " of the component should be visible";
}

@Override
protected Integer getTicketNumber() {
return 6368;
}

private void testAbsoluteLayout() {
content.removeAllComponents();

final AbsoluteLayout a = new AbsoluteLayout();
a.setWidth("300px");
a.setHeight("300px");
a.addListener(new ComponentContainer.ComponentAttachListener() {
public void componentAttachedToContainer(ComponentAttachEvent event) {
AbsoluteLayout layout = (AbsoluteLayout) event.getContainer();
AbsoluteLayout.ComponentPosition position = layout
.getPosition(event.getAttachedComponent());

getMainWindow().showNotification(
"Attached to " + position.getCSSString(),
Notification.TYPE_ERROR_MESSAGE);
}
});
content.addComponent(a);

content.addComponent(new Button("Attach label to layout",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
a.addComponent(new Label("X"), "top:50px;left:50px");
}
}));
}

private void testOrderedLayout(){
content.removeAllComponents();
final VerticalLayout v = new VerticalLayout();
v.setWidth("300px");
v.setHeight("300px");
v.addListener(new ComponentContainer.ComponentAttachListener() {
public void componentAttachedToContainer(ComponentAttachEvent event) {
VerticalLayout layout = (VerticalLayout) event.getContainer();
getMainWindow().showNotification(
"Attached to index "
+ layout.getComponentIndex(event
.getAttachedComponent()),
Notification.TYPE_ERROR_MESSAGE);
}
});
content.addComponent(v);

content.addComponent(new Button("Attach label to layout",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
v.addComponent(new Label("X"));

}
}));
}

private void testGridLayout() {
content.removeAllComponents();

final GridLayout g = new GridLayout(4, 4);
g.setWidth("300px");
g.setHeight("300px");
g.addListener(new ComponentContainer.ComponentAttachListener() {
public void componentAttachedToContainer(ComponentAttachEvent event) {
GridLayout layout = (GridLayout) event.getContainer();
GridLayout.Area area = layout.getComponentArea(event
.getAttachedComponent());
getMainWindow().showNotification(
"Attached to " + area.getColumn1() + ","
+ area.getRow1(),
Notification.TYPE_ERROR_MESSAGE);
}
});

content.addComponent(g);

content.addComponent(new Button("Attach label to layout",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
g.addComponent(new Label("X"), 2, 3);
}
}));
}
}

+ 136
- 0
tests/src/com/vaadin/tests/components/caption/IconsInCaption.java View File

@@ -0,0 +1,136 @@
package com.vaadin.tests.components.caption;

import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.VaadinClasses;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;

public class IconsInCaption extends TestBase {

private static final String TYPE_EMBEDDED = "Embedded";
private static final String TYPE_CAPTION = "In caption";

private static final String[] icons = new String[] { "arrow-down.png",
"arrow-left.png", "arrow-right.png", "arrow-up.png",
"attention.png", "calendar.png", "cancel.png", "document.png",
"document-add.png", "document-delete.png", "document-doc.png",
"document-image.png", "document-pdf.png", "document-ppt.png",
"document-txt.png", "document-web.png", "document-xsl.png",
"email.png", "email-reply.png", "email-send.png", "folder.png",
"folder-add.png", "folder-delete.png", "globe.png", "help.png",
"lock.png", "note.png", "ok.png", "reload.png", "settings.png",
"trash.png", "trash-full.png", "user.png", "users.png" };

private static final String[] sizes = new String[] { "16", "32", "64" };

private ComponentContainer container = new VerticalLayout();

private Log log = new Log(5);

private ComboBox containerSelect;

private ComboBox iconTypeSelect;

@Override
protected void setup() {
iconTypeSelect = new ComboBox("Icon container");
iconTypeSelect.addItem(TYPE_EMBEDDED);
iconTypeSelect.addItem(TYPE_CAPTION);
iconTypeSelect.setImmediate(true);
iconTypeSelect.setNullSelectionAllowed(false);
iconTypeSelect.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
updateContainer();
}
});

containerSelect = new ComboBox("Container");
for (Class<? extends ComponentContainer> cc : VaadinClasses
.getComponentContainersSupportingUnlimitedNumberOfComponents()) {
containerSelect.addItem(cc);
}
containerSelect.setImmediate(true);
containerSelect.addListener(new ValueChangeListener() {

public void valueChange(ValueChangeEvent event) {
updateContainer();

}
});

addComponent(log);
addComponent(iconTypeSelect);
addComponent(containerSelect);
addComponent(container);

iconTypeSelect.setValue(TYPE_CAPTION);
containerSelect.setValue(VerticalLayout.class);
}

protected void updateContainer() {
Class<? extends ComponentContainer> containerClass = (Class<? extends ComponentContainer>) containerSelect
.getValue();
if (containerClass == null) {
return;
}

Object iconType = iconTypeSelect.getValue();
try {
ComponentContainer newContainer = createContainer(containerClass,
iconType);
replaceComponent(container, newContainer);
container = newContainer;
log.log("Container changed to " + containerClass.getName() + "/"
+ iconType);
} catch (Exception e) {
log.log("Create container failed for " + containerClass.getName()
+ ": " + e.getMessage());
e.printStackTrace();
}

}

private static ComponentContainer createContainer(
Class<? extends ComponentContainer> containerClass, Object iconType)
throws InstantiationException, IllegalAccessException {
ComponentContainer container = containerClass.newInstance();
for (String size : sizes) {
Label title = new Label("<h3>" + size + "x" + size + "</h3>",
Label.CONTENT_XHTML);
container.addComponent(title);
for (String icon : icons) {
ThemeResource res = new ThemeResource("../runo/icons/" + size
+ "/" + icon);
if (TYPE_CAPTION.equals(iconType)) {
Label name = new Label();
name.setCaption(icon);
name.setIcon(res);
container.addComponent(name);
} else if (TYPE_EMBEDDED.equals(iconType)) {
Embedded e = new Embedded(icon, res);
container.addComponent(e);
}
}
}

return container;
}

@Override
protected String getDescription() {
return "Test for comparing rendering speed of icons in a caption and in an Embedded component in different component containers.";
}

@Override
protected Integer getTicketNumber() {
return 6578;
}

}

+ 33
- 0
tests/src/com/vaadin/tests/components/embedded/FlashIsVisible.html View File

@@ -0,0 +1,33 @@
<?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.embedded.FlashIsVisible</td>
<td></td>
</tr>
<!--Allow the flash plugin to load before taking the screenshot-->
<tr>
<td>pause</td>
<td>5000</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
</tr>

</tbody></table>
</body>
</html>

+ 31
- 0
tests/src/com/vaadin/tests/components/embedded/FlashIsVisible.java View File

@@ -0,0 +1,31 @@
package com.vaadin.tests.components.embedded;

import com.vaadin.terminal.ExternalResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Embedded;

public class FlashIsVisible extends TestBase {

@Override
protected void setup() {
Embedded player = new Embedded();
player.setType(Embedded.TYPE_OBJECT);
player.setMimeType("application/x-shockwave-flash");
player.setWidth("400px");
player.setHeight("300px");
String url = "http://www.youtube.com/v/qQ9N742QB4g&autoplay=0";
player.setSource(new ExternalResource(url));
addComponent(player);
}

@Override
protected String getDescription() {
return "Flash plugin should load and be visible on all browsers";
}

@Override
protected Integer getTicketNumber() {
return 6501;
}

}

+ 5
- 0
tests/src/com/vaadin/tests/components/menubar/IconsInSubMenus.html View File

@@ -75,6 +75,11 @@
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_StestComponent#item0</td>
<td>51,10</td>
</tr>
<tr>
<td>pause</td>
<td>1000</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>

+ 127
- 0
tests/src/com/vaadin/tests/components/menubar/MenuBarResize.html View File

@@ -0,0 +1,127 @@
<?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.menubar.MenuBarTest?restartApplication</td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item0</td>
<td>26,7</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item2</td>
<td>71,9</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>34,2</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
<td>32,5</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item1</td>
<td>17,5</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item2</td>
<td>36,1</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>22,5</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
<td>48,15</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>menubar-100pct-inside-500px</td>
</tr>
<tr>
<td>open</td>
<td>/run/com.vaadin.tests.components.menubar.MenuBarTest</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>menubar-100pct-inside-500px-after-refresh</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item1</td>
<td>20,0</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item2</td>
<td>72,3</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>4,8</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item10</td>
<td>26,9</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>menubar-100pct-inside-900px</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::PID_Smenu#item0</td>
<td>19,3</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[0]/VMenuBar[0]#item2</td>
<td>66,6</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>6,2</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsmenubarMenuBarTest::Root/VOverlay[2]/VMenuBar[0]#item10</td>
<td>43,3</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td>menubar-900px-inside-900px</td>
</tr>

</tbody></table>
</body>
</html>

+ 0
- 65
tests/src/com/vaadin/tests/components/table/HeaderClick.html View File

@@ -16,21 +16,11 @@
<td>/run/com.vaadin.tests.components.table.HeaderClick?restartApplication</td>
<td></td>
</tr>
<tr>
<td>waitForVaadin</td>
<td></td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td>37,11</td>
</tr>
<tr>
<td>waitForVaadin</td>
<td></td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -41,11 +31,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1]</td>
<td>36,9</td>
</tr>
<tr>
<td>waitForVaadin</td>
<td></td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -56,11 +41,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1]</td>
<td>8,11</td>
</tr>
<tr>
<td>waitForVaadin</td>
<td></td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -77,11 +57,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td>31,9</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -92,11 +67,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1]</td>
<td>16,10</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -107,11 +77,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1]</td>
<td>16,10</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -127,11 +92,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td>64,10</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -142,11 +102,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1]</td>
<td>48,10</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -157,11 +112,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1]</td>
<td>30,11</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -177,11 +127,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td>48,11</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -192,11 +137,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1]</td>
<td>71,10</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
@@ -207,11 +147,6 @@
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1]</td>
<td>39,5</td>
</tr>
<tr>
<td>pause</td>
<td>500</td>
<td></td>
</tr>
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>

+ 48
- 0
tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.html View File

@@ -0,0 +1,48 @@
<?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.textfield.TextChangeTimeoutAfterDetach?restartApplication</td>
<td></td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentstextfieldTextChangeTimeoutAfterDetach::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]</td>
<td>119,12</td>
</tr>
<tr>
<td>enterCharacter</td>
<td>vaadin=runcomvaadintestscomponentstextfieldTextChangeTimeoutAfterDetach::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]</td>
<td>aaaa</td>
</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentstextfieldTextChangeTimeoutAfterDetach::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<!--Wait for 3 seconds so the timeout occurs-->
<tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
<td></td>
</tr>

</tbody></table>
</body>
</html>

+ 48
- 0
tests/src/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java View File

@@ -0,0 +1,48 @@
package com.vaadin.tests.components.textfield;

import com.vaadin.event.FieldEvents.TextChangeEvent;
import com.vaadin.event.FieldEvents.TextChangeListener;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractTextField.TextChangeEventMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;

public class TextChangeTimeoutAfterDetach extends TestBase {

@Override
protected void setup() {
final TextField field = new TextField();
field.setImmediate(false);
field.setTextChangeTimeout(2000);
field.setTextChangeEventMode(TextChangeEventMode.TIMEOUT);
field.addListener(new TextChangeListener() {
public void textChange(TextChangeEvent event) {
// Need to add a listener for events to occur
}
});
addComponent(field);
Button detachBtn = new Button("detach field",
new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
removeComponent(field);
getLayout().addComponentAsFirst(
new Label("Field detached!"));
}
});
addComponent(detachBtn);
}

@Override
protected String getDescription() {
return "The textfield has a TextChangeTimout of 1 second. Edit the field and immidietly detach the field and you will cause an \"Out Of Sync\" error.";
}

@Override
protected Integer getTicketNumber() {
return 6507;
}

}

+ 1
- 10
tests/src/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java View File

@@ -16,7 +16,6 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Select;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
@@ -490,7 +489,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
AbstractField[] fields = new AbstractField[6];
AbstractField[] fields = new AbstractField[5];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
@@ -512,14 +511,6 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
fields[4]
.setComponentError(new UserError("component error, user error"));
fields[5] = new NativeSelect();
fields[5].setRequired(true);
fields[5].setValidationVisible(true);
fields[5].setRequiredError("required error");
fields[5]
.setComponentError(new UserError("component error, user error"));
fields[5].setIcon(new ThemeResource(CALENDAR_32_PNG));
for (int i = 0; i < components.length; i++) {
components[i].setComponentError(new UserError(
"component error, user error"));

+ 224
- 1104
tests/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
File diff suppressed because it is too large
View File


Loading…
Cancel
Save