Browse Source

Formatted using Eclipse Helios / Windows XP

svn changeset:14496/svn branch:6.4
tags/6.7.0.beta1
Artur Signell 13 years ago
parent
commit
789c80e253
100 changed files with 708 additions and 757 deletions
  1. 1
    2
      src/com/vaadin/data/Buffered.java
  2. 1
    0
      src/com/vaadin/data/Validator.java
  3. 3
    3
      src/com/vaadin/data/util/DefaultItemSorter.java
  4. 2
    2
      src/com/vaadin/data/util/Filter.java
  5. 5
    10
      src/com/vaadin/data/util/IndexedContainer.java
  6. 1
    2
      src/com/vaadin/data/util/PropertysetItem.java
  7. 2
    2
      src/com/vaadin/data/util/QueryContainer.java
  8. 1
    0
      src/com/vaadin/event/MouseEvents.java
  9. 2
    2
      src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java
  10. 2
    2
      src/com/vaadin/launcher/util/BrowserLauncher.java
  11. 3
    3
      src/com/vaadin/terminal/ClassResource.java
  12. 29
    34
      src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
  13. 2
    2
      src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java
  14. 4
    4
      src/com/vaadin/terminal/gwt/client/ComponentLocator.java
  15. 3
    3
      src/com/vaadin/terminal/gwt/client/DateTimeService.java
  16. 2
    2
      src/com/vaadin/terminal/gwt/client/RenderInformation.java
  17. 2
    2
      src/com/vaadin/terminal/gwt/client/Util.java
  18. 1
    2
      src/com/vaadin/terminal/gwt/client/VCaption.java
  19. 4
    4
      src/com/vaadin/terminal/gwt/client/VDebugConsole.java
  20. 5
    3
      src/com/vaadin/terminal/gwt/client/VErrorMessage.java
  21. 11
    11
      src/com/vaadin/terminal/gwt/client/ui/ClickEventHandler.java
  22. 5
    5
      src/com/vaadin/terminal/gwt/client/ui/MenuBar.java
  23. 2
    2
      src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java
  24. 1
    1
      src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java
  25. 4
    8
      src/com/vaadin/terminal/gwt/client/ui/VAccordion.java
  26. 14
    14
      src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java
  27. 6
    6
      src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java
  28. 6
    6
      src/com/vaadin/terminal/gwt/client/ui/VCustomLayout.java
  29. 4
    4
      src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
  30. 2
    2
      src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
  31. 4
    6
      src/com/vaadin/terminal/gwt/client/ui/VForm.java
  32. 8
    8
      src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java
  33. 6
    6
      src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
  34. 2
    2
      src/com/vaadin/terminal/gwt/client/ui/VListSelect.java
  35. 15
    18
      src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java
  36. 2
    2
      src/com/vaadin/terminal/gwt/client/ui/VNativeSelect.java
  37. 1
    3
      src/com/vaadin/terminal/gwt/client/ui/VOptionGroupBase.java
  38. 67
    67
      src/com/vaadin/terminal/gwt/client/ui/VOrderedLayout.java
  39. 12
    6
      src/com/vaadin/terminal/gwt/client/ui/VOverlay.java
  40. 1
    3
      src/com/vaadin/terminal/gwt/client/ui/VPanel.java
  41. 2
    2
      src/com/vaadin/terminal/gwt/client/ui/VPopupCalendar.java
  42. 1
    1
      src/com/vaadin/terminal/gwt/client/ui/VPopupView.java
  43. 60
    64
      src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
  44. 15
    14
      src/com/vaadin/terminal/gwt/client/ui/VSlider.java
  45. 1
    3
      src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java
  46. 16
    11
      src/com/vaadin/terminal/gwt/client/ui/VTablePaging.java
  47. 7
    7
      src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
  48. 3
    2
      src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java
  49. 6
    4
      src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java
  50. 2
    4
      src/com/vaadin/terminal/gwt/client/ui/VUpload.java
  51. 2
    4
      src/com/vaadin/terminal/gwt/client/ui/VView.java
  52. 15
    17
      src/com/vaadin/terminal/gwt/client/ui/VWindow.java
  53. 3
    3
      src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java
  54. 1
    1
      src/com/vaadin/terminal/gwt/client/ui/dd/VDragEvent.java
  55. 4
    5
      src/com/vaadin/terminal/gwt/client/ui/layout/CellBasedLayout.java
  56. 7
    8
      src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java
  57. 12
    12
      src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextToolbar.java
  58. 27
    30
      src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
  59. 43
    55
      src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
  60. 18
    15
      src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
  61. 13
    13
      src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java
  62. 29
    29
      src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java
  63. 2
    2
      src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java
  64. 1
    1
      src/com/vaadin/terminal/gwt/server/ChangeVariablesErrorEvent.java
  65. 4
    3
      src/com/vaadin/terminal/gwt/server/CommunicationManager.java
  66. 2
    3
      src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java
  67. 7
    11
      src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java
  68. 3
    3
      src/com/vaadin/terminal/gwt/server/PortletApplicationContext.java
  69. 1
    3
      src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
  70. 4
    3
      src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
  71. 19
    19
      src/com/vaadin/terminal/gwt/server/RestrictedRenderResponse.java
  72. 2
    2
      src/com/vaadin/terminal/gwt/server/WebApplicationContext.java
  73. 7
    7
      src/com/vaadin/terminal/gwt/widgetsetutils/AcceptCriteriaFactoryGenerator.java
  74. 9
    7
      src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java
  75. 8
    9
      src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java
  76. 1
    2
      src/com/vaadin/terminal/gwt/widgetsetutils/WidgetSetBuilder.java
  77. 9
    9
      src/com/vaadin/tools/WidgetsetCompiler.java
  78. 3
    3
      src/com/vaadin/ui/AbstractComponent.java
  79. 1
    3
      src/com/vaadin/ui/AbstractLayout.java
  80. 8
    8
      src/com/vaadin/ui/Component.java
  81. 1
    1
      src/com/vaadin/ui/CssLayout.java
  82. 2
    2
      src/com/vaadin/ui/DragAndDropWrapper.java
  83. 6
    6
      src/com/vaadin/ui/Form.java
  84. 1
    1
      src/com/vaadin/ui/FormLayout.java
  85. 4
    2
      src/com/vaadin/ui/GridLayout.java
  86. 1
    1
      src/com/vaadin/ui/Layout.java
  87. 3
    5
      src/com/vaadin/ui/Panel.java
  88. 1
    2
      src/com/vaadin/ui/PopupView.java
  89. 1
    2
      src/com/vaadin/ui/Select.java
  90. 3
    3
      src/com/vaadin/ui/Slider.java
  91. 2
    0
      src/com/vaadin/ui/TabSheet.java
  92. 21
    28
      src/com/vaadin/ui/Table.java
  93. 7
    7
      src/com/vaadin/ui/Tree.java
  94. 15
    15
      src/com/vaadin/ui/Window.java
  95. 2
    2
      tests/src/com/vaadin/tests/CustomLayoutDemo.java
  96. 1
    1
      tests/src/com/vaadin/tests/FocusingComponents.java
  97. 7
    9
      tests/src/com/vaadin/tests/LayoutDemo.java
  98. 2
    2
      tests/src/com/vaadin/tests/ListenerOrder.java
  99. 2
    2
      tests/src/com/vaadin/tests/ModalWindow.java
  100. 0
    0
      tests/src/com/vaadin/tests/NativeWindowing.java

+ 1
- 2
src/com/vaadin/data/Buffered.java View File

@@ -247,8 +247,7 @@ public interface Buffered extends Serializable {

for (int i = 0; i < causes.length; i++) {
final int causeLevel = (causes[i] instanceof ErrorMessage) ? ((ErrorMessage) causes[i])
.getErrorLevel()
: ErrorMessage.ERROR;
.getErrorLevel() : ErrorMessage.ERROR;
if (causeLevel > level) {
level = causeLevel;
}

+ 1
- 0
src/com/vaadin/data/Validator.java View File

@@ -6,6 +6,7 @@ package com.vaadin.data;

import java.io.Serializable;

import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.terminal.ErrorMessage;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;

+ 3
- 3
src/com/vaadin/data/util/DefaultItemSorter.java View File

@@ -10,9 +10,9 @@ import java.util.Comparator;
import java.util.List;

import com.vaadin.data.Container;
import com.vaadin.data.Container.Sortable;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Container.Sortable;

/**
* Provides a default implementation of an ItemSorter. The
@@ -115,8 +115,8 @@ public class DefaultItemSorter implements ItemSorter {
* The second item to compare.
* @return a negative, zero, or positive integer if the property value in
* the first item is less than, equal to, or greater than the
* property value in the second item. Negated if {@code
* sortDirection} is false.
* property value in the second item. Negated if
* {@code sortDirection} is false.
*/
protected int compareProperty(Object propertyId, boolean sortDirection,
Item item1, Item item2) {

+ 2
- 2
src/com/vaadin/data/util/Filter.java View File

@@ -59,13 +59,13 @@ public class Filter implements Serializable {
@Override
public boolean equals(Object obj) {

// Only ones of the objects of the same class can be equal
// Only ones of the objects of the same class can be equal
if (!(obj instanceof Filter)) {
return false;
}
final Filter o = (Filter) obj;

// Checks the properties one by one
// Checks the properties one by one
if (propertyId != o.propertyId && o.propertyId != null
&& !o.propertyId.equals(propertyId)) {
return false;

+ 5
- 10
src/com/vaadin/data/util/IndexedContainer.java View File

@@ -1472,22 +1472,17 @@ public class IndexedContainer implements Container.Indexed,
// Clone the shallow properties
nc.itemIds = itemIds != null ? (ArrayList) itemIds.clone() : null;
nc.itemSetChangeListeners = itemSetChangeListeners != null ? (LinkedList) itemSetChangeListeners
.clone()
: null;
.clone() : null;
nc.propertyIds = propertyIds != null ? (ArrayList) propertyIds.clone()
: null;
nc.propertySetChangeListeners = propertySetChangeListeners != null ? (LinkedList) propertySetChangeListeners
.clone()
: null;
.clone() : null;
nc.propertyValueChangeListeners = propertyValueChangeListeners != null ? (LinkedList) propertyValueChangeListeners
.clone()
: null;
.clone() : null;
nc.readOnlyProperties = readOnlyProperties != null ? (HashSet) readOnlyProperties
.clone()
: null;
.clone() : null;
nc.singlePropertyValueChangeListeners = singlePropertyValueChangeListeners != null ? (Hashtable) singlePropertyValueChangeListeners
.clone()
: null;
.clone() : null;

nc.types = types != null ? (Hashtable) types.clone() : null;


+ 1
- 2
src/com/vaadin/data/util/PropertysetItem.java View File

@@ -248,8 +248,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,

npsi.list = list != null ? (LinkedList) list.clone() : null;
npsi.propertySetChangeListeners = propertySetChangeListeners != null ? (LinkedList) propertySetChangeListeners
.clone()
: null;
.clone() : null;
npsi.map = (HashMap) map.clone();

return npsi;

+ 2
- 2
src/com/vaadin/data/util/QueryContainer.java View File

@@ -134,8 +134,8 @@ public class QueryContainer implements Container, Container.Ordered,
final String columnName = metadata.getColumnName(i);
list.add(columnName);
final Property p = getContainerProperty(new Integer(1), columnName);
propertyTypes.put(columnName, p == null ? Object.class : p
.getType());
propertyTypes.put(columnName,
p == null ? Object.class : p.getType());
}
propertyIds = Collections.unmodifiableCollection(list);
}

+ 1
- 0
src/com/vaadin/event/MouseEvents.java View File

@@ -6,6 +6,7 @@ package com.vaadin.event;

import java.lang.reflect.Method;

import com.vaadin.event.MouseEvents.ClickListener;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.tools.ReflectTools;
import com.vaadin.ui.Component;

+ 2
- 2
src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java View File

@@ -42,8 +42,8 @@ public class ContainsDataFlavor extends ClientSideCriterion {
}

public boolean accept(DragAndDropEvent dragEvent) {
return dragEvent.getTransferable().getDataFlavors().contains(
dataFlavorId);
return dragEvent.getTransferable().getDataFlavors()
.contains(dataFlavorId);
}

@Override

+ 2
- 2
src/com/vaadin/launcher/util/BrowserLauncher.java View File

@@ -37,8 +37,8 @@ public class BrowserLauncher {
try {
// Find out the location of the x-www-browser link from path.
Process process = runtime.exec("which x-www-browser");
BufferedInputStream ins = new BufferedInputStream(process
.getInputStream());
BufferedInputStream ins = new BufferedInputStream(
process.getInputStream());
BufferedReader bufreader = new BufferedReader(
new InputStreamReader(ins));
String defaultLinkPath = bufreader.readLine();

+ 3
- 3
src/com/vaadin/terminal/ClassResource.java View File

@@ -130,9 +130,9 @@ public class ClassResource implements ApplicationResource, Serializable {
* @see com.vaadin.terminal.ApplicationResource#getStream()
*/
public DownloadStream getStream() {
final DownloadStream ds = new DownloadStream(associatedClass
.getResourceAsStream(resourceName), getMIMEType(),
getFilename());
final DownloadStream ds = new DownloadStream(
associatedClass.getResourceAsStream(resourceName),
getMIMEType(), getFilename());
ds.setBufferSize(getBufferSize());
ds.setCacheTime(cacheTime);
return ds;

+ 29
- 34
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java View File

@@ -36,8 +36,8 @@ import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.ui.Field;
import com.vaadin.terminal.gwt.client.ui.VContextMenu;
import com.vaadin.terminal.gwt.client.ui.VNotification;
import com.vaadin.terminal.gwt.client.ui.VView;
import com.vaadin.terminal.gwt.client.ui.VNotification.HideEvent;
import com.vaadin.terminal.gwt.client.ui.VView;
import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;

@@ -481,16 +481,14 @@ public class ApplicationConnection {
handleWhenCSSLoaded(response);
}
}).schedule(50);
console
.log("Assuming CSS loading is not complete, "
+ "postponing render phase. "
+ "(.v-loading-indicator height == 0)");
console.log("Assuming CSS loading is not complete, "
+ "postponing render phase. "
+ "(.v-loading-indicator height == 0)");
cssWaits++;
} else {
handleReceivedJSONMessage(response);
if (cssWaits >= MAX_CSS_WAITS) {
console
.error("CSS files may have not loaded properly.");
console.error("CSS files may have not loaded properly.");
}
}
}
@@ -522,8 +520,8 @@ public class ApplicationConnection {
private void showCommunicationError(String details) {
console.error("Communication error: " + details);
showError(details, configuration.getCommunicationErrorCaption(),
configuration.getCommunicationErrorMessage(), configuration
.getCommunicationErrorUrl());
configuration.getCommunicationErrorMessage(),
configuration.getCommunicationErrorUrl());
}

/**
@@ -535,8 +533,8 @@ public class ApplicationConnection {
private void showAuthenticationError(String details) {
console.error("Authentication error: " + details);
showError(details, configuration.getAuthorizationErrorCaption(),
configuration.getAuthorizationErrorMessage(), configuration
.getAuthorizationErrorUrl());
configuration.getAuthorizationErrorMessage(),
configuration.getAuthorizationErrorUrl());
}

/**
@@ -925,8 +923,8 @@ public class ApplicationConnection {
.get(getPid(paintable));
Widget widget = (Widget) paintable;
Size oldSize = detail.getOffsetSize();
Size newSize = new Size(widget.getOffsetWidth(), widget
.getOffsetHeight());
Size newSize = new Size(widget.getOffsetWidth(),
widget.getOffsetHeight());

if (oldSize == null || !oldSize.equals(newSize)) {
sizeUpdatedWidgets.add(paintable);
@@ -1864,8 +1862,8 @@ public class ApplicationConnection {
// Parent-less components (like sub-windows) are relative to browser
// window.
if (parent == null) {
renderSpace = new RenderSpace(Window.getClientWidth(), Window
.getClientHeight());
renderSpace = new RenderSpace(Window.getClientWidth(),
Window.getClientHeight());
} else {
renderSpace = parent.getAllocatedSpace(widget);
}
@@ -1902,22 +1900,20 @@ public class ApplicationConnection {

if (debugSizes) {
getConsole()
.log(
"Widget "
+ Util.getSimpleName(widget)
+ "/"
+ getPid(widget.getElement())
+ " relative height "
+ relativeSize.getHeight()
+ "% of "
+ renderSpace.getHeight()
+ "px (reported by "

+ Util.getSimpleName(parent)
+ "/"
+ (parent == null ? "?" : parent
.hashCode()) + ") : "
+ height + "px");
.log("Widget "
+ Util.getSimpleName(widget)
+ "/"
+ getPid(widget.getElement())
+ " relative height "
+ relativeSize.getHeight()
+ "% of "
+ renderSpace.getHeight()
+ "px (reported by "

+ Util.getSimpleName(parent)
+ "/"
+ (parent == null ? "?" : parent.hashCode())
+ ") : " + height + "px");
}
widget.setHeight(height + "px");
} else {
@@ -2085,9 +2081,8 @@ public class ApplicationConnection {
if (uidlUri.startsWith("theme://")) {
final String themeUri = configuration.getThemeUri();
if (themeUri == null) {
console
.error("Theme not set: ThemeResource will not be found. ("
+ uidlUri + ")");
console.error("Theme not set: ThemeResource will not be found. ("
+ uidlUri + ")");
}
uidlUri = themeUri + uidlUri.substring(7);
}

+ 2
- 2
src/com/vaadin/terminal/gwt/client/ClientExceptionHandler.java View File

@@ -16,8 +16,8 @@ public class ClientExceptionHandler {

if (console != null) {
console.error(msg);
// } else {
// System.err.println(msg);
// } else {
// System.err.println(msg);
}
}


+ 4
- 4
src/com/vaadin/terminal/gwt/client/ComponentLocator.java View File

@@ -59,12 +59,12 @@ public class ComponentLocator {
* The {@link #getElementByPath(String)} method can be used for the inverse
* operation, i.e. locating an element based on the return value from this
* method.
*<p>
* <p>
* Note that getElementByPath(getPathForElement(element)) == element is not
* always true as {@link #getPathForElement(Element)} can return a path to
* another element if the widget determines an action on the other element
* will give the same result as the action on the target element.
*</p>
* </p>
*
* @since 5.4
* @param targetElement
@@ -153,8 +153,8 @@ public class ComponentLocator {
*
* @param targetElement
* @param ancestorWidget
* @return The widget whose root element is a parent of {@code
* targetElement}.
* @return The widget whose root element is a parent of
* {@code targetElement}.
*/
private Widget findParentWidget(Element targetElement, Widget ancestorWidget) {
/*

+ 3
- 3
src/com/vaadin/terminal/gwt/client/DateTimeService.java View File

@@ -129,8 +129,8 @@ public class DateTimeService {
}
public int getStartWeekDay(Date date) {
final Date dateForFirstOfThisMonth = new Date(date.getYear(), date
.getMonth(), 1);
final Date dateForFirstOfThisMonth = new Date(date.getYear(),
date.getMonth(), 1);
int firstDay;
try {
firstDay = LocaleService.getFirstDayOfWeek(currentLocale);
@@ -153,7 +153,7 @@ public class DateTimeService {
if (date == null) {
return 0;
}
return (int) (date.getTime() - date.getTime() / 1000 * 1000);
}

+ 2
- 2
src/com/vaadin/terminal/gwt/client/RenderInformation.java View File

@@ -41,8 +41,8 @@ public class RenderInformation {
* @return true if the size has changed since last update
*/
public boolean updateSize(Element element) {
Size newSize = new Size(element.getOffsetWidth(), element
.getOffsetHeight());
Size newSize = new Size(element.getOffsetWidth(),
element.getOffsetHeight());
if (newSize.equals(renderedSize)) {
return false;
} else {

+ 2
- 2
src/com/vaadin/terminal/gwt/client/Util.java View File

@@ -406,8 +406,8 @@ public class Util {
setHeight(widget, "");
return paddingBorderGuess;
} else if (height.endsWith("px")) {
int pixelHeight = Integer.parseInt(height.substring(0, height
.length() - 2));
int pixelHeight = Integer.parseInt(height.substring(0,
height.length() - 2));
return setHeightExcludingPaddingAndBorder(widget.getElement(),
pixelHeight, paddingBorderGuess, false);
} else {

+ 1
- 2
src/com/vaadin/terminal/gwt/client/VCaption.java View File

@@ -277,8 +277,7 @@ public class VCaption extends HTML {
} else {
ApplicationConnection
.getConsole()
.log(
"Warning: Icon load event was not propagated because VCaption owner is unknown.");
.log("Warning: Icon load event was not propagated because VCaption owner is unknown.");
}
}
}

+ 4
- 4
src/com/vaadin/terminal/gwt/client/VDebugConsole.java View File

@@ -289,8 +289,8 @@ public final class VDebugConsole extends VOverlay implements Console {

private void minimize() {
setPixelSize(400, 150);
setPopupPosition(Window.getClientWidth() - 410, Window
.getClientHeight() - 160);
setPopupPosition(Window.getClientWidth() - 410,
Window.getClientHeight() - 160);
}

@Override
@@ -500,8 +500,8 @@ public final class VDebugConsole extends VOverlay implements Console {
public void onClick(ClickEvent event) {
if (paintable != null) {
Element element2 = ((Widget) paintable).getElement();
Widget.setStyleName(element2, "invalidlayout", emphasisInUi
.getValue());
Widget.setStyleName(element2, "invalidlayout",
emphasisInUi.getValue());
}
}
});

+ 5
- 3
src/com/vaadin/terminal/gwt/client/VErrorMessage.java View File

@@ -58,9 +58,11 @@ public class VErrorMessage extends FlowPanel {
errorContainer = new VOverlay();
errorContainer.setWidget(this);
}
errorContainer.setPopupPosition(DOM.getAbsoluteLeft(indicatorElement)
+ 2
* DOM.getElementPropertyInt(indicatorElement, "offsetHeight"),
errorContainer.setPopupPosition(
DOM.getAbsoluteLeft(indicatorElement)
+ 2
* DOM.getElementPropertyInt(indicatorElement,
"offsetHeight"),
DOM.getAbsoluteTop(indicatorElement)
+ 2
* DOM.getElementPropertyInt(indicatorElement,

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

@@ -40,12 +40,12 @@ public abstract class ClickEventHandler implements DoubleClickHandler,

public void handleEventHandlerRegistration(ApplicationConnection client) {
this.client = client;
// Handle registering/unregistering of click handler depending on if
// server side listeners have been added or removed.
// Handle registering/unregistering of click handler depending on if
// server side listeners have been added or removed.
if (hasEventListener()) {
if (mouseUpHandlerRegistration == null) {
mouseUpHandlerRegistration = registerHandler(this, MouseUpEvent
.getType());
mouseUpHandlerRegistration = registerHandler(this,
MouseUpEvent.getType());
contextMenuHandlerRegistration = registerHandler(this,
ContextMenuEvent.getType());
doubleClickHandlerRegistration = registerHandler(this,
@@ -53,7 +53,7 @@ public abstract class ClickEventHandler implements DoubleClickHandler,
}
} else {
if (mouseUpHandlerRegistration != null) {
// Remove existing handlers
// Remove existing handlers
doubleClickHandlerRegistration.removeHandler();
mouseUpHandlerRegistration.removeHandler();
contextMenuHandlerRegistration.removeHandler();
@@ -94,19 +94,19 @@ public abstract class ClickEventHandler implements DoubleClickHandler,

public void onContextMenu(ContextMenuEvent event) {
if (hasEventListener()) {
// Prevent showing the browser's context menu when there is a right
// click listener.
// Prevent showing the browser's context menu when there is a right
// click listener.
event.preventDefault();
}

}

public void onMouseUp(MouseUpEvent event) {
// TODO For perfect accuracy we should check that a mousedown has
// occured on this element before this mouseup and that no mouseup
// has occured anywhere after that.
// TODO For perfect accuracy we should check that a mousedown has
// occured on this element before this mouseup and that no mouseup
// has occured anywhere after that.
if (hasEventListener()) {
// "Click" with left, right or middle button
// "Click" with left, right or middle button
fireClick(event.getNativeEvent());
}
}

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

@@ -411,12 +411,12 @@ public class MenuBar extends Widget implements PopupListener {
popup.addPopupListener(this);

if (vertical) {
popup.setPopupPosition(item.getAbsoluteLeft()
+ item.getOffsetWidth(), item.getAbsoluteTop());
popup.setPopupPosition(
item.getAbsoluteLeft() + item.getOffsetWidth(),
item.getAbsoluteTop());
} else {
popup.setPopupPosition(item.getAbsoluteLeft(), item
.getAbsoluteTop()
+ item.getOffsetHeight());
popup.setPopupPosition(item.getAbsoluteLeft(),
item.getAbsoluteTop() + item.getOffsetHeight());
}

shownChildMenu = item.getSubMenu();

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

@@ -103,8 +103,8 @@ public class ShortcutActionHandler {
modifiers = action.getIntArrayAttribute("mk");
}

final ShortcutKeyCombination kc = new ShortcutKeyCombination(action
.getIntAttribute("kc"), modifiers);
final ShortcutKeyCombination kc = new ShortcutKeyCombination(
action.getIntAttribute("kc"), modifiers);
final String key = action.getStringAttribute("key");
final String caption = action.getStringAttribute("caption");
actions.add(new ShortcutAction(key, kc, caption));

+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java View File

@@ -7,8 +7,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.Set;

import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;

+ 4
- 8
src/com/vaadin/terminal/gwt/client/ui/VAccordion.java View File

@@ -238,9 +238,7 @@ public class VAccordion extends VTabsheetBase implements
if (index != activeTabIndex && !disabled && !readonly
&& !disabledTabKeys.contains(tabKeys.get(index))) {
addStyleDependentName("loading");
client
.updateVariable(id, "selected", "" + tabKeys.get(index),
true);
client.updateVariable(id, "selected", "" + tabKeys.get(index), true);
}
}

@@ -367,9 +365,7 @@ public class VAccordion extends VTabsheetBase implements
} else {
super.setHeight((height + getCaptionHeight()) + "px");
DOM.setStyleAttribute(content, "height", height + "px");
DOM
.setStyleAttribute(content, "top", getCaptionHeight()
+ "px");
DOM.setStyleAttribute(content, "top", getCaptionHeight() + "px");

}
}
@@ -408,8 +404,8 @@ public class VAccordion extends VTabsheetBase implements
}

int captionWidth = caption.getRequiredWidth();
int padding = Util.measureHorizontalPaddingAndBorder(caption
.getElement(), 18);
int padding = Util.measureHorizontalPaddingAndBorder(
caption.getElement(), 18);
return captionWidth + padding;
}


+ 14
- 14
src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java View File

@@ -1511,9 +1511,9 @@ public class VCalendarPanel extends FocusableFlexTable implements
}
value.setHours(h);
if (timeChangeListener != null) {
timeChangeListener.changed(h, value.getMinutes(), value
.getSeconds(), DateTimeService
.getMilliseconds(value));
timeChangeListener.changed(h, value.getMinutes(),
value.getSeconds(),
DateTimeService.getMilliseconds(value));
}
event.preventDefault();
event.stopPropagation();
@@ -1521,9 +1521,9 @@ public class VCalendarPanel extends FocusableFlexTable implements
final int m = mins.getSelectedIndex();
value.setMinutes(m);
if (timeChangeListener != null) {
timeChangeListener.changed(value.getHours(), m, value
.getSeconds(), DateTimeService
.getMilliseconds(value));
timeChangeListener.changed(value.getHours(), m,
value.getSeconds(),
DateTimeService.getMilliseconds(value));
}
event.preventDefault();
event.stopPropagation();
@@ -1531,9 +1531,9 @@ public class VCalendarPanel extends FocusableFlexTable implements
final int s = sec.getSelectedIndex();
value.setSeconds(s);
if (timeChangeListener != null) {
timeChangeListener.changed(value.getHours(), value
.getMinutes(), s, DateTimeService
.getMilliseconds(value));
timeChangeListener.changed(value.getHours(),
value.getMinutes(), s,
DateTimeService.getMilliseconds(value));
}
event.preventDefault();
event.stopPropagation();
@@ -1541,8 +1541,8 @@ public class VCalendarPanel extends FocusableFlexTable implements
final int ms = msec.getSelectedIndex();
DateTimeService.setMilliseconds(value, ms);
if (timeChangeListener != null) {
timeChangeListener.changed(value.getHours(), value
.getMinutes(), value.getSeconds(), ms);
timeChangeListener.changed(value.getHours(),
value.getMinutes(), value.getSeconds(), ms);
}
event.preventDefault();
event.stopPropagation();
@@ -1551,9 +1551,9 @@ public class VCalendarPanel extends FocusableFlexTable implements
+ (ampm.getSelectedIndex() * 12);
value.setHours(h);
if (timeChangeListener != null) {
timeChangeListener.changed(h, value.getMinutes(), value
.getSeconds(), DateTimeService
.getMilliseconds(value));
timeChangeListener.changed(h, value.getMinutes(),
value.getSeconds(),
DateTimeService.getMilliseconds(value));
}
event.preventDefault();
event.stopPropagation();

+ 6
- 6
src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java View File

@@ -99,8 +99,8 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
}
clickEventHandler.handleEventHandlerRegistration(client);

final VMarginInfo margins = new VMarginInfo(uidl
.getIntAttribute("margins"));
final VMarginInfo margins = new VMarginInfo(
uidl.getIntAttribute("margins"));
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP,
margins.hasTop());
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT,
@@ -110,8 +110,8 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT,
margins.hasLeft());

setStyleName(margin, CLASSNAME + "-" + "spacing", uidl
.hasAttribute("spacing"));
setStyleName(margin, CLASSNAME + "-" + "spacing",
uidl.hasAttribute("spacing"));
panel.updateFromUIDL(uidl, client);
rendering = false;
}
@@ -184,8 +184,8 @@ public class VCssLayout extends SimplePanel implements Paintable, Container {
continue;
} else {
style.setProperty(
makeCamelCase(rule[0].trim()), rule[1]
.trim());
makeCamelCase(rule[0].trim()),
rule[1].trim());
}
}
} catch (Exception e) {

+ 6
- 6
src/com/vaadin/terminal/gwt/client/ui/VCustomLayout.java View File

@@ -21,12 +21,12 @@ import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.ContainerResizedListener;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.VCaptionWrapper;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;

/**
* Custom Layout implements complex layout defined with HTML template.
@@ -530,9 +530,9 @@ public class VCustomLayout extends ComplexPanel implements Paintable,
.getParentElement();

FloatSize extra = locationToExtraSize.get(getLocation(child));
return new RenderSpace(pe.getOffsetWidth() - (int) extra.getWidth(), pe
.getOffsetHeight()
- (int) extra.getHeight(), Util.mayHaveScrollBars(pe));
return new RenderSpace(pe.getOffsetWidth() - (int) extra.getWidth(),
pe.getOffsetHeight() - (int) extra.getHeight(),
Util.mayHaveScrollBars(pe));
}

@Override
@@ -604,8 +604,8 @@ public class VCustomLayout extends ComplexPanel implements Paintable,
|| (relativeHeight && (relativeSize.getHeight() >= 0.0f))) {

relativeSizeWidgets.add(widget);
widget.getElement().getStyle().setProperty("position",
"absolute");
widget.getElement().getStyle()
.setProperty("position", "absolute");
}
}
}

+ 4
- 4
src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java View File

@@ -20,9 +20,9 @@ import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
import com.vaadin.terminal.gwt.client.ui.dd.HorizontalDropLocation;
import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
@@ -33,9 +33,9 @@ import com.vaadin.terminal.gwt.client.ui.dd.VDropHandler;
import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
import com.vaadin.terminal.gwt.client.ui.dd.VHtml5DragEvent;
import com.vaadin.terminal.gwt.client.ui.dd.VHtml5File;
import com.vaadin.terminal.gwt.client.ui.dd.VHtml5File.Callback;
import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
import com.vaadin.terminal.gwt.client.ui.dd.VHtml5File.Callback;

/**
*
@@ -77,8 +77,8 @@ public class VDragAndDropWrapper extends VCustomComponent implements
if (dragStarMode == WRAPPER) {
startDrag.createDragImage(getElement(), true);
} else {
startDrag.createDragImage(((Widget) paintable)
.getElement(), true);
startDrag.createDragImage(
((Widget) paintable).getElement(), true);
}
event.preventDefault(); // prevent text selection


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

@@ -121,8 +121,8 @@ public class VEmbedded extends HTML implements Paintable {
+ uidl.getId() + "\"></iframe>");
browserElement = DOM.getFirstChild(getElement());
} else {
DOM.setElementAttribute(browserElement, "src", getSrc(uidl,
client));
DOM.setElementAttribute(browserElement, "src",
getSrc(uidl, client));
}
clearBrowserElement = false;
} else {

+ 4
- 6
src/com/vaadin/terminal/gwt/client/ui/VForm.java View File

@@ -180,8 +180,8 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler {
if (childUidl != null) {
if (shortcutHandler == null) {
shortcutHandler = new ShortcutActionHandler(id, client);
keyDownRegistration = addDomHandler(this, KeyDownEvent
.getType());
keyDownRegistration = addDomHandler(this,
KeyDownEvent.getType());
}
shortcutHandler.updateActionMap(childUidl);
}
@@ -199,14 +199,12 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler {
renderInformation.updateSize(getElement());
renderInformation.setContentAreaHeight(renderInformation
.getRenderedSize().getHeight()
- getSpaceConsumedVertically());
.getRenderedSize().getHeight() - getSpaceConsumedVertically());
if (BrowserInfo.get().isIE6()) {
getElement().getStyle().setProperty("overflow", "hidden");
}
renderInformation.setContentAreaWidth(renderInformation
.getRenderedSize().getWidth()
- borderPaddingHorizontal);
.getRenderedSize().getWidth() - borderPaddingHorizontal);
}
public RenderSpace getAllocatedSpace(Widget child) {

+ 8
- 8
src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java View File

@@ -89,8 +89,8 @@ public class VFormLayout extends SimplePanel implements Container {
}

public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
final VMarginInfo margins = new VMarginInfo(uidl
.getIntAttribute("margins"));
final VMarginInfo margins = new VMarginInfo(
uidl.getIntAttribute("margins"));

Element margin = getElement();
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP,
@@ -98,13 +98,13 @@ public class VFormLayout extends SimplePanel implements Container {
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT,
margins.hasRight());
setStyleName(margin,
CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM, margins
.hasBottom());
CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM,
margins.hasBottom());
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT,
margins.hasLeft());

setStyleName(margin, CLASSNAME + "-" + "spacing", uidl
.hasAttribute("spacing"));
setStyleName(margin, CLASSNAME + "-" + "spacing",
uidl.hasAttribute("spacing"));

int i = 0;
for (final Iterator it = uidl.getChildIterator(); it.hasNext(); i++) {
@@ -336,8 +336,8 @@ public class VFormLayout extends SimplePanel implements Container {
public void updateCaption(UIDL uidl) {
setVisible(!uidl.getBooleanAttribute("invisible"));

setStyleName(getElement(), "v-disabled", uidl
.hasAttribute("disabled"));
setStyleName(getElement(), "v-disabled",
uidl.hasAttribute("disabled"));

boolean isEmpty = true;


+ 6
- 6
src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java View File

@@ -285,8 +285,8 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
Cell c = column[j];
if (c != null && c.cc != null
&& c.widthCanAffectHeight()) {
c.cc.setContainerSize(c.getAvailableWidth(), c
.getAvailableHeight());
c.cc.setContainerSize(c.getAvailableWidth(),
c.getAvailableHeight());
client.handleComponentRelativeSize(c.cc
.getWidget());
c.cc.updateWidgetSize();
@@ -621,8 +621,8 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
}

private void handleMargins(UIDL uidl) {
final VMarginInfo margins = new VMarginInfo(uidl
.getIntAttribute("margins"));
final VMarginInfo margins = new VMarginInfo(
uidl.getIntAttribute("margins"));

String styles = CLASSNAME + "-margin";
if (margins.hasTop()) {
@@ -657,8 +657,8 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
componentContainer.setWidget(newComponent);
widgetToComponentContainer.put(newComponent, componentContainer);

paintableToCell.put((Paintable) newComponent, paintableToCell
.get(oldComponent));
paintableToCell.put((Paintable) newComponent,
paintableToCell.get(oldComponent));
}

public void updateCaption(Paintable component, UIDL uidl) {

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

@@ -48,8 +48,8 @@ public class VListSelect extends VOptionGroupBase {
}
for (final Iterator i = uidl.getChildIterator(); i.hasNext();) {
final UIDL optionUidl = (UIDL) i.next();
select.addItem(optionUidl.getStringAttribute("caption"), optionUidl
.getStringAttribute("key"));
select.addItem(optionUidl.getStringAttribute("caption"),
optionUidl.getStringAttribute("key"));
if (optionUidl.hasAttribute("selected")) {
select.setItemSelected(select.getItemCount() - 1, true);
}

+ 15
- 18
src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java View File

@@ -226,12 +226,10 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
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>");

@@ -381,8 +379,8 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
if (items.contains(item)) {
int index = items.indexOf(item);

DOM.removeChild(getContainerElement(), DOM.getChild(
getContainerElement(), index));
DOM.removeChild(getContainerElement(),
DOM.getChild(getContainerElement(), index));
items.remove(index);
}
}
@@ -551,8 +549,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
popup.show();

if (left + popup.getOffsetWidth() >= RootPanel.getBodyElement()
.getOffsetWidth()
- shadowSpace) {
.getOffsetWidth() - shadowSpace) {
if (subMenu) {
left = item.getParentMenu().getAbsoluteLeft()
- popup.getOffsetWidth() - shadowSpace;
@@ -580,8 +577,8 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
}

if (popup.getElement().getStyle().getProperty("width") == null
|| popup.getElement().getStyle().getProperty(
"width") == "") {
|| popup.getElement().getStyle()
.getProperty("width") == "") {
popup.setWidth(popup.getOffsetWidth() + "px");
}
popup.getElement().getStyle().setProperty("zoom", "1");
@@ -920,9 +917,9 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
* .gwt.event.dom.client.KeyPressEvent)
*/
public void onKeyPress(KeyPressEvent event) {
if (handleNavigation(event.getNativeEvent().getKeyCode(), event
.isControlKeyDown()
|| event.isMetaKeyDown(), event.isShiftKeyDown())) {
if (handleNavigation(event.getNativeEvent().getKeyCode(),
event.isControlKeyDown() || event.isMetaKeyDown(),
event.isShiftKeyDown())) {
event.preventDefault();
}
}
@@ -935,9 +932,9 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
* .event.dom.client.KeyDownEvent)
*/
public void onKeyDown(KeyDownEvent event) {
if (handleNavigation(event.getNativeEvent().getKeyCode(), event
.isControlKeyDown()
|| event.isMetaKeyDown(), event.isShiftKeyDown())) {
if (handleNavigation(event.getNativeEvent().getKeyCode(),
event.isControlKeyDown() || event.isMetaKeyDown(),
event.isShiftKeyDown())) {
event.preventDefault();
}
}

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

@@ -40,8 +40,8 @@ public class VNativeSelect extends VOptionGroupBase implements Field {
boolean selected = false;
for (final Iterator i = uidl.getChildIterator(); i.hasNext();) {
final UIDL optionUidl = (UIDL) i.next();
select.addItem(optionUidl.getStringAttribute("caption"), optionUidl
.getStringAttribute("key"));
select.addItem(optionUidl.getStringAttribute("caption"),
optionUidl.getStringAttribute("key"));
if (optionUidl.hasAttribute("selected")) {
select.setItemSelected(select.getItemCount() - 1, true);
selected = true;

+ 1
- 3
src/com/vaadin/terminal/gwt/client/ui/VOptionGroupBase.java View File

@@ -197,9 +197,7 @@ abstract class VOptionGroupBase extends Composite implements Paintable, Field,
public void onChange(ChangeEvent event) {
if (multiselect) {
client
.updateVariable(id, "selected", getSelectedItems(),
immediate);
client.updateVariable(id, "selected", getSelectedItems(), immediate);
} else {
client.updateVariable(id, "selected", new String[] { ""
+ getSelectedItem() }, immediate);

+ 67
- 67
src/com/vaadin/terminal/gwt/client/ui/VOrderedLayout.java View File

@@ -16,12 +16,12 @@ 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.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ValueMap;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.ui.layout.CellBasedLayout;
import com.vaadin.terminal.gwt.client.ui.layout.ChildComponentContainer;

@@ -33,7 +33,7 @@ public class VOrderedLayout extends CellBasedLayout {

private int orientation;

// Can be removed once OrderedLayout is removed
// Can be removed once OrderedLayout is removed
private boolean allowOrientationUpdate = false;

/**
@@ -91,7 +91,7 @@ public class VOrderedLayout extends CellBasedLayout {
isRendering = true;
super.updateFromUIDL(uidl, client);

// Only non-cached, visible UIDL:s can introduce changes
// Only non-cached, visible UIDL:s can introduce changes
if (uidl.getBooleanAttribute("cached")
|| uidl.getBooleanAttribute("invisible")) {
isRendering = false;
@@ -104,10 +104,10 @@ public class VOrderedLayout extends CellBasedLayout {
handleOrientationUpdate(uidl);
}

// IStopWatch w = new IStopWatch("OrderedLayout.updateFromUIDL");
// IStopWatch w = new IStopWatch("OrderedLayout.updateFromUIDL");

ArrayList<Widget> uidlWidgets = new ArrayList<Widget>(uidl
.getChildCount());
ArrayList<Widget> uidlWidgets = new ArrayList<Widget>(
uidl.getChildCount());
ArrayList<ChildComponentContainer> relativeSizeComponents = new ArrayList<ChildComponentContainer>();
ArrayList<UIDL> relativeSizeComponentUIDL = new ArrayList<UIDL>();

@@ -117,11 +117,11 @@ public class VOrderedLayout extends CellBasedLayout {
final Paintable child = client.getPaintable(childUIDL);
Widget widget = (Widget) child;

// Create container for component
// Create container for component
ChildComponentContainer childComponentContainer = getComponentContainer(widget);

if (childComponentContainer == null) {
// This is a new component
// This is a new component
childComponentContainer = createChildContainer(widget);
}

@@ -148,8 +148,8 @@ public class VOrderedLayout extends CellBasedLayout {
activeLayoutSize.getWidth());
}
if (sizeHasChangedDuringRendering && Util.isCached(childUIDL)) {
// notify cached relative sized component about size
// chance
// notify cached relative sized component about size
// chance
client.handleComponentRelativeSize(childComponentContainer
.getWidget());
}
@@ -159,9 +159,9 @@ public class VOrderedLayout extends CellBasedLayout {

}

// w.mark("Rendering of "
// + (uidlWidgets.size() - relativeSizeComponents.size())
// + " absolute size components done");
// w.mark("Rendering of "
// + (uidlWidgets.size() - relativeSizeComponents.size())
// + " absolute size components done");

/*
* Remove any children after pos. These are the ones that previously
@@ -169,20 +169,20 @@ public class VOrderedLayout extends CellBasedLayout {
*/
removeChildrenAfter(pos);

// w.mark("Old children removed");
// w.mark("Old children removed");

/* Fetch alignments and expand ratio from UIDL */
updateAlignmentsAndExpandRatios(uidl, uidlWidgets);
// w.mark("Alignments and expand ratios updated");
// w.mark("Alignments and expand ratios updated");

/* Fetch widget sizes from rendered components */
updateWidgetSizes();
// w.mark("Widget sizes updated");
// w.mark("Widget sizes updated");

recalculateLayout();
// w.mark("Layout size calculated (" + activeLayoutSize +
// ") offsetSize: "
// + getOffsetWidth() + "," + getOffsetHeight());
// w.mark("Layout size calculated (" + activeLayoutSize +
// ") offsetSize: "
// + getOffsetWidth() + "," + getOffsetHeight());

/* Render relative size components */
for (int i = 0; i < relativeSizeComponents.size(); i++) {
@@ -207,11 +207,11 @@ public class VOrderedLayout extends CellBasedLayout {
.getWidget());
}

// childComponentContainer.updateWidgetSize();
// childComponentContainer.updateWidgetSize();
}

// w.mark("Rendering of " + (relativeSizeComponents.size())
// + " relative size components done");
// w.mark("Rendering of " + (relativeSizeComponents.size())
// + " relative size components done");

/* Fetch widget sizes for relative size components */
for (ChildComponentContainer childComponentContainer : widgetToComponentContainer
@@ -221,7 +221,7 @@ public class VOrderedLayout extends CellBasedLayout {
childComponentContainer.updateWidgetSize();
}

// w.mark("Widget sizes updated");
// w.mark("Widget sizes updated");

/*
* Components with relative size in main direction may affect the layout
@@ -231,7 +231,7 @@ public class VOrderedLayout extends CellBasedLayout {
|| (isVertical() && isDynamicWidth())) {
layoutSizeMightHaveChanged();
}
// w.mark("Layout dimensions updated");
// w.mark("Layout dimensions updated");

/* Update component spacing */
updateContainerMargins();
@@ -241,13 +241,13 @@ public class VOrderedLayout extends CellBasedLayout {
* direction
*/
if (updateRelativeSizesInNonMainDirection()) {
// Sizes updated - might affect the other dimension so we need to
// recheck the widget sizes and recalculate layout dimensions
// Sizes updated - might affect the other dimension so we need to
// recheck the widget sizes and recalculate layout dimensions
updateWidgetSizes();
layoutSizeMightHaveChanged();
}
calculateAlignments();
// w.mark("recalculateComponentSizesAndAlignments done");
// w.mark("recalculateComponentSizesAndAlignments done");

setRootSize();

@@ -260,14 +260,14 @@ public class VOrderedLayout extends CellBasedLayout {
root.getStyle().setProperty("zoom", "1");
}

// w.mark("runDescendentsLayout done");
// w.mark("runDescendentsLayout done");
isRendering = false;
sizeHasChangedDuringRendering = false;
}

private void layoutSizeMightHaveChanged() {
Size oldSize = new Size(activeLayoutSize.getWidth(), activeLayoutSize
.getHeight());
Size oldSize = new Size(activeLayoutSize.getWidth(),
activeLayoutSize.getHeight());
calculateLayoutDimensions();

/*
@@ -314,11 +314,11 @@ public class VOrderedLayout extends CellBasedLayout {

if (remaining > 0) {

// Some left-over pixels due to rounding errors
// Some left-over pixels due to rounding errors

// Add one pixel to each container until there are no pixels left
// FIXME extra pixels should be divided among expanded widgets if
// such a widgets exists
// Add one pixel to each container until there are no pixels left
// FIXME extra pixels should be divided among expanded widgets if
// such a widgets exists

Iterator<Widget> widgetIterator = iterator();
while (widgetIterator.hasNext() && remaining-- > 0) {
@@ -381,7 +381,7 @@ public class VOrderedLayout extends CellBasedLayout {
int maxWidgetWidth = 0;
int maxWidgetHeight = 0;

// Calculate layout dimensions from component dimensions
// Calculate layout dimensions from component dimensions
for (ChildComponentContainer childComponentContainer : widgetToComponentContainer
.values()) {

@@ -426,8 +426,8 @@ public class VOrderedLayout extends CellBasedLayout {
remainingSpace = 0;
}

// ApplicationConnection.getConsole().log(
// "Layout size: " + activeLayoutSize);
// ApplicationConnection.getConsole().log(
// "Layout size: " + activeLayoutSize);
return remainingSpace;
}

@@ -463,14 +463,14 @@ public class VOrderedLayout extends CellBasedLayout {
int h = 0;

if (isHorizontal()) {
// HORIZONTAL
// HORIZONTAL
h = activeLayoutSize.getHeight();
if (!isDynamicWidth()) {
w = -1;
}

} else {
// VERTICAL
// VERTICAL
w = activeLayoutSize.getWidth();
if (!isDynamicHeight()) {
h = -1;
@@ -519,9 +519,9 @@ public class VOrderedLayout extends CellBasedLayout {
.widgetHasSizeSpecified(orientation)) {
int captionWidth = childComponentContainer
.getCaptionRequiredWidth();
// ApplicationConnection.getConsole().log(
// "Component width: " + width
// + ", caption width: " + captionWidth);
// ApplicationConnection.getConsole().log(
// "Component width: " + width
// + ", caption width: " + captionWidth);
if (captionWidth > width) {
width = captionWidth;
}
@@ -536,8 +536,8 @@ public class VOrderedLayout extends CellBasedLayout {
* Let the overflowing components overflow. IE has
* problems with zero sizes.
*/
// width = 0;
// height = 0;
// width = 0;
// height = 0;
} else if (width > availableWidth) {
width = availableWidth;

@@ -596,9 +596,9 @@ public class VOrderedLayout extends CellBasedLayout {
int activeLayoutWidth = 0;
int activeLayoutHeight = 0;

// Update layout dimensions
// Update layout dimensions
if (isHorizontal()) {
// Horizontal
// Horizontal
if (isDynamicWidth()) {
activeLayoutWidth = totalComponentWidth;
}
@@ -608,7 +608,7 @@ public class VOrderedLayout extends CellBasedLayout {
}

} else {
// Vertical
// Vertical
if (isDynamicWidth()) {
activeLayoutWidth = maxComponentWidth;
}
@@ -693,7 +693,7 @@ public class VOrderedLayout extends CellBasedLayout {

private ChildComponentContainer createChildContainer(Widget child) {

// Create a container DIV for the child
// Create a container DIV for the child
ChildComponentContainer childComponent = new ChildComponentContainer(
child, orientation);

@@ -705,29 +705,29 @@ public class VOrderedLayout extends CellBasedLayout {
int width = 0;
int height = 0;
ChildComponentContainer childComponentContainer = getComponentContainer(child);
// WIDTH CALCULATION
// WIDTH CALCULATION
if (isVertical()) {
width = activeLayoutSize.getWidth();
width -= childComponentContainer.getCaptionWidthAfterComponent();
} else if (!isDynamicWidth()) {
// HORIZONTAL
// HORIZONTAL
width = childComponentContainer.getContSize().getWidth();
width -= childComponentContainer.getCaptionWidthAfterComponent();
}

// HEIGHT CALCULATION
// HEIGHT CALCULATION
if (isHorizontal()) {
height = activeLayoutSize.getHeight();
height -= childComponentContainer.getCaptionHeightAboveComponent();
} else if (!isDynamicHeight()) {
// VERTICAL
// VERTICAL
height = childComponentContainer.getContSize().getHeight();
height -= childComponentContainer.getCaptionHeightAboveComponent();
}

// ApplicationConnection.getConsole().log(
// "allocatedSpace for " + Util.getSimpleName(child) + ": "
// + width + "," + height);
// ApplicationConnection.getConsole().log(
// "allocatedSpace for " + Util.getSimpleName(child) + ": "
// + width + "," + height);
RenderSpace space = new RenderSpace(width, height);
return space;
}
@@ -742,7 +742,7 @@ public class VOrderedLayout extends CellBasedLayout {
client.handleComponentRelativeSize(componentContainer
.getWidget());

// Update widget size from DOM
// Update widget size from DOM
componentContainer.updateWidgetSize();
}
}
@@ -778,13 +778,13 @@ public class VOrderedLayout extends CellBasedLayout {
for (Paintable p : children) {
/* Update widget size from DOM */
ChildComponentContainer componentContainer = getComponentContainer((Widget) p);
// This should no longer be needed (after #2563)
// if (isDynamicWidth()) {
// componentContainer.setUnlimitedContainerWidth();
// } else {
// componentContainer.setLimitedContainerWidth(activeLayoutSize
// .getWidth());
// }
// This should no longer be needed (after #2563)
// if (isDynamicWidth()) {
// componentContainer.setUnlimitedContainerWidth();
// } else {
// componentContainer.setLimitedContainerWidth(activeLayoutSize
// .getWidth());
// }

componentContainer.updateWidgetSize();

@@ -890,10 +890,10 @@ public class VOrderedLayout extends CellBasedLayout {

ChildComponentContainer container = getComponentContainer(widget);

// Calculate alignment info
// Calculate alignment info
container.setAlignment(getAlignment(pid));

// Update expand ratio
// Update expand ratio
container.setNormalizedExpandRatio(getExpandRatio(pid));
}
}
@@ -915,7 +915,7 @@ public class VOrderedLayout extends CellBasedLayout {
expandRatioSum += expandRatios.getRawNumber(keyArray.get(i));
}
if (expandRatioSum == 0) {
// by default split equally among components
// by default split equally among components
defaultExpandRatio = 1.0 / widgetToComponentContainer.size();
} else {
defaultExpandRatio = 0;

+ 12
- 6
src/com/vaadin/terminal/gwt/client/ui/VOverlay.java View File

@@ -271,12 +271,18 @@ public class VOverlay extends PopupPanel {
// Opera fix, part 2 (ticket #2704)
if (BrowserInfo.get().isOpera()) {
// We'll fix the height of all the middle elements
DOM.getChild(shadow, 3).getStyle().setPropertyPx("height",
DOM.getChild(shadow, 3).getOffsetHeight());
DOM.getChild(shadow, 4).getStyle().setPropertyPx("height",
DOM.getChild(shadow, 4).getOffsetHeight());
DOM.getChild(shadow, 5).getStyle().setPropertyPx("height",
DOM.getChild(shadow, 5).getOffsetHeight());
DOM.getChild(shadow, 3)
.getStyle()
.setPropertyPx("height",
DOM.getChild(shadow, 3).getOffsetHeight());
DOM.getChild(shadow, 4)
.getStyle()
.setPropertyPx("height",
DOM.getChild(shadow, 4).getOffsetHeight());
DOM.getChild(shadow, 5)
.getStyle()
.setPropertyPx("height",
DOM.getChild(shadow, 5).getOffsetHeight());
}

// Attach to dom if not there already

+ 1
- 3
src/com/vaadin/terminal/gwt/client/ui/VPanel.java View File

@@ -405,9 +405,7 @@ public class VPanel extends SimplePanel implements Container,
if (containerHeight < 0) {
containerHeight = 0;
}
DOM
.setStyleAttribute(contentNode, "height", containerHeight
+ "px");
DOM.setStyleAttribute(contentNode, "height", containerHeight + "px");
} else {
DOM.setStyleAttribute(contentNode, "height", "");
}

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

@@ -268,8 +268,8 @@ public class VPopupCalendar extends VTextualDate implements Paintable, Field,
popup.setWidth(w + "px");
popup.setHeight(h + "px");
popup.setPopupPosition(l, t
+ calendarToggle.getOffsetHeight() + 2);
popup.setPopupPosition(l,
t + calendarToggle.getOffsetHeight() + 2);
Date end = new Date();

+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/VPopupView.java View File

@@ -26,13 +26,13 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.VCaptionWrapper;
import com.vaadin.terminal.gwt.client.VTooltip;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;

public class VPopupView extends HTML implements Container, Iterable<Widget> {

+ 60
- 64
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java View File

@@ -485,13 +485,14 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
}

// Send the selected row ranges
client.updateVariable(paintableId, "selectedRanges", ranges
.toArray(new String[selectedRowRanges.size()]), false);
client.updateVariable(paintableId, "selectedRanges",
ranges.toArray(new String[selectedRowRanges.size()]), false);
}

// Send the selected rows
client.updateVariable(paintableId, "selected", selectedRowKeys
.toArray(new String[selectedRowKeys.size()]), immediate);
client.updateVariable(paintableId, "selected",
selectedRowKeys.toArray(new String[selectedRowKeys.size()]),
immediate);

}

@@ -758,8 +759,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
updateFooter(uidl.getStringArrayAttribute("vcolorder"));

if (!recalcWidths && initializedAndAttached) {
updateBody(rowData, uidl.getIntAttribute("firstrow"), uidl
.getIntAttribute("rows"));
updateBody(rowData, uidl.getIntAttribute("firstrow"),
uidl.getIntAttribute("rows"));
if (headerChangedDuringUpdate) {
lazyAdjustColumnWidths.schedule(1);
} else {
@@ -780,8 +781,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
}
scrollBody = createScrollBody();

scrollBody.renderInitialRows(rowData, uidl
.getIntAttribute("firstrow"), uidl.getIntAttribute("rows"));
scrollBody.renderInitialRows(rowData,
uidl.getIntAttribute("firstrow"),
uidl.getIntAttribute("rows"));
scrollBodyPanel.add(scrollBody);
initialContentReceived = true;
if (isAttached()) {
@@ -1833,8 +1835,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
.getChild(floatingCopyOfHeaderCell, 1);
DOM.setElementProperty(floatingCopyOfHeaderCell, "className",
CLASSNAME + "-header-drag");
updateFloatingCopysPosition(DOM.getAbsoluteLeft(td), DOM
.getAbsoluteTop(td));
updateFloatingCopysPosition(DOM.getAbsoluteLeft(td),
DOM.getAbsoluteTop(td));
DOM.appendChild(RootPanel.get().getElement(),
floatingCopyOfHeaderCell);
}
@@ -1866,8 +1868,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (client.hasEventListeners(VScrollTable.this,
HEADER_CLICK_EVENT_ID)) {
MouseEventDetails details = new MouseEventDetails(event);
client.updateVariable(paintableId, "headerClickEvent", details
.toString(), false);
client.updateVariable(paintableId, "headerClickEvent",
details.toString(), false);
client.updateVariable(paintableId, "headerClickCID", cid, true);
}
}
@@ -2052,8 +2054,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// cols)

final int hw = ((Element) getElement().getLastChild())
.getOffsetWidth()
+ scrollBody.getCellExtraWidth();
.getOffsetWidth() + scrollBody.getCellExtraWidth();
if (columnIndex < 0) {
columnIndex = 0;
for (Iterator<Widget> it = tHead.iterator(); it
@@ -2340,13 +2341,15 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
private void focusSlot(int index) {
removeSlotFocus();
if (index > 0) {
DOM.setElementProperty(DOM.getFirstChild(DOM.getChild(tr,
index - 1)), "className", CLASSNAME + "-resizer "
+ CLASSNAME + "-focus-slot-right");
DOM.setElementProperty(
DOM.getFirstChild(DOM.getChild(tr, index - 1)),
"className", CLASSNAME + "-resizer " + CLASSNAME
+ "-focus-slot-right");
} else {
DOM.setElementProperty(DOM.getFirstChild(DOM
.getChild(tr, index)), "className", CLASSNAME
+ "-resizer " + CLASSNAME + "-focus-slot-left");
DOM.setElementProperty(
DOM.getFirstChild(DOM.getChild(tr, index)),
"className", CLASSNAME + "-resizer " + CLASSNAME
+ "-focus-slot-left");
}
focusedSlot = index;
}
@@ -2356,11 +2359,13 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
return;
}
if (focusedSlot == 0) {
DOM.setElementProperty(DOM.getFirstChild(DOM.getChild(tr,
focusedSlot)), "className", CLASSNAME + "-resizer");
DOM.setElementProperty(
DOM.getFirstChild(DOM.getChild(tr, focusedSlot)),
"className", CLASSNAME + "-resizer");
} else if (focusedSlot > 0) {
DOM.setElementProperty(DOM.getFirstChild(DOM.getChild(tr,
focusedSlot - 1)), "className", CLASSNAME + "-resizer");
DOM.setElementProperty(
DOM.getFirstChild(DOM.getChild(tr, focusedSlot - 1)),
"className", CLASSNAME + "-resizer");
}
focusedSlot = -1;
}
@@ -2467,8 +2472,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
for (int i = 0; i < cols.length; i++) {
final String cid = (String) cols[i];
final HeaderCell c = getHeaderCell(cid);
final VisibleColumnAction a = new VisibleColumnAction(c
.getColKey());
final VisibleColumnAction a = new VisibleColumnAction(
c.getColKey());
a.setCaption(c.getCaption());
if (!c.isEnabled()) {
a.setCollapsed(true);
@@ -2740,8 +2745,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (client.hasEventListeners(VScrollTable.this,
FOOTER_CLICK_EVENT_ID)) {
MouseEventDetails details = new MouseEventDetails(event);
client.updateVariable(paintableId, "footerClickEvent", details
.toString(), false);
client.updateVariable(paintableId, "footerClickEvent",
details.toString(), false);
client.updateVariable(paintableId, "footerClickCID", cid, true);
}
}
@@ -2775,8 +2780,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// cols)

final int hw = ((Element) getElement().getLastChild())
.getOffsetWidth()
+ scrollBody.getCellExtraWidth();
.getOffsetWidth() + scrollBody.getCellExtraWidth();
if (columnIndex < 0) {
columnIndex = 0;
for (Iterator<Widget> it = tHead.iterator(); it
@@ -3285,8 +3289,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (row.isSelected()) {
row.addStyleName("v-selected");
}
tBodyElement.insertBefore(row.getElement(), tBodyElement
.getFirstChild());
tBodyElement.insertBefore(row.getElement(),
tBodyElement.getFirstChild());
adopt(row);
renderedRows.add(0, row);
}
@@ -3737,8 +3741,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
public boolean remove(Widget w) {
if (childWidgets.contains(w)) {
orphan(w);
DOM.removeChild(DOM.getParent(w.getElement()), w
.getElement());
DOM.removeChild(DOM.getParent(w.getElement()),
w.getElement());
childWidgets.remove(w);
return true;
} else {
@@ -3771,14 +3775,13 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// select event, even though nullselectionallowed wont let
// the change trough. Will need to be updated if that is
// changed.
client
.updateVariable(
paintableId,
"clickEvent",
details.toString(),
!(event.getButton() == Event.BUTTON_LEFT
&& !doubleClick
&& selectMode > Table.SELECT_MODE_NONE && immediate));
client.updateVariable(
paintableId,
"clickEvent",
details.toString(),
!(event.getButton() == Event.BUTTON_LEFT
&& !doubleClick
&& selectMode > Table.SELECT_MODE_NONE && immediate));
}
}

@@ -4167,8 +4170,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
final Action[] actions = new Action[actionKeys.length];
for (int i = 0; i < actions.length; i++) {
final String actionKey = actionKeys[i];
final TreeAction a = new TreeAction(this, String
.valueOf(rowKey), actionKey);
final TreeAction a = new TreeAction(this,
String.valueOf(rowKey), actionKey);
a.setCaption(getActionCaption(actionKey));
a.setIconUrl(getActionIcon(actionKey));
actions[i] = a;
@@ -4569,8 +4572,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
String s = uidl.getStringAttribute("caption");
if (uidl.hasAttribute("icon")) {
s = "<img src=\""
+ client
.translateVaadinUri(uidl.getStringAttribute("icon"))
+ client.translateVaadinUri(uidl.getStringAttribute("icon"))
+ "\" alt=\"icon\" class=\"v-icon\">" + s;
}
return s;
@@ -4947,8 +4949,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// Down navigation
if (selectMode == SELECT_MODE_NONE && keycode == getNavigationDownKey()) {
scrollBodyPanel.setScrollPosition(scrollBodyPanel
.getScrollPosition()
+ scrollingVelocity);
.getScrollPosition() + scrollingVelocity);
return true;
} else if (keycode == getNavigationDownKey()) {
if (selectMode == SELECT_MODE_MULTI && moveFocusDown()) {
@@ -4964,8 +4965,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
// Up navigation
if (selectMode == SELECT_MODE_NONE && keycode == getNavigationUpKey()) {
scrollBodyPanel.setScrollPosition(scrollBodyPanel
.getScrollPosition()
- scrollingVelocity);
.getScrollPosition() - scrollingVelocity);
return true;
} else if (keycode == getNavigationUpKey()) {
if (selectMode == SELECT_MODE_MULTI && moveFocusUp()) {
@@ -4980,15 +4980,13 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (keycode == getNavigationLeftKey()) {
// Left navigation
scrollBodyPanel.setHorizontalScrollPosition(scrollBodyPanel
.getHorizontalScrollPosition()
- scrollingVelocity);
.getHorizontalScrollPosition() - scrollingVelocity);
return true;

} else if (keycode == getNavigationRightKey()) {
// Right navigation
scrollBodyPanel.setHorizontalScrollPosition(scrollBodyPanel
.getHorizontalScrollPosition()
+ scrollingVelocity);
.getHorizontalScrollPosition() + scrollingVelocity);
return true;
}

@@ -5014,8 +5012,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
int rowHeight = (int) scrollBody.getRowHeight();
int offset = pageLength * rowHeight - rowHeight;
scrollBodyPanel.setScrollPosition(scrollBodyPanel
.getScrollPosition()
+ offset);
.getScrollPosition() + offset);
if (selectMode > SELECT_MODE_NONE) {
if (!moveFocusDown(pageLength - 2)) {
final int lastRendered = scrollBody.getLastRendered();
@@ -5037,8 +5034,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
int rowHeight = (int) scrollBody.getRowHeight();
int offset = pageLength * rowHeight - rowHeight;
scrollBodyPanel.setScrollPosition(scrollBodyPanel
.getScrollPosition()
- offset);
.getScrollPosition() - offset);
if (selectMode > SELECT_MODE_NONE) {
if (!moveFocusUp(pageLength - 2)) {
final int firstRendered = scrollBody.getFirstRendered();
@@ -5101,9 +5097,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
*/
public void onKeyPress(KeyPressEvent event) {
if (hasFocus) {
if (handleNavigation(event.getNativeEvent().getKeyCode(), event
.isControlKeyDown()
|| event.isMetaKeyDown(), event.isShiftKeyDown())) {
if (handleNavigation(event.getNativeEvent().getKeyCode(),
event.isControlKeyDown() || event.isMetaKeyDown(),
event.isShiftKeyDown())) {
event.preventDefault();
}

@@ -5129,9 +5125,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
*/
public void onKeyDown(KeyDownEvent event) {
if (hasFocus) {
if (handleNavigation(event.getNativeEvent().getKeyCode(), event
.isControlKeyDown()
|| event.isMetaKeyDown(), event.isShiftKeyDown())) {
if (handleNavigation(event.getNativeEvent().getKeyCode(),
event.isControlKeyDown() || event.isMetaKeyDown(),
event.isShiftKeyDown())) {
event.preventDefault();
}


+ 15
- 14
src/com/vaadin/terminal/gwt/client/ui/VSlider.java View File

@@ -181,16 +181,16 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
private void updateFeedbackPosition() {
if (vertical) {
feedbackPopup.setPopupPosition(DOM.getAbsoluteLeft(handle)
+ handle.getOffsetWidth(), DOM.getAbsoluteTop(handle)
+ handle.getOffsetHeight() / 2
- feedbackPopup.getOffsetHeight() / 2);
feedbackPopup.setPopupPosition(
DOM.getAbsoluteLeft(handle) + handle.getOffsetWidth(),
DOM.getAbsoluteTop(handle) + handle.getOffsetHeight() / 2
- feedbackPopup.getOffsetHeight() / 2);
} else {
feedbackPopup.setPopupPosition(DOM.getAbsoluteLeft(handle)
+ handle.getOffsetWidth() / 2
- feedbackPopup.getOffsetWidth() / 2, DOM
.getAbsoluteTop(handle)
- feedbackPopup.getOffsetHeight());
feedbackPopup.setPopupPosition(
DOM.getAbsoluteLeft(handle) + handle.getOffsetWidth() / 2
- feedbackPopup.getOffsetWidth() / 2,
DOM.getAbsoluteTop(handle)
- feedbackPopup.getOffsetHeight());
}
}
@@ -279,8 +279,7 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
final int handleSize = Integer.parseInt(DOM.getElementProperty(handle,
domProperty));
final int baseSize = Integer.parseInt(DOM.getElementProperty(base,
domProperty))
- (2 * BASE_BORDER_WIDTH);
domProperty)) - (2 * BASE_BORDER_WIDTH);
final int range = baseSize - handleSize;
double v = value.doubleValue();
@@ -338,8 +337,8 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
} else if ((BrowserInfo.get().isGecko() && DOM.eventGetType(event) == Event.ONKEYPRESS)
|| (!BrowserInfo.get().isGecko() && DOM.eventGetType(event) == Event.ONKEYDOWN)) {
if (handleNavigation(event.getKeyCode(), event.getCtrlKey(), event
.getShiftKey())) {
if (handleNavigation(event.getKeyCode(), event.getCtrlKey(),
event.getShiftKey())) {
feedbackPopup.show();
@@ -465,7 +464,9 @@ public class VSlider extends SimpleFocusablePanel implements Paintable, Field,
final double baseOffset = vertical ? DOM.getAbsoluteTop(base)
- Window.getScrollTop() - handleSize / 2 : DOM
.getAbsoluteLeft(base)
- Window.getScrollLeft() + handleSize / 2;
- Window.getScrollLeft()
+ handleSize
/ 2;
if (vertical) {
v = ((baseSize - (coord - baseOffset)) / (baseSize - handleSize))

+ 1
- 3
src/com/vaadin/terminal/gwt/client/ui/VSplitPanel.java View File

@@ -320,9 +320,7 @@ public class VSplitPanel extends ComplexPanel implements Container,
return;
}

DOM
.setStyleAttribute(firstContainer, "width", pixelPosition
+ "px");
DOM.setStyleAttribute(firstContainer, "width", pixelPosition + "px");
int secondContainerWidth = (wholeSize - pixelPosition - getSplitterSize());
if (secondContainerWidth < 0) {
secondContainerWidth = 0;

+ 16
- 11
src/com/vaadin/terminal/gwt/client/ui/VTablePaging.java View File

@@ -154,8 +154,8 @@ public class VTablePaging extends Composite implements Table, Paintable,
final UIDL col = (UIDL) it.next();
final String cid = col.getStringAttribute("cid");
if (!col.hasAttribute("collapsed")) {
tBody.setWidget(0, colIndex, new HeaderCell(cid, col
.getStringAttribute("caption")));
tBody.setWidget(0, colIndex,
new HeaderCell(cid, col.getStringAttribute("caption")));

}
colIndex++;
@@ -183,9 +183,9 @@ public class VTablePaging extends Composite implements Table, Paintable,
int curRowIndex = 1;
while (it.hasNext()) {
final UIDL rowUidl = (UIDL) it.next();
final TableRow row = new TableRow(curRowIndex, String
.valueOf(rowUidl.getIntAttribute("key")), rowUidl
.hasAttribute("selected"));
final TableRow row = new TableRow(curRowIndex,
String.valueOf(rowUidl.getIntAttribute("key")),
rowUidl.hasAttribute("selected"));
int colIndex = 0;
if (rowHeaders) {
tBody.setWidget(curRowIndex, colIndex, new BodyCell(row,
@@ -363,13 +363,15 @@ public class VTablePaging extends Composite implements Table, Paintable,
selected = sel;
if (selected) {
selectedRowKeys.add(key);
DOM.setStyleAttribute(tBody.getRowFormatter().getElement(
rowIndex), "background", "yellow");
DOM.setStyleAttribute(
tBody.getRowFormatter().getElement(rowIndex),
"background", "yellow");

} else {
selectedRowKeys.remove(key);
DOM.setStyleAttribute(tBody.getRowFormatter().getElement(
rowIndex), "background", "transparent");
DOM.setStyleAttribute(
tBody.getRowFormatter().getElement(rowIndex),
"background", "transparent");
}
}

@@ -391,8 +393,11 @@ public class VTablePaging extends Composite implements Table, Paintable,
}
setSelected(true);
}
client.updateVariable(id, "selected", selectedRowKeys
.toArray(new String[selectedRowKeys.size()]), immediate);
client.updateVariable(
id,
"selected",
selectedRowKeys.toArray(new String[selectedRowKeys.size()]),
immediate);
}

/**

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

@@ -341,8 +341,9 @@ public class VTabsheet extends VTabsheetBase {
DeferredCommand.addCommand(new Command() {
public void execute() {
previousVisibleWidget = tp.getWidget(tp.getVisibleWidget());
DOM.setStyleAttribute(DOM.getParent(previousVisibleWidget
.getElement()), "visibility", "hidden");
DOM.setStyleAttribute(
DOM.getParent(previousVisibleWidget.getElement()),
"visibility", "hidden");
client.updateVariable(id, "selected", tabKeys.get(tabIndex)
.toString(), true);
}
@@ -387,9 +388,7 @@ public class VTabsheet extends VTabsheetBase {

addStyleDependentName("loading"); // Indicate initial progress
tb.setStyleName(CLASSNAME + "-tabs");
DOM
.setElementProperty(contentNode, "className", CLASSNAME
+ "-content");
DOM.setElementProperty(contentNode, "className", CLASSNAME + "-content");
DOM.setElementProperty(deco, "className", CLASSNAME + "-deco");

add(tb, tabs);
@@ -737,8 +736,9 @@ public class VTabsheet extends VTabsheetBase {
updateOpenTabSize();
VTabsheet.this.removeStyleDependentName("loading");
if (previousVisibleWidget != null) {
DOM.setStyleAttribute(DOM.getParent(previousVisibleWidget
.getElement()), "visibility", "");
DOM.setStyleAttribute(
DOM.getParent(previousVisibleWidget.getElement()),
"visibility", "");
previousVisibleWidget = null;
}
}

+ 3
- 2
src/com/vaadin/terminal/gwt/client/ui/VTextualDate.java View File

@@ -240,8 +240,9 @@ public class VTextualDate extends VDateField implements Paintable, Field,
if (date != null) {
// if date value was leniently parsed, normalize text
// presentation
text.setValue(DateTimeFormat.getFormat(
getFormatString()).format(date), false);
text.setValue(
DateTimeFormat.getFormat(getFormatString())
.format(date), false);
}
} else {
date = format.parseStrict(text.getText());

+ 6
- 4
src/com/vaadin/terminal/gwt/client/ui/VTwinColSelect.java View File

@@ -209,8 +209,9 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
options.setFocus(true);
}
client.updateVariable(id, "selected", selectedKeys
.toArray(new String[selectedKeys.size()]), isImmediate());
client.updateVariable(id, "selected",
selectedKeys.toArray(new String[selectedKeys.size()]),
isImmediate());
}
private void removeItem() {
@@ -242,8 +243,9 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
selections.setFocus(true);
}
client.updateVariable(id, "selected", selectedKeys
.toArray(new String[selectedKeys.size()]), isImmediate());
client.updateVariable(id, "selected",
selectedKeys.toArray(new String[selectedKeys.size()]),
isImmediate());
}
@Override

+ 2
- 4
src/com/vaadin/terminal/gwt/client/ui/VUpload.java View File

@@ -247,8 +247,7 @@ public class VUpload extends SimplePanel implements Paintable {
if (fu.getFilename().length() == 0 || submitted || !enabled) {
ApplicationConnection
.getConsole()
.log(
"Submit cancelled (disabled, no file or already submitted)");
.log("Submit cancelled (disabled, no file or already submitted)");
return;
}
// flush possibly pending variable changes, so they will be handled
@@ -270,8 +269,7 @@ public class VUpload extends SimplePanel implements Paintable {
public void run() {
ApplicationConnection
.getConsole()
.log(
"Visiting server to see if upload started event changed UI.");
.log("Visiting server to see if upload started event changed UI.");
client.updateVariable(paintableId, "pollForStart",
nextUploadId, true);
}

+ 2
- 4
src/com/vaadin/terminal/gwt/client/ui/VView.java View File

@@ -292,8 +292,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
}

final String style = notification.hasAttribute("style") ? notification
.getStringAttribute("style")
: null;
.getStringAttribute("style") : null;
final int position = notification
.getIntAttribute("position");
final int delay = notification.getIntAttribute("delay");
@@ -455,8 +454,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
if (changed) {
ApplicationConnection
.getConsole()
.log(
"Running layout functions due window resize");
.log("Running layout functions due window resize");
connection.runDescendentsLayout(VView.this);

sendClientResized();

+ 15
- 17
src/com/vaadin/terminal/gwt/client/ui/VWindow.java View File

@@ -226,9 +226,7 @@ public class VWindow extends VOverlay implements Container, ScrollListener,
footer = DOM.createDiv();
DOM.setElementProperty(footer, "className", CLASSNAME + "-footer");
resizeBox = DOM.createDiv();
DOM
.setElementProperty(resizeBox, "className", CLASSNAME
+ "-resizebox");
DOM.setElementProperty(resizeBox, "className", CLASSNAME + "-resizebox");
closeBox = DOM.createDiv();
DOM.setElementProperty(closeBox, "className", CLASSNAME + "-closebox");
DOM.appendChild(footer, resizeBox);
@@ -313,8 +311,8 @@ public class VWindow extends VOverlay implements Container, ScrollListener,
}

if (uidl.hasAttribute("caption")) {
setCaption(uidl.getStringAttribute("caption"), uidl
.getStringAttribute("icon"));
setCaption(uidl.getStringAttribute("caption"),
uidl.getStringAttribute("icon"));
}

boolean showingUrl = false;
@@ -430,8 +428,7 @@ public class VWindow extends VOverlay implements Container, ScrollListener,
}

final String style = notification.hasAttribute("style") ? notification
.getStringAttribute("style")
: null;
.getStringAttribute("style") : null;
final int position = notification
.getIntAttribute("position");
final int delay = notification.getIntAttribute("delay");
@@ -710,14 +707,15 @@ public class VWindow extends VOverlay implements Container, ScrollListener,

private void showModalityCurtain() {
if (BrowserInfo.get().isFF2()) {
DOM.setStyleAttribute(modalityCurtain, "height", DOM
.getElementPropertyInt(RootPanel.getBodyElement(),
"offsetHeight")
+ "px");
DOM.setStyleAttribute(
modalityCurtain,
"height",
DOM.getElementPropertyInt(RootPanel.getBodyElement(),
"offsetHeight") + "px");
DOM.setStyleAttribute(modalityCurtain, "position", "absolute");
}
DOM.setStyleAttribute(modalityCurtain, "zIndex", ""
+ (windowOrder.indexOf(this) + Z_INDEX));
DOM.setStyleAttribute(modalityCurtain, "zIndex",
"" + (windowOrder.indexOf(this) + Z_INDEX));
DOM.appendChild(RootPanel.getBodyElement(), modalityCurtain);
}

@@ -996,8 +994,8 @@ public class VWindow extends VOverlay implements Container, ScrollListener,
rootPixelWidth = getElement().getOffsetWidth();
width = rootPixelWidth + "px";
} else {
rootPixelWidth = Integer.parseInt(width.substring(0, width
.indexOf("px")));
rootPixelWidth = Integer.parseInt(width.substring(0,
width.indexOf("px")));
}

// "width" now contains the new width in pixels
@@ -1134,8 +1132,8 @@ public class VWindow extends VOverlay implements Container, ScrollListener,
// debug window
Console console = ApplicationConnection.getConsole();
if (console instanceof VDebugConsole
&& DOM.isOrHasChild(((VDebugConsole) console)
.getElement(), target)) {
&& DOM.isOrHasChild(
((VDebugConsole) console).getElement(), target)) {
return true; // allow debug-window clicks
}
return false;

+ 3
- 3
src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java View File

@@ -14,9 +14,9 @@ import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Event.NativePreviewEvent;
import com.google.gwt.user.client.Event.NativePreviewHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
@@ -537,8 +537,8 @@ public class VDragAndDropManager {

VTransferable transferable = currentDrag.getTransferable();

client.updateVariable(DD_SERVICE, "component", transferable
.getDragSource(), false);
client.updateVariable(DD_SERVICE, "component",
transferable.getDragSource(), false);

client.updateVariable(DD_SERVICE, "type", drop.ordinal(), false);


+ 1
- 1
src/com/vaadin/terminal/gwt/client/ui/dd/VDragEvent.java View File

@@ -8,9 +8,9 @@ import java.util.Map;

import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.dom.client.TableElement;
import com.google.gwt.dom.client.TableSectionElement;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.user.client.Element;
import com.vaadin.terminal.gwt.client.BrowserInfo;

+ 4
- 5
src/com/vaadin/terminal/gwt/client/ui/layout/CellBasedLayout.java View File

@@ -239,11 +239,10 @@ public abstract class CellBasedLayout extends ComplexPanel implements Container

static {
helper = Document.get().createDivElement();
helper
.setInnerHTML("<div style=\"position:absolute;top:0;left:0;height:0;visibility:hidden;overflow:hidden;\">"
+ "<div style=\"width:0;height:0;visibility:hidden;overflow:hidden;\">"
+ "</div></div>"
+ "<div style=\"position:absolute;height:0;overflow:hidden;\"></div>");
helper.setInnerHTML("<div style=\"position:absolute;top:0;left:0;height:0;visibility:hidden;overflow:hidden;\">"
+ "<div style=\"width:0;height:0;visibility:hidden;overflow:hidden;\">"
+ "</div></div>"
+ "<div style=\"position:absolute;height:0;overflow:hidden;\"></div>");
NodeList<Node> childNodes = helper.getChildNodes();
measurement = (DivElement) childNodes.getItem(0);
measurement2 = (DivElement) measurement.getFirstChildElement();

+ 7
- 8
src/com/vaadin/terminal/gwt/client/ui/layout/ChildComponentContainer.java View File

@@ -16,11 +16,11 @@ 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.Paintable;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;

public class ChildComponentContainer extends Panel {
@@ -83,8 +83,7 @@ public class ChildComponentContainer extends Panel {
// FF2 chokes on some floats very easily. Measuring size escpecially
// becomes terribly slow
TableElement tableEl = Document.get().createTableElement();
tableEl
.setInnerHTML("<tbody><tr><td><div></div></td></tr></tbody>");
tableEl.setInnerHTML("<tbody><tr><td><div></div></td></tr></tbody>");
DivElement div = (DivElement) tableEl.getFirstChildElement()
.getFirstChildElement().getFirstChildElement()
.getFirstChildElement();
@@ -268,8 +267,8 @@ public class ChildComponentContainer extends Panel {
setMarginTop(containerMarginTop);

if (caption != null) {
caption.getElement().getStyle().setPropertyPx("marginLeft",
alignmentLeftOffsetForCaption);
caption.getElement().getStyle()
.setPropertyPx("marginLeft", alignmentLeftOffsetForCaption);
}
widgetDIV.getStyle().setPropertyPx("marginLeft",
alignmentLeftOffsetForWidget);
@@ -326,8 +325,8 @@ public class ChildComponentContainer extends Panel {
* Take into account the rare case that the caption on the right
* side of the component AND is higher than the component
*/
emptySpace -= Math.max(widgetSize.getHeight(), caption
.getHeight());
emptySpace -= Math.max(widgetSize.getHeight(),
caption.getHeight());
} else {
emptySpace -= widgetSize.getHeight();
emptySpace -= getCaptionHeight();

+ 12
- 12
src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextToolbar.java View File

@@ -319,10 +319,10 @@ public class VRichTextToolbar extends Composite {
setStyleName("gwt-RichTextToolbar");

if (basic != null) {
topPanel.add(bold = createToggleButton(images.bold(), strings
.bold()));
topPanel.add(italic = createToggleButton(images.italic(), strings
.italic()));
topPanel.add(bold = createToggleButton(images.bold(),
strings.bold()));
topPanel.add(italic = createToggleButton(images.italic(),
strings.italic()));
topPanel.add(underline = createToggleButton(images.underline(),
strings.underline()));
topPanel.add(subscript = createToggleButton(images.subscript(),
@@ -331,19 +331,19 @@ public class VRichTextToolbar extends Composite {
strings.superscript()));
topPanel.add(justifyLeft = createPushButton(images.justifyLeft(),
strings.justifyLeft()));
topPanel.add(justifyCenter = createPushButton(images
.justifyCenter(), strings.justifyCenter()));
topPanel.add(justifyCenter = createPushButton(
images.justifyCenter(), strings.justifyCenter()));
topPanel.add(justifyRight = createPushButton(images.justifyRight(),
strings.justifyRight()));
}

if (extended != null) {
topPanel.add(strikethrough = createToggleButton(images
.strikeThrough(), strings.strikeThrough()));
topPanel.add(indent = createPushButton(images.indent(), strings
.indent()));
topPanel.add(outdent = createPushButton(images.outdent(), strings
.outdent()));
topPanel.add(strikethrough = createToggleButton(
images.strikeThrough(), strings.strikeThrough()));
topPanel.add(indent = createPushButton(images.indent(),
strings.indent()));
topPanel.add(outdent = createPushButton(images.outdent(),
strings.outdent()));
topPanel.add(hr = createPushButton(images.hr(), strings.hr()));
topPanel.add(ol = createPushButton(images.ol(), strings.ol()));
topPanel.add(ul = createPushButton(images.ul(), strings.ul()));

+ 27
- 30
src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java View File

@@ -96,8 +96,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
for (final Enumeration e = config.getInitParameterNames(); e
.hasMoreElements();) {
final String name = (String) e.nextElement();
applicationProperties.setProperty(name, config
.getInitParameter(name));
applicationProperties.setProperty(name,
config.getInitParameter(name));
}

// Overrides with server.xml parameters
@@ -105,8 +105,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
for (final Enumeration e = context.getInitParameterNames(); e
.hasMoreElements();) {
final String name = (String) e.nextElement();
applicationProperties.setProperty(name, context
.getInitParameter(name));
applicationProperties.setProperty(name,
context.getInitParameter(name));
}
checkProductionMode();
checkCrossSiteProtection();
@@ -181,8 +181,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
pkgName = pkg.getName();
} else {
final String className = getClass().getName();
pkgName = new String(className.toCharArray(), 0, className
.lastIndexOf('.'));
pkgName = new String(className.toCharArray(), 0,
className.lastIndexOf('.'));
}
val = System.getProperty(pkgName + "." + parameterName);
if (val != null) {
@@ -235,8 +235,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
protected String getStaticFilesLocation(PortletRequest request) {
// TODO allow overriding on portlet level?
String staticFileLocation = getPortalProperty(
Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, request
.getPortalContext());
Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH,
request.getPortalContext());
if (staticFileLocation != null) {
// remove trailing slash if any
while (staticFileLocation.endsWith(".")) {
@@ -557,8 +557,9 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
private void updateBrowserProperties(WebBrowser browser,
PortletRequest request) {
String userAgent = getHTTPHeader(request, "user-agent");
browser.updateBrowserProperties(request.getLocale(), null, request
.isSecure(), userAgent, getHTTPRequestParameter(request, "sw"),
browser.updateBrowserProperties(request.getLocale(), null,
request.isSecure(), userAgent,
getHTTPRequestParameter(request, "sw"),
getHTTPRequestParameter(request, "sh"));
}

@@ -590,8 +591,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
ResourceResponse response) throws IOException {

if (stream.getParameter("Location") != null) {
response.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer
.toString(HttpServletResponse.SC_MOVED_TEMPORARILY));
response.setProperty(ResourceResponse.HTTP_STATUS_CODE,
Integer.toString(HttpServletResponse.SC_MOVED_TEMPORARILY));
response.setProperty("Location", stream.getParameter("Location"));
return;
}
@@ -676,8 +677,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
} else {
System.err.println("Requested resource [" + resourceID
+ "] could not be found");
response.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer
.toString(HttpServletResponse.SC_NOT_FOUND));
response.setProperty(ResourceResponse.HTTP_STATUS_CODE,
Integer.toString(HttpServletResponse.SC_NOT_FOUND));
}
}

@@ -1022,10 +1023,9 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
widgetset = DEFAULT_WIDGETSET;
}
String widgetsetURL = getWidgetsetURL(widgetset, request);
writer
.write("document.write('<iframe tabIndex=\"-1\" id=\"__gwt_historyFrame\" "
+ "style=\"width:0;height:0;border:0;overflow:"
+ "hidden\" src=\"javascript:false\"></iframe>');\n");
writer.write("document.write('<iframe tabIndex=\"-1\" id=\"__gwt_historyFrame\" "
+ "style=\"width:0;height:0;border:0;overflow:"
+ "hidden\" src=\"javascript:false\"></iframe>');\n");
writer.write("document.write(\"<script language='javascript' src='"
+ widgetsetURL + "'><\\/script>\");\n}\n");
}
@@ -1177,14 +1177,12 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
}

writer.write("if(!vaadin.themesLoaded['" + portalTheme + "']) {\n");
writer
.write("var defaultStylesheet = document.createElement('link');\n");
writer.write("var defaultStylesheet = document.createElement('link');\n");
writer.write("defaultStylesheet.setAttribute('rel', 'stylesheet');\n");
writer.write("defaultStylesheet.setAttribute('type', 'text/css');\n");
writer.write("defaultStylesheet.setAttribute('href', '"
+ getThemeURI(portalTheme, request) + "/styles.css');\n");
writer
.write("document.getElementsByTagName('head')[0].appendChild(defaultStylesheet);\n");
writer.write("document.getElementsByTagName('head')[0].appendChild(defaultStylesheet);\n");
writer.write("vaadin.themesLoaded['" + portalTheme + "'] = true;\n}\n");

if (!portalTheme.equals(themeName)) {
@@ -1194,8 +1192,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
writer.write("stylesheet.setAttribute('type', 'text/css');\n");
writer.write("stylesheet.setAttribute('href', '" + themeURI
+ "/styles.css');\n");
writer
.write("document.getElementsByTagName('head')[0].appendChild(stylesheet);\n");
writer.write("document.getElementsByTagName('head')[0].appendChild(stylesheet);\n");
writer.write("vaadin.themesLoaded['" + themeName
+ "'] = true;\n}\n");
}
@@ -1252,8 +1249,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
if (themeName == null) {
// no, is the default theme defined by the portal?
themeName = getPortalProperty(
Constants.PORTAL_PARAMETER_VAADIN_THEME, request
.getPortalContext());
Constants.PORTAL_PARAMETER_VAADIN_THEME,
request.getPortalContext());
}

if (themeName == null) {
@@ -1326,8 +1323,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
// if this was an UIDL request, response UIDL back to client
if (getRequestType(request) == RequestType.UIDL) {
Application.SystemMessages ci = getSystemMessages();
criticalNotification(request, (ResourceResponse) response, ci
.getInternalErrorCaption(), ci.getInternalErrorMessage(),
criticalNotification(request, (ResourceResponse) response,
ci.getInternalErrorCaption(), ci.getInternalErrorMessage(),
null, ci.getInternalErrorURL());
if (application != null) {
application.getErrorHandler()
@@ -1429,8 +1426,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
* @return
*/
protected static String getPortalProperty(String name, PortalContext context) {
boolean isLifeRay = context.getPortalInfo().toLowerCase().contains(
"liferay");
boolean isLifeRay = context.getPortalInfo().toLowerCase()
.contains("liferay");

// TODO test on non-LifeRay platforms


+ 43
- 55
src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java View File

@@ -117,8 +117,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* read by {@link AbstractApplicationServlet}.
*/
public static final String REQUEST_FRAGMENT = ApplicationServlet.class
.getName()
+ ".fragment";
.getName() + ".fragment";
/**
* This request attribute forces widgetsets to be loaded from under the
* specified base path; e.g shared widgetset for all portlets in a portal.
@@ -128,8 +127,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* {@link AbstractApplicationServlet}.
*/
public static final String REQUEST_VAADIN_STATIC_FILE_PATH = ApplicationServlet.class
.getName()
+ ".widgetsetPath";
.getName() + ".widgetsetPath";
/**
* This request attribute forces widgetset used; e.g for portlets that can
* not have different widgetsets.
@@ -139,8 +137,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* {@link AbstractApplicationServlet}.
*/
public static final String REQUEST_WIDGETSET = ApplicationServlet.class
.getName()
+ ".widgetset";
.getName() + ".widgetset";
/**
* This request attribute indicates the shared widgetset (e.g. portal-wide
* default widgetset).
@@ -150,8 +147,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* {@link AbstractApplicationServlet}.
*/
public static final String REQUEST_SHARED_WIDGETSET = ApplicationServlet.class
.getName()
+ ".sharedWidgetset";
.getName() + ".sharedWidgetset";
/**
* If set, do not load the default theme but assume that loading it is
* handled e.g. by ApplicationPortlet.
@@ -161,8 +157,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* {@link AbstractApplicationServlet}.
*/
public static final String REQUEST_DEFAULT_THEME = ApplicationServlet.class
.getName()
+ ".defaultThemeUri";
.getName() + ".defaultThemeUri";
/**
* This request attribute is used to add styles to the main element. E.g
* "height:500px" generates a style="height:500px" to the main element,
@@ -173,8 +168,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* {@link AbstractApplicationServlet}.
*/
public static final String REQUEST_APPSTYLE = ApplicationServlet.class
.getName()
+ ".style";
.getName() + ".style";

private Properties applicationProperties;

@@ -206,8 +200,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
for (final Enumeration e = servletConfig.getInitParameterNames(); e
.hasMoreElements();) {
final String name = (String) e.nextElement();
applicationProperties.setProperty(name, servletConfig
.getInitParameter(name));
applicationProperties.setProperty(name,
servletConfig.getInitParameter(name));
}

// Overrides with server.xml parameters
@@ -215,8 +209,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
for (final Enumeration e = context.getInitParameterNames(); e
.hasMoreElements();) {
final String name = (String) e.nextElement();
applicationProperties.setProperty(name, context
.getInitParameter(name));
applicationProperties.setProperty(name,
context.getInitParameter(name));
}
checkProductionMode();
checkCrossSiteProtection();
@@ -305,8 +299,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
pkgName = pkg.getName();
} else {
final String className = getClass().getName();
pkgName = new String(className.toCharArray(), 0, className
.lastIndexOf('.'));
pkgName = new String(className.toCharArray(), 0,
className.lastIndexOf('.'));
}
val = System.getProperty(pkgName + "." + parameterName);
if (val != null) {
@@ -570,10 +564,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements

private void updateBrowserProperties(WebBrowser browser,
HttpServletRequest request) {
browser.updateBrowserProperties(request.getLocale(), request
.getRemoteAddr(), request.isSecure(), request
.getHeader("user-agent"), request.getParameter("sw"), request
.getParameter("sh"));
browser.updateBrowserProperties(request.getLocale(),
request.getRemoteAddr(), request.isSecure(),
request.getHeader("user-agent"), request.getParameter("sw"),
request.getParameter("sh"));
}

protected ClassLoader getClassLoader() throws ServletException {
@@ -946,8 +940,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
// if this was an UIDL request, response UIDL back to client
if (getRequestType(request) == RequestType.UIDL) {
Application.SystemMessages ci = getSystemMessages();
criticalNotification(request, response, ci
.getInternalErrorCaption(), ci.getInternalErrorMessage(),
criticalNotification(request, response,
ci.getInternalErrorCaption(), ci.getInternalErrorMessage(),
null, ci.getInternalErrorURL());
if (application != null) {
application.getErrorHandler()
@@ -1059,10 +1053,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
request.getSession().invalidate();

// send uidl redirect
criticalNotification(request, response, ci
.getSessionExpiredCaption(), ci
.getSessionExpiredMessage(), null, ci
.getSessionExpiredURL());
criticalNotification(request, response,
ci.getSessionExpiredCaption(),
ci.getSessionExpiredMessage(), null,
ci.getSessionExpiredURL());

}
} catch (SystemMessageException ee) {
@@ -1089,9 +1083,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
response.sendRedirect(ci.getCommunicationErrorURL());
} else {
// send uidl redirect
criticalNotification(request, response, ci
.getCommunicationErrorCaption(), ci
.getCommunicationErrorMessage(),
criticalNotification(request, response,
ci.getCommunicationErrorCaption(),
ci.getCommunicationErrorMessage(),
INVALID_SECURITY_KEY_MSG, ci.getCommunicationErrorURL());
/*
* Invalidate session. Portal integration will fail otherwise
@@ -1169,8 +1163,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
return true;
} else if (request.getRequestURI().startsWith(
request.getContextPath() + "/VAADIN/")) {
serveStaticResourcesInVAADIN(request.getRequestURI().substring(
request.getContextPath().length()), request, response);
serveStaticResourcesInVAADIN(
request.getRequestURI().substring(
request.getContextPath().length()), request,
response);
return true;
}

@@ -1248,8 +1244,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
* cache timeout can be configured by setting the resourceCacheTime
* parameter in web.xml
*/
response.setHeader("Cache-Control", "max-age: "
+ String.valueOf(resourceCacheTime));
response.setHeader("Cache-Control",
"max-age: " + String.valueOf(resourceCacheTime));
}

// Write the resource to the client.
@@ -1770,10 +1766,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
if (!isProductionMode()) {
page.write("vaadin.debug = true;\n");
}
page
.write("document.write('<iframe tabIndex=\"-1\" id=\"__gwt_historyFrame\" "
+ "style=\"position:absolute;width:0;height:0;border:0;overflow:"
+ "hidden;\" src=\"javascript:false\"></iframe>');\n");
page.write("document.write('<iframe tabIndex=\"-1\" id=\"__gwt_historyFrame\" "
+ "style=\"position:absolute;width:0;height:0;border:0;overflow:"
+ "hidden;\" src=\"javascript:false\"></iframe>');\n");
page.write("document.write(\"<script language='javascript' src='"
+ widgetsetFilePath + "'><\\/script>\");\n}\n");

@@ -1848,8 +1843,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
page.write("stylesheet.setAttribute('type', 'text/css');\n");
page.write("stylesheet.setAttribute('href', '" + themeUri
+ "/styles.css');\n");
page
.write("document.getElementsByTagName('head')[0].appendChild(stylesheet);\n");
page.write("document.getElementsByTagName('head')[0].appendChild(stylesheet);\n");
page.write("vaadin.themesLoaded['" + themeName + "'] = true;\n}\n");
page.write("//]]>\n</script>\n");
}
@@ -1858,12 +1852,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
// inactivity
page.write("<script type=\"text/javascript\">\n");
page.write("//<![CDATA[\n");
page
.write("setTimeout('if (typeof "
+ widgetset.replace('.', '_')
+ " == \"undefined\") {alert(\"Failed to load the widgetset: "
+ widgetsetFilePath + "\")};',15000);\n"
+ "//]]>\n</script>\n");
page.write("setTimeout('if (typeof " + widgetset.replace('.', '_')
+ " == \"undefined\") {alert(\"Failed to load the widgetset: "
+ widgetsetFilePath + "\")};',15000);\n" + "//]]>\n</script>\n");
}

/**
@@ -1897,18 +1888,15 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements
*/
protected void writeAjaxPageHtmlHeader(final BufferedWriter page,
String title, String themeUri) throws IOException {
page
.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n");
page.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n");
page.write("<style type=\"text/css\">"
+ "html, body {height:100%;margin:0;}</style>");

// Add favicon links
page
.write("<link rel=\"shortcut icon\" type=\"image/vnd.microsoft.icon\" href=\""
+ themeUri + "/favicon.ico\" />");
page
.write("<link rel=\"icon\" type=\"image/vnd.microsoft.icon\" href=\""
+ themeUri + "/favicon.ico\" />");
page.write("<link rel=\"shortcut icon\" type=\"image/vnd.microsoft.icon\" href=\""
+ themeUri + "/favicon.ico\" />");
page.write("<link rel=\"icon\" type=\"image/vnd.microsoft.icon\" href=\""
+ themeUri + "/favicon.ico\" />");

page.write("<title>" + title + "</title>");
}

+ 18
- 15
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java View File

@@ -53,20 +53,20 @@ import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Paintable;
import com.vaadin.terminal.URIHandler;
import com.vaadin.terminal.UploadStream;
import com.vaadin.terminal.VariableOwner;
import com.vaadin.terminal.Paintable.RepaintRequestEvent;
import com.vaadin.terminal.Terminal.ErrorEvent;
import com.vaadin.terminal.Terminal.ErrorListener;
import com.vaadin.terminal.URIHandler;
import com.vaadin.terminal.UploadStream;
import com.vaadin.terminal.VariableOwner;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.server.ComponentSizeValidator.InvalidLayout;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Component;
import com.vaadin.ui.DragAndDropWrapper;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Window;
import com.vaadin.ui.Upload.UploadException;
import com.vaadin.ui.Window;

/**
* This is a common base class for the server-side implementations of the
@@ -1049,14 +1049,17 @@ public abstract class AbstractCommunicationManager implements
// we have more than one value changes in row for
// one variable owner, collect em in HashMap
m = new HashMap<String, Object>();
m.put(variable[VAR_NAME], convertVariableValue(
variable[VAR_TYPE].charAt(0),
variable[VAR_VALUE]));
m.put(variable[VAR_NAME],
convertVariableValue(
variable[VAR_TYPE].charAt(0),
variable[VAR_VALUE]));
} else {
// use optimized single value map
m = Collections.singletonMap(variable[VAR_NAME],
convertVariableValue(variable[VAR_TYPE]
.charAt(0), variable[VAR_VALUE]));
m = Collections.singletonMap(
variable[VAR_NAME],
convertVariableValue(
variable[VAR_TYPE].charAt(0),
variable[VAR_VALUE]));
}

// collect following variable changes for this owner
@@ -1070,9 +1073,10 @@ public abstract class AbstractCommunicationManager implements
} else {
nextVariable = null;
}
m.put(variable[VAR_NAME], convertVariableValue(
variable[VAR_TYPE].charAt(0),
variable[VAR_VALUE]));
m.put(variable[VAR_NAME],
convertVariableValue(
variable[VAR_TYPE].charAt(0),
variable[VAR_VALUE]));
}
try {
owner.changeVariables(request, m);
@@ -1912,8 +1916,7 @@ public abstract class AbstractCommunicationManager implements
URL windowContext;
windowContext = new URL(context, prefix + "/");
final String windowUri = (uri.length() > prefix.length() + 1) ? uri
.substring(prefix.length() + 1)
: "";
.substring(prefix.length() + 1) : "";
return window.handleURI(windowContext, windowUri);
} else {
return null;

+ 13
- 13
src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java View File

@@ -86,7 +86,7 @@ public abstract class AbstractWebApplicationContext implements
}
}

// If any runtime exceptions occurred, throw a combined exception
// If any runtime exceptions occurred, throw a combined exception
if (exceptions != null) {
final StringBuffer msg = new StringBuffer();
for (Exception e : exceptions) {
@@ -106,15 +106,15 @@ public abstract class AbstractWebApplicationContext implements
* @see javax.servlet.http.HttpSessionBindingListener#valueBound(HttpSessionBindingEvent)
*/
public void valueBound(HttpSessionBindingEvent arg0) {
// We are not interested in bindings
// We are not interested in bindings
}

/**
* @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(HttpSessionBindingEvent)
*/
public void valueUnbound(HttpSessionBindingEvent event) {
// If we are going to be unbound from the session, the session must be
// closing
// If we are going to be unbound from the session, the session must be
// closing
try {
while (!applications.isEmpty()) {
final Application app = applications.iterator().next();
@@ -122,12 +122,12 @@ public abstract class AbstractWebApplicationContext implements
removeApplication(app);
}
} catch (Exception e) {
// This should never happen but is possible with rare
// configurations (e.g. robustness tests). If you have one
// thread doing HTTP socket write and another thread trying to
// remove same application here. Possible if you got e.g. session
// lifetime 1 min but socket write may take longer than 1 min.
// FIXME: Handle exception
// This should never happen but is possible with rare
// configurations (e.g. robustness tests). If you have one
// thread doing HTTP socket write and another thread trying to
// remove same application here. Possible if you got e.g. session
// lifetime 1 min but socket write may take longer than 1 min.
// FIXME: Handle exception
System.err.println("Could not remove application, leaking memory.");
e.printStackTrace();
}
@@ -168,19 +168,19 @@ public abstract class AbstractWebApplicationContext implements
}

public boolean isApplicationResourceURL(URL context, String relativeUri) {
// If the relative uri is null, we are ready
// If the relative uri is null, we are ready
if (relativeUri == null) {
return false;
}

// Resolves the prefix
// Resolves the prefix
String prefix = relativeUri;
final int index = relativeUri.indexOf('/');
if (index >= 0) {
prefix = relativeUri.substring(0, index);
}

// Handles the resource requests
// Handles the resource requests
return (prefix.equals("APP"));
}


+ 29
- 29
src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java View File

@@ -29,16 +29,16 @@ import com.vaadin.Application;
*/
@SuppressWarnings("serial")
public class ApplicationPortlet implements Portlet, Serializable {
// portlet configuration parameters
// portlet configuration parameters
private static final String PORTLET_PARAMETER_APPLICATION = "application";
private static final String PORTLET_PARAMETER_STYLE = "style";
private static final String PORTLET_PARAMETER_WIDGETSET = "widgetset";

// The application to show
// The application to show
protected String app = null;
// some applications might require forced height (and, more seldom, width)
protected String style = null; // e.g "height:500px;"
// force the portlet to use this widgetset - portlet level setting
// some applications might require forced height (and, more seldom, width)
protected String style = null; // e.g "height:500px;"
// force the portlet to use this widgetset - portlet level setting
protected String portletWidgetset = null;

public void destroy() {
@@ -54,8 +54,8 @@ public class ApplicationPortlet implements Portlet, Serializable {
+ "' init parameter to be the servlet deployment path.");
}
style = config.getInitParameter(PORTLET_PARAMETER_STYLE);
// enable forcing the selection of the widgetset in portlet
// configuration for a single portlet (backwards compatibility)
// enable forcing the selection of the widgetset in portlet
// configuration for a single portlet (backwards compatibility)
portletWidgetset = config.getInitParameter(PORTLET_PARAMETER_WIDGETSET);
}

@@ -67,7 +67,7 @@ public class ApplicationPortlet implements Portlet, Serializable {
public void render(RenderRequest request, RenderResponse response)
throws PortletException, IOException {

// display the Vaadin application
// display the Vaadin application
writeAjaxWindow(request, response);
}

@@ -84,7 +84,7 @@ public class ApplicationPortlet implements Portlet, Serializable {
.getRequestDispatcher("/" + app);

try {
// portal-wide settings
// portal-wide settings
PortalContext portalCtx = request.getPortalContext();

boolean isLifeRay = portalCtx.getPortalInfo().toLowerCase()
@@ -93,36 +93,36 @@ public class ApplicationPortlet implements Portlet, Serializable {
request.setAttribute(ApplicationServlet.REQUEST_FRAGMENT,
"true");

// fixed base theme to use - all portal pages with Vaadin
// applications will load this exactly once
// fixed base theme to use - all portal pages with Vaadin
// applications will load this exactly once
String portalTheme = getPortalProperty(
Constants.PORTAL_PARAMETER_VAADIN_THEME, portalCtx);

String portalWidgetset = getPortalProperty(
Constants.PORTAL_PARAMETER_VAADIN_WIDGETSET, portalCtx);

// location of the widgetset(s) and default theme (to which
// /VAADIN/widgetsets/...
// is appended)
// location of the widgetset(s) and default theme (to which
// /VAADIN/widgetsets/...
// is appended)
String portalResourcePath = getPortalProperty(
Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH,
portalCtx);

if (portalResourcePath != null) {
// if portalResourcePath is defined, set it as a request
// parameter which will override the default location in
// servlet
// if portalResourcePath is defined, set it as a request
// parameter which will override the default location in
// servlet
request.setAttribute(
ApplicationServlet.REQUEST_VAADIN_STATIC_FILE_PATH,
portalResourcePath);
}

// - if the user has specified a widgetset for this portlet, use
// it from the portlet (not fully supported)
// - otherwise, if specified, use the portal-wide widgetset
// and widgetset path settings (recommended)
// - finally, default to use the default widgetset if nothing
// else is found
// - if the user has specified a widgetset for this portlet, use
// it from the portlet (not fully supported)
// - otherwise, if specified, use the portal-wide widgetset
// and widgetset path settings (recommended)
// - finally, default to use the default widgetset if nothing
// else is found
if (portletWidgetset != null) {
request.setAttribute(ApplicationServlet.REQUEST_WIDGETSET,
portletWidgetset);
@@ -138,8 +138,8 @@ public class ApplicationPortlet implements Portlet, Serializable {
style);
}

// portalTheme is only used if the shared portal resource
// directory is defined
// portalTheme is only used if the shared portal resource
// directory is defined
if (portalTheme != null && portalResourcePath != null) {
request.setAttribute(
ApplicationServlet.REQUEST_DEFAULT_THEME,
@@ -156,7 +156,7 @@ public class ApplicationPortlet implements Portlet, Serializable {
*/
OutputStream out = response.getPortletOutputStream();

// Using portal-wide theme
// Using portal-wide theme
String loadDefaultTheme = ("<script type=\"text/javascript\">\n"
+ "if(!vaadin) { var vaadin = {} } \n"
+ "if(!vaadin.themesLoaded) { vaadin.themesLoaded = {} } \n"
@@ -220,10 +220,10 @@ public class ApplicationPortlet implements Portlet, Serializable {
}

private String getPortalProperty(String name, PortalContext context) {
boolean isLifeRay = context.getPortalInfo().toLowerCase().contains(
"liferay");
boolean isLifeRay = context.getPortalInfo().toLowerCase()
.contains("liferay");

// TODO test on non-LifeRay platforms
// TODO test on non-LifeRay platforms

String value;
if (isLifeRay) {

+ 2
- 2
src/com/vaadin/terminal/gwt/server/ApplicationRunnerServlet.java View File

@@ -106,8 +106,8 @@ public class ApplicationRunnerServlet extends AbstractApplicationServlet {
* context, runner, application classname
*/
private static URIS getApplicationRunnerURIs(HttpServletRequest request) {
final String[] urlParts = request.getRequestURI().toString().split(
"\\/");
final String[] urlParts = request.getRequestURI().toString()
.split("\\/");
String context = null;
String runner = null;
URIS uris = new URIS();

+ 1
- 1
src/com/vaadin/terminal/gwt/server/ChangeVariablesErrorEvent.java View File

@@ -5,8 +5,8 @@ package com.vaadin.terminal.gwt.server;

import java.util.Map;

import com.vaadin.ui.Component;
import com.vaadin.ui.AbstractComponent.ComponentErrorEvent;
import com.vaadin.ui.Component;

@SuppressWarnings("serial")
public class ChangeVariablesErrorEvent implements ComponentErrorEvent {

+ 4
- 3
src/com/vaadin/terminal/gwt/server/CommunicationManager.java View File

@@ -162,9 +162,10 @@ public class CommunicationManager extends AbstractCommunicationManager {
public void criticalNotification(Request request, Response response,
String cap, String msg, String details, String outOfSyncURL)
throws IOException {
servlet.criticalNotification((HttpServletRequest) request
.getWrappedRequest(), (HttpServletResponse) response
.getWrappedResponse(), cap, msg, details, outOfSyncURL);
servlet.criticalNotification(
(HttpServletRequest) request.getWrappedRequest(),
(HttpServletResponse) response.getWrappedResponse(), cap,
msg, details, outOfSyncURL);
}

public String getRequestPathInfo(Request request) {

+ 2
- 3
src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java View File

@@ -21,6 +21,7 @@ import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Form;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.GridLayout.Area;
import com.vaadin.ui.Layout;
import com.vaadin.ui.OrderedLayout;
import com.vaadin.ui.Panel;
@@ -28,7 +29,6 @@ import com.vaadin.ui.SplitPanel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.GridLayout.Area;

@SuppressWarnings("serial")
public class ComponentSizeValidator implements Serializable {
@@ -111,8 +111,7 @@ public class ComponentSizeValidator implements Serializable {
err.append("Layout problem detected: ");
err.append(msg);
err.append("\n");
err
.append("Relative sizes were replaced by undefined sizes, components may not render as expected.\n");
err.append("Relative sizes were replaced by undefined sizes, components may not render as expected.\n");
errorStream.println(err);

}

+ 7
- 11
src/com/vaadin/terminal/gwt/server/GAEApplicationServlet.java View File

@@ -26,11 +26,11 @@ import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.EntityNotFoundException;
import com.google.appengine.api.datastore.FetchOptions.Builder;
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
import com.google.appengine.api.datastore.PreparedQuery;
import com.google.appengine.api.datastore.Query;
import com.google.appengine.api.datastore.FetchOptions.Builder;
import com.google.appengine.api.datastore.Query.FilterOperator;
import com.google.appengine.api.memcache.Expiration;
import com.google.appengine.api.memcache.MemcacheService;
@@ -177,8 +177,8 @@ public class GAEApplicationServlet extends ApplicationServlet {

if (requestType == RequestType.APPLICATION_RESOURCE) {
// no locking needed, let superclass handle
getApplicationContext(request, MemcacheServiceFactory
.getMemcacheService());
getApplicationContext(request,
MemcacheServiceFactory.getMemcacheService());
super.service(request, response);
cleanSession(request);
return;
@@ -210,9 +210,8 @@ public class GAEApplicationServlet extends ApplicationServlet {
try {
Thread.sleep(RETRY_AFTER_MILLISECONDS);
} catch (InterruptedException e) {
log
.info("Thread.sleep() interrupted while waiting for lock. Trying again. "
+ e);
log.info("Thread.sleep() interrupted while waiting for lock. Trying again. "
+ e);
}
}

@@ -221,8 +220,7 @@ public class GAEApplicationServlet extends ApplicationServlet {
// client to retry
response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
// Note: currently interpreting Retry-After as ms, not sec
response
.setHeader("Retry-After", "" + RETRY_AFTER_MILLISECONDS);
response.setHeader("Retry-After", "" + RETRY_AFTER_MILLISECONDS);
return;
}

@@ -397,9 +395,7 @@ public class GAEApplicationServlet extends ApplicationServlet {
}
}
} catch (Exception e) {
log
.warning("Exception while cleaning: "
+ getStackTraceAsString(e));
log.warning("Exception while cleaning: " + getStackTraceAsString(e));
}
}


+ 3
- 3
src/com/vaadin/terminal/gwt/server/PortletApplicationContext.java View File

@@ -26,7 +26,7 @@ import com.vaadin.Application;
/**
* @author marc
*/
@SuppressWarnings( { "serial", "unchecked" })
@SuppressWarnings({ "serial", "unchecked" })
public class PortletApplicationContext extends WebApplicationContext implements
Serializable {

@@ -49,7 +49,7 @@ public class PortletApplicationContext extends WebApplicationContext implements
cx = new PortletApplicationContext();
}
if (!(cx instanceof PortletApplicationContext)) {
// TODO Should we even try this? And should we leave original as-is?
// TODO Should we even try this? And should we leave original as-is?
PortletApplicationContext pcx = new PortletApplicationContext();
pcx.applications.addAll(cx.applications);
cx.applications.clear();
@@ -89,7 +89,7 @@ public class PortletApplicationContext extends WebApplicationContext implements
.iterator(); it.hasNext();) {
Application value = it.next();
if (value == application) {
// values().iterator() is backed by the map
// values().iterator() is backed by the map
it.remove();
}
}

+ 1
- 3
src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java View File

@@ -97,9 +97,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext {
.getAttribute(PortletApplicationContext2.class.getName());
if (cx == null) {
cx = new PortletApplicationContext2();
session
.setAttribute(PortletApplicationContext2.class.getName(),
cx);
session.setAttribute(PortletApplicationContext2.class.getName(), cx);
}
if (cx.session == null) {
cx.session = session;

+ 4
- 3
src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java View File

@@ -161,9 +161,10 @@ public class PortletCommunicationManager extends AbstractCommunicationManager {
public void criticalNotification(Request request, Response response,
String cap, String msg, String details, String outOfSyncURL)
throws IOException {
portlet.criticalNotification((PortletRequest) request
.getWrappedRequest(), (MimeResponse) response
.getWrappedResponse(), cap, msg, details, outOfSyncURL);
portlet.criticalNotification(
(PortletRequest) request.getWrappedRequest(),
(MimeResponse) response.getWrappedResponse(), cap, msg,
details, outOfSyncURL);
}

public String getRequestPathInfo(Request request) {

+ 19
- 19
src/com/vaadin/terminal/gwt/server/RestrictedRenderResponse.java View File

@@ -51,8 +51,8 @@ class RestrictedRenderResponse implements RenderResponse, Serializable {
}

public void flushBuffer() throws IOException {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public int getBufferSize() {
@@ -76,12 +76,12 @@ class RestrictedRenderResponse implements RenderResponse, Serializable {
}

public OutputStream getPortletOutputStream() throws IOException {
// write forbidden
// write forbidden
return null;
}

public PrintWriter getWriter() throws IOException {
// write forbidden
// write forbidden
return null;
}

@@ -90,23 +90,23 @@ class RestrictedRenderResponse implements RenderResponse, Serializable {
}

public void reset() {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public void resetBuffer() {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public void setBufferSize(int size) {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public void setContentType(String type) {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public void setProperty(String key, String value) {
@@ -118,8 +118,8 @@ class RestrictedRenderResponse implements RenderResponse, Serializable {
}

public void setNextPossiblePortletModes(Collection<PortletMode> portletModes) {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public ResourceURL createResourceURL() {
@@ -131,17 +131,17 @@ class RestrictedRenderResponse implements RenderResponse, Serializable {
}

public void addProperty(Cookie cookie) {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public void addProperty(String key, Element element) {
// NOP
// TODO throw?
// NOP
// TODO throw?
}

public Element createElement(String tagName) throws DOMException {
// NOP
// NOP
return null;
}
}

+ 2
- 2
src/com/vaadin/terminal/gwt/server/WebApplicationContext.java View File

@@ -41,8 +41,8 @@ public class WebApplicationContext extends AbstractWebApplicationContext {
* @see com.vaadin.service.ApplicationContext#getBaseDirectory()
*/
public File getBaseDirectory() {
final String realPath = ApplicationServlet.getResourcePath(session
.getServletContext(), "/");
final String realPath = ApplicationServlet.getResourcePath(
session.getServletContext(), "/");
if (realPath == null) {
return null;
}

+ 7
- 7
src/com/vaadin/terminal/gwt/widgetsetutils/AcceptCriteriaFactoryGenerator.java View File

@@ -10,8 +10,8 @@ import java.util.Date;
import com.google.gwt.core.ext.Generator;
import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
@@ -77,8 +77,7 @@ public class AcceptCriteriaFactoryGenerator extends Generator {
ClassSourceFileComposerFactory composer = null;
composer = new ClassSourceFileComposerFactory(packageName, className);
composer.addImport("com.google.gwt.core.client.GWT");
composer
.setSuperclass("com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterionFactory");
composer.setSuperclass("com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterionFactory");
SourceWriter sourceWriter = composer.createSourceWriter(context,
printWriter);

@@ -89,8 +88,9 @@ public class AcceptCriteriaFactoryGenerator extends Generator {
sourceWriter.println("}");
// commit generated class
context.commit(logger, printWriter);
logger.log(Type.INFO, "Done. ("
+ (new Date().getTime() - date.getTime()) / 1000 + "seconds)");
logger.log(Type.INFO,
"Done. (" + (new Date().getTime() - date.getTime()) / 1000
+ "seconds)");

}

@@ -106,8 +106,8 @@ public class AcceptCriteriaFactoryGenerator extends Generator {
.getCriterion();

for (Class<? extends AcceptCriterion> class1 : clientSideVerifiableCriterion) {
logger.log(Type.INFO, "creating mapping for "
+ class1.getCanonicalName());
logger.log(Type.INFO,
"creating mapping for " + class1.getCanonicalName());
String canonicalName = class1.getCanonicalName();
Class<? extends VAcceptCriterion> clientClass = class1
.getAnnotation(ClientCriterion.class).value();

+ 9
- 7
src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java View File

@@ -92,7 +92,8 @@ public class ClassPathExplorer {

/**
* Finds server side widgets with {@link ClientWidget} annotation on the
* class path (entries that can contain widgets/widgetsets - see {@link #getRawClasspathEntries()}).
* class path (entries that can contain widgets/widgetsets - see
* {@link #getRawClasspathEntries()}).
*
* As a side effect, also accept criteria are searched under the same class
* path entries and added into the acceptCriterion collection.
@@ -188,8 +189,9 @@ public class ClassPathExplorer {
String basePath = location.getFile().replaceAll(
"/" + packagePath + "$", "");
try {
URL url = new URL(location.getProtocol(), location
.getHost(), location.getPort(), basePath);
URL url = new URL(location.getProtocol(),
location.getHost(), location.getPort(),
basePath);
widgetsets.put(classname, url);
} catch (MalformedURLException e) {
// should never happen as based on an existing URL,
@@ -388,8 +390,8 @@ public class ClassPathExplorer {
&& !dirs[i].getPath().contains(File.separator + ".")) {
String key = dirs[i].getCanonicalPath() + "/" + name
+ dirs[i].getName();
locations.put(key, new URL("file://"
+ dirs[i].getCanonicalPath()));
locations.put(key,
new URL("file://" + dirs[i].getCanonicalPath()));
}
} catch (Exception ioe) {
return;
@@ -473,8 +475,8 @@ public class ClassPathExplorer {
String entryname = entry.getName();
if (!entry.isDirectory()
&& entryname.endsWith(".class")) {
String classname = entryname.substring(0, entryname
.length() - 6);
String classname = entryname.substring(0,
entryname.length() - 6);
if (classname.startsWith("/")) {
classname = classname.substring(1);
}

+ 8
- 9
src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java View File

@@ -14,8 +14,8 @@ import java.util.TreeSet;
import com.google.gwt.core.ext.Generator;
import com.google.gwt.core.ext.GeneratorContext;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.TreeLogger.Type;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
@@ -107,9 +107,8 @@ public class WidgetMapGenerator extends Generator {
if (printWriter == null) {
return;
}
logger
.log(Type.INFO,
"Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...");
logger.log(Type.INFO,
"Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...");
Date date = new Date();

// init composer, set class properties, create source writer
@@ -136,8 +135,9 @@ public class WidgetMapGenerator extends Generator {
sourceWriter.println("}");
// commit generated class
context.commit(logger, printWriter);
logger.log(Type.INFO, "Done. ("
+ (new Date().getTime() - date.getTime()) / 1000 + "seconds)");
logger.log(Type.INFO,
"Done. (" + (new Date().getTime() - date.getTime()) / 1000
+ "seconds)");

}

@@ -171,9 +171,8 @@ public class WidgetMapGenerator extends Generator {
}

}
logger
.log(Type.INFO,
"Widget set will contain implementations for following components: ");
logger.log(Type.INFO,
"Widget set will contain implementations for following components: ");

TreeSet<String> classNames = new TreeSet<String>();
for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {

+ 1
- 2
src/com/vaadin/terminal/gwt/widgetsetutils/WidgetSetBuilder.java View File

@@ -189,8 +189,7 @@ public class WidgetSetBuilder {
o.println(" 2. Give the widgetsetname (to be created or updated)"
+ " as first parameter");
o.println();
o
.println("All found vaadin widgetsets will be inherited in given widgetset");
o.println("All found vaadin widgetsets will be inherited in given widgetset");

}


+ 9
- 9
src/com/vaadin/tools/WidgetsetCompiler.java View File

@@ -37,23 +37,23 @@ public class WidgetsetCompiler {
*/
public static void main(final String[] args) {
try {
// run the compiler in a different thread to enable using the
// user-set stack size
// run the compiler in a different thread to enable using the
// user-set stack size

// on Windows, the default stack size is too small for the main
// thread and cannot be changed in JRE 1.5 (see
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197)
// on Windows, the default stack size is too small for the main
// thread and cannot be changed in JRE 1.5 (see
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197)

Runnable runCompiler = new Runnable() {
public void run() {
try {
// GWTCompiler.main(args);
// avoid warnings
// GWTCompiler.main(args);
// avoid warnings

String wsname = args[args.length - 1];

// TODO expecting this is launched via eclipse WTP
// project
// TODO expecting this is launched via eclipse WTP
// project
System.out
.println("Updating GWT module description file...");
WidgetSetBuilder.updateWidgetSet(wsname);

+ 3
- 3
src/com/vaadin/ui/AbstractComponent.java View File

@@ -320,7 +320,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* InlineDateField date = new InlineDateField(&quot;Datum&quot;);
*
* // German language specified with ISO 639-1 language
* // code and ISO 3166-1 alpha-2 country code.
* // code and ISO 3166-1 alpha-2 country code.
* date.setLocale(new Locale(&quot;de&quot;, &quot;DE&quot;));
*
* date.setResolution(DateField.RESOLUTION_DAY);
@@ -735,8 +735,8 @@ public abstract class AbstractComponent implements Component, MethodEventSource
}

if (eventIdentifiers != null) {
target.addAttribute("eventListeners", eventIdentifiers
.toArray());
target.addAttribute("eventListeners",
eventIdentifiers.toArray());
}

paintContent(target);

+ 1
- 3
src/com/vaadin/ui/AbstractLayout.java View File

@@ -59,9 +59,7 @@ public abstract class AbstractLayout extends AbstractComponentContainer
*/
public void setMargin(boolean topEnabled, boolean rightEnabled,
boolean bottomEnabled, boolean leftEnabled) {
margins
.setMargins(topEnabled, rightEnabled, bottomEnabled,
leftEnabled);
margins.setMargins(topEnabled, rightEnabled, bottomEnabled, leftEnabled);
requestRepaint();
}


+ 8
- 8
src/com/vaadin/ui/Component.java View File

@@ -473,9 +473,9 @@ public interface Component extends Paintable, VariableOwner, Sizeable,
* </p>
*
* @param caption
* the new caption for the component. If the caption is {@code
* null}, no caption is shown and it does not normally take any
* space
* the new caption for the component. If the caption is
* {@code null}, no caption is shown and it does not normally
* take any space
*/
public void setCaption(String caption);

@@ -533,10 +533,10 @@ public interface Component extends Paintable, VariableOwner, Sizeable,
* </p>
*
* <p>
* An icon will be rendered inside an HTML element that has the {@code
* v-icon} CSS style class. The containing layout may enclose an icon and a
* caption inside elements related to the caption, such as {@code v-caption}
* .
* An icon will be rendered inside an HTML element that has the
* {@code v-icon} CSS style class. The containing layout may enclose an icon
* and a caption inside elements related to the caption, such as
* {@code v-caption} .
* </p>
*
* This method will trigger a
@@ -1075,7 +1075,7 @@ public interface Component extends Paintable, VariableOwner, Sizeable,
*
* username.setTabIndex(1);
* password.setTabIndex(2);
* remember.setTabIndex(3); // Different than natural place
* remember.setTabIndex(3); // Different than natural place
* login.setTabIndex(4);
* </pre>
*

+ 1
- 1
src/com/vaadin/ui/CssLayout.java View File

@@ -33,7 +33,7 @@ import com.vaadin.terminal.gwt.client.ui.VCssLayout;
* <li>noticeably faster rendering time in some situations as we rely more on
* the browser's rendering engine.
* </ul>
*<p>
* <p>
* With {@link CustomLayout} one can often achieve similar results (good looking
* layouts with web technologies), but with CustomLayout developer needs to work
* with fixed templates.

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

@@ -266,8 +266,8 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget,
throws UploadException {
Html5File file = receivers.get(fileId);
if (file != null && file.receiver != null) {
OutputStream receiveUpload = file.receiver.receiveUpload(file
.getFileName(), "TODO");
OutputStream receiveUpload = file.receiver.receiveUpload(
file.getFileName(), "TODO");

InputStream stream = upstream.getStream();
byte[] buf = new byte[AbstractApplicationServlet.MAX_BUFFER_SIZE];

+ 6
- 6
src/com/vaadin/ui/Form.java View File

@@ -682,8 +682,9 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
* @see com.vaadin.data.Item.Viewer#setItemDataSource(Item)
*/
public void setItemDataSource(Item newDataSource) {
setItemDataSource(newDataSource, newDataSource != null ? newDataSource
.getItemPropertyIds() : null);
setItemDataSource(newDataSource,
newDataSource != null ? newDataSource.getItemPropertyIds()
: null);
}

/**
@@ -782,8 +783,8 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
Field f = getField(properties[i]);
layout.removeComponent(f);
if (newLayout instanceof CustomLayout) {
((CustomLayout) newLayout).addComponent(f, properties[i]
.toString());
((CustomLayout) newLayout).addComponent(f,
properties[i].toString());
} else {
newLayout.addComponent(f);
}
@@ -832,8 +833,7 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
+ propertyId.toString() + "' can not be found.");
}
final Object value = oldField.getPropertyDataSource() == null ? oldField
.getValue()
: oldField.getPropertyDataSource().getValue();
.getValue() : oldField.getPropertyDataSource().getValue();

// Checks that the value exists and check if the select should
// be forced in multiselect mode

+ 1
- 1
src/com/vaadin/ui/FormLayout.java View File

@@ -21,7 +21,7 @@ import com.vaadin.terminal.gwt.client.ui.VFormLayout;
* bottom are by default on.
*
*/
@SuppressWarnings( { "deprecation", "serial" })
@SuppressWarnings({ "deprecation", "serial" })
@ClientWidget(VFormLayout.class)
public class FormLayout extends OrderedLayout {


+ 4
- 2
src/com/vaadin/ui/GridLayout.java View File

@@ -18,6 +18,7 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.VGridLayout;
import com.vaadin.ui.GridLayout.OverlapsException;

/**
* <p>
@@ -1074,8 +1075,9 @@ public class GridLayout extends AbstractLayout implements
addComponent(newComponent);
} else if (newLocation == null) {
removeComponent(oldComponent);
addComponent(newComponent, oldLocation.getColumn1(), oldLocation
.getRow1(), oldLocation.getColumn2(), oldLocation.getRow2());
addComponent(newComponent, oldLocation.getColumn1(),
oldLocation.getRow1(), oldLocation.getColumn2(),
oldLocation.getRow2());
} else {
oldLocation.setComponent(newComponent);
newLocation.setComponent(oldComponent);

+ 1
- 1
src/com/vaadin/ui/Layout.java View File

@@ -6,8 +6,8 @@ package com.vaadin.ui;

import java.io.Serializable;

import com.vaadin.terminal.gwt.client.ui.VMarginInfo;
import com.vaadin.terminal.gwt.client.ui.AlignmentInfo.Bits;
import com.vaadin.terminal.gwt.client.ui.VMarginInfo;

/**
* Extension to the {@link ComponentContainer} interface which adds the

+ 3
- 5
src/com/vaadin/ui/Panel.java View File

@@ -8,8 +8,8 @@ import java.util.Iterator;
import java.util.Map;

import com.vaadin.event.Action;
import com.vaadin.event.ActionManager;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ActionManager;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
import com.vaadin.terminal.PaintException;
@@ -191,10 +191,8 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
// detach old content if present
if (content != null) {
content.setParent(null);
content
.removeListener((ComponentContainer.ComponentAttachListener) this);
content
.removeListener((ComponentContainer.ComponentDetachListener) this);
content.removeListener((ComponentContainer.ComponentAttachListener) this);
content.removeListener((ComponentContainer.ComponentDetachListener) this);
}

// Sets the panel to be parent for the content

+ 1
- 2
src/com/vaadin/ui/PopupView.java View File

@@ -47,8 +47,7 @@ public class PopupView extends AbstractComponentContainer {
* {@link PopupView#getComponentIterator()}.
*/
private static class SingleComponentIterator implements
Iterator<Component>,
Serializable {
Iterator<Component>, Serializable {

private final Component component;
private boolean first;

+ 1
- 2
src/com/vaadin/ui/Select.java View File

@@ -283,8 +283,7 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
int index = options.indexOf(selection);
if (index != -1 && (index < first || index >= last)) {
int newPage = (index + (needNullSelectOption ? 1
: 0))
/ pageLength;
: 0)) / pageLength;
currentPage = newPage;
return sanitetizeList(options, needNullSelectOption);
}

+ 3
- 3
src/com/vaadin/ui/Slider.java View File

@@ -41,7 +41,7 @@ import com.vaadin.terminal.gwt.client.ui.VSlider;
* setVolume(d.doubleValue());
* }
* }
*
*
* </code>
*
* @author IT Mill Ltd.
@@ -408,8 +408,8 @@ public class Slider extends AbstractField {
target.addAttribute("resolution", resolution);

if (resolution > 0) {
target.addVariable(this, "value", ((Double) getValue())
.doubleValue());
target.addVariable(this, "value",
((Double) getValue()).doubleValue());
} else {
target.addVariable(this, "value", ((Double) getValue()).intValue());
}

+ 2
- 0
src/com/vaadin/ui/TabSheet.java View File

@@ -21,6 +21,8 @@ import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.client.ui.VTabsheet;
import com.vaadin.terminal.gwt.server.CommunicationManager;
import com.vaadin.ui.TabSheet.CloseHandler;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.themes.Reindeer;
import com.vaadin.ui.themes.Runo;


+ 21
- 28
src/com/vaadin/ui/Table.java View File

@@ -24,9 +24,9 @@ import com.vaadin.data.Property;
import com.vaadin.data.util.ContainerOrderedWrapper;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.DataBoundTransferable;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.event.ItemClickEvent.ItemClickSource;
import com.vaadin.event.MouseEvents.ClickEvent;
@@ -553,8 +553,7 @@ public class Table extends AbstractSelect implements Action.Container,
this.columnHeaders.clear();
int i = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext()
&& i < columnHeaders.length; i++) {
.hasNext() && i < columnHeaders.length; i++) {
this.columnHeaders.put(it.next(), columnHeaders[i]);
}

@@ -617,8 +616,7 @@ public class Table extends AbstractSelect implements Action.Container,
this.columnIcons.clear();
int i = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext()
&& i < columnIcons.length; i++) {
.hasNext() && i < columnIcons.length; i++) {
this.columnIcons.put(it.next(), columnIcons[i]);
}

@@ -698,8 +696,7 @@ public class Table extends AbstractSelect implements Action.Container,
final HashMap<Object, String> newCA = new HashMap<Object, String>();
int i = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext()
&& i < columnAlignments.length; i++) {
.hasNext() && i < columnAlignments.length; i++) {
newCA.put(it.next(), columnAlignments[i]);
}
this.columnAlignments = newCA;
@@ -714,7 +711,7 @@ public class Table extends AbstractSelect implements Action.Container,
* small or very big values. Setting width to -1 (default) means that theme
* will make decision of width.
*
*<p>
* <p>
* Column can either have a fixed width or expand ratio. The latter one set
* is used. See @link {@link #setColumnExpandRatio(Object, float)}.
*
@@ -2075,8 +2072,8 @@ public class Table extends AbstractSelect implements Action.Container,

// Actions
if (variables.containsKey("action")) {
final StringTokenizer st = new StringTokenizer((String) variables
.get("action"), ",");
final StringTokenizer st = new StringTokenizer(
(String) variables.get("action"), ",");
if (st.countTokens() == 2) {
final Object itemId = itemIdMapper.get(st.nextToken());
final Action action = (Action) actionMapper.get(st.nextToken());
@@ -2337,8 +2334,7 @@ public class Table extends AbstractSelect implements Action.Container,
final boolean[] iscomponent = new boolean[visibleColumns.size()];
int iscomponentIndex = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext()
&& iscomponentIndex < iscomponent.length;) {
.hasNext() && iscomponentIndex < iscomponent.length;) {
final Object columnId = it.next();
if (columnGenerators.containsKey(columnId)) {
iscomponent[iscomponentIndex++] = true;
@@ -2383,8 +2379,8 @@ public class Table extends AbstractSelect implements Action.Container,

// The select variable is only enabled if selectable
if (selectable) {
target.addVariable(this, "selected", selectedKeys
.toArray(new String[selectedKeys.size()]));
target.addVariable(this, "selected",
selectedKeys.toArray(new String[selectedKeys.size()]));
}

// The cursors are only shown on pageable table
@@ -2394,8 +2390,8 @@ public class Table extends AbstractSelect implements Action.Container,

// Sorting
if (getContainerDataSource() instanceof Container.Sortable) {
target.addVariable(this, "sortcolumn", columnIdMap
.key(sortContainerPropertyId));
target.addVariable(this, "sortcolumn",
columnIdMap.key(sortContainerPropertyId));
target.addVariable(this, "sortascending", sortAscending);
}

@@ -2429,8 +2425,7 @@ public class Table extends AbstractSelect implements Action.Container,
final String[] colorder = new String[visibleColumns.size()];
int i = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext()
&& i < colorder.length;) {
.hasNext() && i < colorder.length;) {
colorder[i++] = columnIdMap.key(it.next());
}
target.addVariable(this, "columnorder", colorder);
@@ -2448,8 +2443,7 @@ public class Table extends AbstractSelect implements Action.Container,
final String[] collapsedkeys = new String[ccs.size()];
int nextColumn = 0;
for (final Iterator<Object> it = visibleColumns.iterator(); it
.hasNext()
&& nextColumn < collapsedkeys.length;) {
.hasNext() && nextColumn < collapsedkeys.length;) {
final Object columnId = it.next();
if (isColumnCollapsed(columnId)) {
collapsedkeys[nextColumn++] = columnIdMap.key(columnId);
@@ -2485,8 +2479,8 @@ public class Table extends AbstractSelect implements Action.Container,
}
if (columnWidths.containsKey(columnId)) {
if (getColumnWidth(columnId) > -1) {
target.addAttribute("width", String
.valueOf(getColumnWidth(columnId)));
target.addAttribute("width",
String.valueOf(getColumnWidth(columnId)));
} else {
target.addAttribute("er",
getColumnExpandRatio(columnId));
@@ -2542,8 +2536,7 @@ public class Table extends AbstractSelect implements Action.Container,
c.paint(target);
}
} else {
target
.addText((String) cells[CELL_FIRSTCOL + currentColumn][indexInRowbuffer]);
target.addText((String) cells[CELL_FIRSTCOL + currentColumn][indexInRowbuffer]);
}
}

@@ -2557,8 +2550,8 @@ public class Table extends AbstractSelect implements Action.Container,

paintRowIcon(target, cells, indexInRowbuffer);
paintRowHeader(target, cells, indexInRowbuffer);
target.addAttribute("key", Integer
.parseInt(cells[CELL_KEY][indexInRowbuffer].toString()));
target.addAttribute("key",
Integer.parseInt(cells[CELL_KEY][indexInRowbuffer].toString()));

if (isSelected(itemId)) {
target.addAttribute("selected", true);
@@ -3697,8 +3690,8 @@ public class Table extends AbstractSelect implements Action.Container,
AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dragEvent
.getTargetDetails();
table = (Table) dragEvent.getTargetDetails().getTarget();
ArrayList<Object> visibleItemIds = new ArrayList<Object>(table
.getPageLength());
ArrayList<Object> visibleItemIds = new ArrayList<Object>(
table.getPageLength());
visibleItemIds.size();
Object id = table.getCurrentPageFirstItemId();
for (int i = 0; i < table.getPageLength() && id != null; i++) {

+ 7
- 7
src/com/vaadin/ui/Tree.java View File

@@ -25,9 +25,9 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.event.Action;
import com.vaadin.event.DataBoundTransferable;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.Transferable;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.event.ItemClickEvent.ItemClickSource;
import com.vaadin.event.Transferable;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DragSource;
import com.vaadin.event.dd.DropHandler;
@@ -436,8 +436,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
// Actions
if (variables.containsKey("action")) {

final StringTokenizer st = new StringTokenizer((String) variables
.get("action"), ",");
final StringTokenizer st = new StringTokenizer(
(String) variables.get("action"), ",");
if (st.countTokens() == 2) {
final Object itemId = itemIdMapper.get(st.nextToken());
final Action action = (Action) actionMapper.get(st.nextToken());
@@ -508,8 +508,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
target.addAttribute("selectmode", (isMultiSelect() ? "multi"
: "single"));
if (isMultiSelect()) {
target.addAttribute("multiselectmode", multiSelectMode
.ordinal());
target.addAttribute("multiselectmode",
multiSelectMode.ordinal());
}
} else {
target.addAttribute("selectmode", "none");
@@ -661,8 +661,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
partialUpdate = false;
} else {
// Selected
target.addVariable(this, "selected", selectedKeys
.toArray(new String[selectedKeys.size()]));
target.addVariable(this, "selected",
selectedKeys.toArray(new String[selectedKeys.size()]));

// Expand and collapse
target.addVariable(this, "expand", new String[] {});

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

@@ -18,9 +18,9 @@ import java.util.Set;

import com.vaadin.Application;
import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutListener;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.event.ShortcutListener;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
@@ -37,8 +37,8 @@ import com.vaadin.terminal.gwt.client.ui.VWindow;
* <p>
* If the window is a application window or a sub window depends on how it is
* added to the application. Adding a {@code Window} to a {@code Window} using
* {@link Window#addWindow(Window)} makes it a sub window and adding a {@code
* Window} to the {@code Application} using
* {@link Window#addWindow(Window)} makes it a sub window and adding a
* {@code Window} to the {@code Application} using
* {@link Application#addWindow(Window)} makes it an application window.
* </p>
* <p>
@@ -378,8 +378,8 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
* <b>Application window only</b>. Handles an URI by passing the URI to all
* URI handlers defined using {@link #addURIHandler(URIHandler)}. All URI
* handlers are called for each URI but no more than one handler may return
* a {@link DownloadStream}. If more than one stream is returned a {@code
* RuntimeException} is thrown.
* a {@link DownloadStream}. If more than one stream is returned a
* {@code RuntimeException} is thrown.
*
* @param context
* The URL of the application
@@ -470,8 +470,8 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
/**
* <b>Application window only</b>. Handles parameters by passing the
* parameters to all {@code ParameterHandler}s defined using
* {@link #addParameterHandler(ParameterHandler)}. All {@code
* ParameterHandler}s are called for each set of parameters.
* {@link #addParameterHandler(ParameterHandler)}. All
* {@code ParameterHandler}s are called for each set of parameters.
*
* @param parameters
* a map containing the parameter names and values
@@ -822,10 +822,10 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
* name of the window is used to uniquely identify it.
* <p>
* The name also determines the URL that can be used for direct access to a
* window. All windows can be accessed through {@code
* http://host:port/app/win} where {@code http://host:port/app} is the
* application URL (as returned by {@link Application#getURL()} and {@code
* win} is the window name.
* window. All windows can be accessed through
* {@code http://host:port/app/win} where {@code http://host:port/app} is
* the application URL (as returned by {@link Application#getURL()} and
* {@code win} is the window name.
* </p>
* <p>
* Note! Portlets do not support direct window access through URLs.
@@ -908,10 +908,10 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
* application.
* <p>
* The name also determines the URL that can be used for direct access to a
* window. All windows can be accessed through {@code
* http://host:port/app/win} where {@code http://host:port/app} is the
* application URL (as returned by {@link Application#getURL()} and {@code
* win} is the window name.
* window. All windows can be accessed through
* {@code http://host:port/app/win} where {@code http://host:port/app} is
* the application URL (as returned by {@link Application#getURL()} and
* {@code win} is the window name.
* </p>
* <p>
* This method can only be called before the window is added to an

+ 2
- 2
tests/src/com/vaadin/tests/CustomLayoutDemo.java View File

@@ -5,6 +5,8 @@
package com.vaadin.tests;

import com.vaadin.ui.Button;
import com.vaadin.ui.Component.Event;
import com.vaadin.ui.Component.Listener;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Field;
import com.vaadin.ui.Label;
@@ -12,8 +14,6 @@ import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.Window;
import com.vaadin.ui.Component.Event;
import com.vaadin.ui.Component.Listener;

/**
* This example demonstrates custom layout. All components created here are

+ 1
- 1
tests/src/com/vaadin/tests/FocusingComponents.java View File

@@ -2,6 +2,7 @@ package com.vaadin.tests;

import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DateField;
@@ -10,7 +11,6 @@ import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Button.ClickEvent;

/**
* Simple test helper to test Focusable.focus() method.

+ 7
- 9
tests/src/com/vaadin/tests/LayoutDemo.java View File

@@ -75,8 +75,7 @@ public class LayoutDemo extends com.vaadin.Application {
// Create TabSheet
//
final TabSheet tabsheet = new TabSheet();
tabsheet
.setCaption("Tabsheet, above layouts are added to this component");
tabsheet.setCaption("Tabsheet, above layouts are added to this component");
tabsheet.addTab(layoutA, "Horizontal ordered layout", null);
tabsheet.addTab(layoutB, "Vertical ordered layout", null);
tabsheet.addTab(layoutG, "First grid layout", null);
@@ -121,13 +120,12 @@ public class LayoutDemo extends com.vaadin.Application {
private Component getExampleComponent(String caption) {
final Panel panel = new Panel();
panel.setCaption("Panel component " + caption);
panel
.addComponent(new Label(
"Panel is a container for other components, by default it draws a frame around it's "
+ "extremities and may have a caption to clarify the nature of the contained components' purpose."
+ " Panel contains an layout where the actual contained components are added, "
+ "this layout may be switched on the fly.",
Label.CONTENT_XHTML));
panel.addComponent(new Label(
"Panel is a container for other components, by default it draws a frame around it's "
+ "extremities and may have a caption to clarify the nature of the contained components' purpose."
+ " Panel contains an layout where the actual contained components are added, "
+ "this layout may be switched on the fly.",
Label.CONTENT_XHTML));
panel.setWidth(222);
return panel;
}

+ 2
- 2
tests/src/com/vaadin/tests/ListenerOrder.java View File

@@ -3,18 +3,18 @@ package com.vaadin.tests;
import java.util.HashMap;
import java.util.Iterator;

import com.vaadin.data.Item;
import com.vaadin.data.Container.ItemSetChangeEvent;
import com.vaadin.data.Container.ItemSetChangeListener;
import com.vaadin.data.Container.PropertySetChangeEvent;
import com.vaadin.data.Container.PropertySetChangeListener;
import com.vaadin.data.Item;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;

public class ListenerOrder extends com.vaadin.Application implements
Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener,

+ 2
- 2
tests/src/com/vaadin/tests/ModalWindow.java View File

@@ -5,11 +5,11 @@
package com.vaadin.tests;

import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

/**
* Simple program that demonstrates "modal windows" that block all access other

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


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save