Преглед изворни кода

merge master

tags/7.0.0.beta1
Jouni Koivuviita пре 12 година
родитељ
комит
8356465b38
100 измењених фајлова са 1081 додато и 155 уклоњено
  1. 5
    0
      WebContent/VAADIN/themes/base/table/table.css
  2. 3
    1
      WebContent/VAADIN/themes/base/textfield/richtext.css
  3. 9
    2
      WebContent/VAADIN/themes/base/treetable/treetable.css
  4. 3
    3
      WebContent/VAADIN/themes/reindeer/table/table.css
  5. 28
    38
      WebContent/release-notes.html
  6. 14
    0
      WebContent/statictestfiles/LoginFormIframe.html
  7. 0
    13
      WebContent/statictestfiles/jsconnector.js
  8. 1
    1
      build/GWT-VERSION.properties
  9. 1
    0
      build/build.properties
  10. 201
    26
      build/build.xml
  11. 40
    28
      build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java
  12. 12
    5
      build/ivy/ivy.xml
  13. 38
    1
      build/javadoc/j2se-1.6.0/package-list
  14. 31
    0
      scripts/merge-check.sh
  15. 16
    0
      src/com/vaadin/Application.java
  16. 85
    0
      src/com/vaadin/Vaadin.gwt.xml
  17. 42
    0
      src/com/vaadin/annotations/JavaScript.java
  18. 0
    24
      src/com/vaadin/annotations/LoadScripts.java
  19. 38
    0
      src/com/vaadin/annotations/StyleSheet.java
  20. 1
    0
      src/com/vaadin/data/Container.java
  21. 1
    0
      src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java
  22. 12
    0
      src/com/vaadin/data/util/AbstractBeanContainer.java
  23. 2
    0
      src/com/vaadin/data/util/AbstractContainer.java
  24. 22
    0
      src/com/vaadin/data/util/AbstractInMemoryContainer.java
  25. 8
    0
      src/com/vaadin/data/util/AbstractProperty.java
  26. 1
    0
      src/com/vaadin/data/util/BeanItemContainer.java
  27. 28
    0
      src/com/vaadin/data/util/ContainerHierarchicalWrapper.java
  28. 27
    0
      src/com/vaadin/data/util/ContainerOrderedWrapper.java
  29. 3
    0
      src/com/vaadin/data/util/DefaultItemSorter.java
  30. 26
    0
      src/com/vaadin/data/util/FilesystemContainer.java
  31. 8
    0
      src/com/vaadin/data/util/HierarchicalContainer.java
  32. 8
    0
      src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java
  33. 24
    0
      src/com/vaadin/data/util/IndexedContainer.java
  34. 1
    0
      src/com/vaadin/data/util/ItemSorter.java
  35. 3
    0
      src/com/vaadin/data/util/MethodProperty.java
  36. 3
    0
      src/com/vaadin/data/util/MethodPropertyDescriptor.java
  37. 3
    0
      src/com/vaadin/data/util/NestedMethodProperty.java
  38. 3
    0
      src/com/vaadin/data/util/NestedPropertyDescriptor.java
  39. 3
    0
      src/com/vaadin/data/util/ObjectProperty.java
  40. 7
    0
      src/com/vaadin/data/util/PropertyFormatter.java
  41. 7
    0
      src/com/vaadin/data/util/PropertysetItem.java
  42. 29
    0
      src/com/vaadin/data/util/QueryContainer.java
  43. 3
    0
      src/com/vaadin/data/util/TextFileProperty.java
  44. 7
    0
      src/com/vaadin/data/util/TransactionalPropertyWrapper.java
  45. 4
    0
      src/com/vaadin/data/util/converter/DateToLongConverter.java
  46. 1
    0
      src/com/vaadin/data/util/converter/DefaultConverterFactory.java
  47. 4
    0
      src/com/vaadin/data/util/converter/ReverseConverter.java
  48. 4
    0
      src/com/vaadin/data/util/converter/StringToBooleanConverter.java
  49. 4
    0
      src/com/vaadin/data/util/converter/StringToDateConverter.java
  50. 4
    0
      src/com/vaadin/data/util/converter/StringToDoubleConverter.java
  51. 4
    0
      src/com/vaadin/data/util/converter/StringToIntegerConverter.java
  52. 4
    0
      src/com/vaadin/data/util/converter/StringToNumberConverter.java
  53. 1
    0
      src/com/vaadin/data/util/filter/AbstractJunctionFilter.java
  54. 1
    0
      src/com/vaadin/data/util/filter/And.java
  55. 2
    0
      src/com/vaadin/data/util/filter/Between.java
  56. 2
    0
      src/com/vaadin/data/util/filter/Compare.java
  57. 2
    0
      src/com/vaadin/data/util/filter/IsNull.java
  58. 2
    0
      src/com/vaadin/data/util/filter/Like.java
  59. 2
    0
      src/com/vaadin/data/util/filter/Not.java
  60. 1
    0
      src/com/vaadin/data/util/filter/Or.java
  61. 2
    0
      src/com/vaadin/data/util/filter/SimpleStringFilter.java
  62. 5
    0
      src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java
  63. 4
    0
      src/com/vaadin/data/util/sqlcontainer/RowItem.java
  64. 34
    0
      src/com/vaadin/data/util/sqlcontainer/SQLContainer.java
  65. 3
    0
      src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java
  66. 3
    0
      src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java
  67. 12
    0
      src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java
  68. 16
    0
      src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java
  69. 61
    5
      src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java
  70. 1
    1
      src/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java
  71. 11
    1
      src/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java
  72. 24
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java
  73. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java
  74. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java
  75. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java
  76. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java
  77. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java
  78. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java
  79. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java
  80. 2
    0
      src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java
  81. 1
    0
      src/com/vaadin/data/validator/AbstractValidator.java
  82. 3
    0
      src/com/vaadin/data/validator/BeanValidator.java
  83. 1
    0
      src/com/vaadin/data/validator/CompositeValidator.java
  84. 1
    0
      src/com/vaadin/data/validator/NullValidator.java
  85. 6
    0
      src/com/vaadin/event/ActionManager.java
  86. 5
    0
      src/com/vaadin/event/EventRouter.java
  87. 4
    2
      src/com/vaadin/event/FieldEvents.java
  88. 1
    1
      src/com/vaadin/event/ItemClickEvent.java
  89. 2
    2
      src/com/vaadin/event/LayoutEvents.java
  90. 1
    1
      src/com/vaadin/event/MouseEvents.java
  91. 1
    0
      src/com/vaadin/event/ShortcutListener.java
  92. 4
    0
      src/com/vaadin/event/TransferableImpl.java
  93. 2
    0
      src/com/vaadin/event/dd/TargetDetailsImpl.java
  94. 1
    0
      src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java
  95. 1
    0
      src/com/vaadin/event/dd/acceptcriteria/And.java
  96. 3
    0
      src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java
  97. 1
    0
      src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java
  98. 1
    0
      src/com/vaadin/event/dd/acceptcriteria/Not.java
  99. 1
    0
      src/com/vaadin/event/dd/acceptcriteria/Or.java
  100. 0
    0
      src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java

+ 5
- 0
WebContent/VAADIN/themes/base/table/table.css Прегледај датотеку

@@ -241,6 +241,11 @@
.v-off {
color: #ddd;
}

.v-table .v-checkbox {
display: inline-block;
}

/*************************************
* Drag'n'drop styles
*************************************/

+ 3
- 1
WebContent/VAADIN/themes/base/textfield/richtext.css Прегледај датотеку

@@ -6,7 +6,9 @@
background: #fff;
border: none;
}

.v-richtextarea .gwt-HTML {
height: 100%;
}
.v-richtextarea .gwt-RichTextToolbar {
white-space: nowrap;
background: #959595 url(img/richtext-toolbar-bg.png) repeat-x 0 -42px;

+ 9
- 2
WebContent/VAADIN/themes/base/treetable/treetable.css Прегледај датотеку

@@ -4,14 +4,17 @@
height: 10px;
/* defines the amount of indent per level */
width: 18px;
position: absolute;
left: 0;
top: 5px;
}

.v-treetable-node-closed {
background: url(../treetable/img/arrow-right.png) right center no-repeat;
background: url(../treetable/img/arrow-right.png) right top no-repeat;
}

.v-treetable-node-open {
background: url(../treetable/img/arrow-down.png) right center no-repeat;
background: url(../treetable/img/arrow-down.png) right top no-repeat;
}

.v-treetable .v-checkbox {
@@ -25,6 +28,10 @@
z-index: 10;
}

.v-treetable .v-table-cell-wrapper {
position: relative;
}

.v-treetable .v-table-body .v-table-table .v-table-row-animating {
zoom:1;
z-index:1;

+ 3
- 3
WebContent/VAADIN/themes/reindeer/table/table.css Прегледај датотеку

@@ -112,9 +112,9 @@
text-shadow: #f3f5f8 0 1px 0;
line-height: normal;
}
.v-table-generated-row .v-table-cell-content {
padding-top: 1px;
padding-bottom: 2px;
.v-table-generated-row .v-table-cell-wrapper {
padding-top: 4px;
padding-bottom: 5px;
}
.v-table-cell-content:last-child {
border-right-color: transparent;

+ 28
- 38
WebContent/release-notes.html Прегледај датотеку

@@ -71,47 +71,50 @@
<h2 id="enhancements">Enhancements in Vaadin @version-minor@</h2>

<p>
@version-minor@ is the second development release of the upcoming Version 7 of the
Vaadin Framework. It introduces the second set of new features in Vaadin 7, for the
@version-minor@ is the third development release of the upcoming Version 7 of the
Vaadin Framework. It introduces the third set of new features in Vaadin 7, for the
purpose of receiving feedback about the changes.
</p>

<p>The major changes in this second alpha phase are:</p>
<p>The major changes in this third alpha phase are:</p>

<ul>
<li>Complete overhaul of the client-server communication architecture
<li>GWT is now built into Vaadin Framework
<ul>
<li>All add-on components that have widgets need to be ported to Vaadin 7</li>
<li>Integration of a GWT widget is done in a <i>connector</i> class</li>
<li>Component-to-widget mapping now defined on the client-side, in the connector</li>
<li>No more <b style="text-decoration: line-through">Paintable</b> or <b style="text-decoration: line-through">VariableOwner</b>
<li>Server-side component and client-side widget can have a <emphasis>shared state</emphasis> object which is automatically synchronized</li>
<li>Both client-side and server-side can make RPC calls to the other side
<ul>
<li>Communicated in the next request/response</li>
<li>No return values
<li>Typically for communicating events</li>
</ul>
</li>
<li>UIDL is deprecated</li>
<li>Compatibility layer for Vaadin 6 included for easy migration</li>
<li>New SuperDevMode allows debugging client-side Java code in the browser without any plugins</li>
</ul>
</li>
<li>Get computed style of a component from the browser</li>
<li>Support for border, padding, and margin in core layout components</li>
<li>Support for JavaScript components - GWT integration code not required</li>
<li>Handle JavaScript callbacks on the server-side</li>
<li>Component and root extensions</li>
<li>Navigation API for view navigation
<ul>
<li>View navigation with bookmarking/linking with URI fragments and browser history support</li>
<li>Access control for views, view change confirmation</li>
</ul>
</li>
<li>Resource loading (JS/CSS) by the framework</li>
</ul>

<p>
The enchancements are described in more detail in the <a
The enhancements are described in more detail in the <a
href="https://vaadin.com/wiki/-/wiki/Main/Vaadin+7">mini-tutorials</a> in the
Vaadin Wiki.
</p>

<p>
Please see the release notes for <a
href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.alpha1/release-notes.html">alpha1</a>
and <a
href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.alpha2/release-notes.html">alpha2</a>
for a complete list of major enhancements for Vaadin 7 so far.
</p>

<h3 id="changelog">ChangeLog</h3>

<p>
For a complete list of changes in this release, please see the <a
href="http://dev.vaadin.com/query?status=closed&group=resolution&milestone=Vaadin+7.0.0.alpha2">list
href="http://dev.vaadin.com/query?status=closed&group=resolution&milestone=Vaadin+7.0.0.alpha3">list
of closed tickets</a>.
</p>

@@ -142,18 +145,6 @@

<h2 id="dependencies">Vaadin @version@ Dependencies</h2>

<h3>Google Web Toolkit (GWT)</h3>

<p>
Vaadin uses GWT @gwt-version@ for widget set compilation. GWT can be downloaded
from <a
href="http://code.google.com/webtoolkit/">http://code.google.com/webtoolkit/</a>.
GWT can also be automatically downloaded by the Vaadin Plug-in for Eclipse. Please
note that GWT @gwt-version@ requires the <i>validation-api-1.0.0.GA.jar</i> and
<i>validation-api-1.0.0.GA-sources.jar</i> files in addition to <i>gwt-dev.jar</i>
and <i>gwt-user.jar</i> for widget set compilation.
</p>

<h3>Bean Validation</h3>

<p>
@@ -307,9 +298,8 @@
<h2 id="supportedversions">Supported Technologies</h2>

<p>
Vaadin 7 is compatible with <b>Java 5</b> and it is also compatible with most other
operating system supporting Java 5 or newer. However, using Java 6 is recommended,
as it is required by widget set compilation.
Vaadin 7 is compatible with <b>Java 6</b> and it is also compatible with most other
operating system supporting Java 6 or newer.
</p>

<p>

+ 14
- 0
WebContent/statictestfiles/LoginFormIframe.html Прегледај датотеку

@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>LoginForm</title>
<script type="text/javascript">
window.name="LoginForm";
</script>
</head>
<body>
<p>Tests that LoginForm can be submitted even when the Application is embedded inside an iframe</p>
<iframe src="/run/com.vaadin.tests.components.loginform.LoginFormTest?restartApplication" name="LoginForm" height="500px" width="500px"></iframe>
</body>
</html>

+ 0
- 13
WebContent/statictestfiles/jsconnector.js Прегледај датотеку

@@ -1,13 +0,0 @@
window.com_vaadin_tests_components_javascriptcomponent_BasicJavaScriptComponent_ExampleWidget = function() {
var connector = this;
var rootElement = connector.getWidgetElement();
rootElement.innerHTML = 'Hello world!';
rootElement.onclick = function() {
connector.getRpcProxy().onClick("message");
connector.onclick("another message");
}
connector.onStateChange = function() {
console.log('state change:', this.getState());
}
}

+ 1
- 1
build/GWT-VERSION.properties Прегледај датотеку

@@ -1,2 +1,2 @@
gwt-version=2.4.0
gwt-version=2.5.0
gwt-version-dependencies=validation-api-1.0.0.GA.jar, validation-api-1.0.0.GA-sources.jar

+ 1
- 0
build/build.properties Прегледај датотеку

@@ -4,6 +4,7 @@ product-file=vaadin
product-name=Vaadin
vaadin-package=com/vaadin
gwt-dir=lib/core/gwt
required.java.version=1.6

# repository into which Maven snapshots should be published
snapshot.repository.url=http://oss.sonatype.org/content/repositories/vaadin-snapshots

+ 201
- 26
build/build.xml Прегледај датотеку

@@ -34,16 +34,69 @@
<path id="additional.jar.path">
<fileset dir="build" includes="lib/**/*.jar" ></fileset>
</path>

<!-- Default location for GWT check-out: trunk and tools in a directory next to Vaadin project -->
<property name="gwt.root" value="${basedir}/../trunk"/>

<property name="gwt.build.dir" value="${gwt.root}/build"/>
<property name="gwt.tools" value="${gwt.root}/../tools"/>
<property name="gwt.tools.lib" value="${gwt.tools}/lib"/>
<property name="gwt.lib.dir" value="${gwt.build.dir}/lib"/>
<property name="gwt.user.jar" value="${gwt.lib.dir}/gwt-user.jar"/>
<property name="gwt.dev.jar" value="${gwt.lib.dir}/gwt-dev.jar"/>
<property name="gwt.codeserver.jar" value="${gwt.lib.dir}/gwt-codeserver.jar"/>
<property name="gwt.elemental.jar" value="${gwt.lib.dir}/gwt-elemental.jar"/>

<property name="gwt.user.dir" value="${gwt.root}/user"/>
<property name="gwt.user.bin" value="${gwt.build.dir}/out/user/bin"/>

<property name="jarjar-jar" value="${gwt.tools.lib}/tonicsystems/jarjar-1.0rc8.jar"/>

<path id="compile.classpath.server-side">
<path refid="additional.jar.path" />

<!-- GWT -->
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.dev.jar}" />

<!-- GWT dependencies - included in gwt-user.jar -->
<!--
<pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
<pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3-gg2.jar" />
-->

<path refid="ivy.compile.classpath.server-side" />
</path>
<path id="compile.classpath.client-side">
<path refid="additional.jar.path" />
<path refid="ivy.compile.classpath.client-side" />
<path refid="additional.jar.path" />
<!-- GWT user -->
<!--
<pathelement path="${gwt.user.dir}/src" />
<pathelement path="${gwt.user.dir}/super" />
<pathelement path="${gwt.user.dir}/out/user/bin"/>
-->
<!-- GWT -->
<pathelement location="${gwt.user.jar}" />
<pathelement location="${gwt.dev.jar}" />

<!-- GWT dependencies - included in gwt-user.jar -->
<!--
<pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
<pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3-gg2.jar" />
-->

<path refid="ivy.compile.classpath.client-side" />
</path>
<path id="compile.classpath.server-side-tests">
<path refid="additional.jar.path" />

<!-- GWT -->
<pathelement location="${gwt.user.jar}" />
<!-- needed at least for Apache Commons -->
<pathelement location="${gwt.dev.jar}" />

<path refid="ivy.compile.classpath.server-side-tests" />
</path>
</target>
@@ -68,6 +121,7 @@
<property name="result-classes-core" value="${result-path}/classes/core"/>
<property name="result-classes-junit" value="${result-path}/classes/junit"/>
<property name="result-classes-testbench" value="${result-path}/classes/testbench"/>
<property name="result-precompiled-widgetsets" value="${result-path}/classes/widgetsets"/>
<!-- Folder where Emma instrumented classes are placed (if Emma is used)-->
<property name="result-classes-core-for-emma-war" value="${result-path}/classes/emma-war"/>
<property name="result-classes-core-for-emma-junit" value="${result-path}/classes/emma-junit"/>
@@ -77,6 +131,7 @@
<path refid="compile.classpath.client-side" />
<pathelement location="${result-classes-core}" />
<pathelement location="${result-src-core}" />
<pathelement location="${result-precompiled-widgetsets}" />
</path>
</target>
<target name="clean-all" depends="clean-result">
@@ -85,6 +140,7 @@
<include name="*.png" />
</fileset>
</delete>
<delete failonerror="false" dir="WebContent/VAADIN/gwt-unitCache" />
</target>

<!-- ================================================================== -->
@@ -95,11 +151,11 @@
<target name="check-java-version">
<condition property="java.version.matches">
<or>
<equals arg1="${ant.java.version}" arg2="1.5"/>
<equals arg1="${ant.java.version}" arg2="${required.java.version}"/>
<isset property="ignoreversion"/>
</or>
</condition>
<fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java 1.5 compiler. Use -Dignoreversion=1 for ant to ignore the version check."/>
<fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java ${required.java.version} compiler. Use -Dignoreversion=1 for ant to ignore the version check."/>
<echo>Java version is ${ant.java.version} as required.</echo>
</target>

@@ -107,7 +163,7 @@
<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- ================================================================== -->

<target name="init" depends="init-deps, build.properties">
<target name="init" depends="init-deps, build.properties, check-java-version">
<!-- Current timestamp in different formats. -->
<tstamp>
<format property="build.date" pattern="yyyy-MM-dd"/>
@@ -265,7 +321,7 @@
description="Build package required files, without packing them.">
</target>

<target name="compile-server-side" depends="compile-core, webcontent"/>
<target name="compile-server-side" depends="compile-gwt, compile-core, webcontent"/>

<!-- Copy and preprocess sources for packaging
NOTE: Replaces <version></version> tags with build version tag for some "textual" files
@@ -348,10 +404,6 @@
</fileset>
</copy>
<!-- Unify mix usage of mac/Linux/Win characters -->
<echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo>
<fixcrlf srcdir="${result-path}/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" />

<!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
<echo>Copying non java/html/css/xml files such as images.</echo>
<copy todir="${result-src-core}">
@@ -439,7 +491,7 @@
<echo>Compiling src (server-side)</echo>
<!-- Compile core sources first as the other sources depend on these -->
<mkdir dir="${result-classes-core}" />
<javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-core}" debug="true" encoding="UTF-8" includeantruntime="false">
<javac source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server-side" destdir="${result-classes-core}" debug="true" encoding="UTF-8" includeantruntime="false">
<src path="${result-src-core}"/>
</javac>
</target>
@@ -448,7 +500,7 @@
<echo>Compiling src (Server and client side JUnit tests)</echo>
<!-- Compile server and client side JUnit tests -->
<mkdir dir="${result-classes-junit}" />
<javac source="1.5" target="1.5" classpathref="compile.classpath.server-side-tests" destdir="${result-classes-junit}" debug="true" encoding="UTF-8" includeantruntime="false">
<javac source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server-side-tests" destdir="${result-classes-junit}" debug="true" encoding="UTF-8" includeantruntime="false">
<classpath path="${result-classes-core}"></classpath>
<src path="${result-src-junit}"/>
</javac>
@@ -456,7 +508,7 @@
<echo>Compiling src (TestBench tests)</echo>
<!-- Compile TestBench tests -->
<mkdir dir="${result-classes-testbench}" />
<javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-testbench}" debug="true" encoding="UTF-8" includeantruntime="false">
<javac source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server-side" destdir="${result-classes-testbench}" debug="true" encoding="UTF-8" includeantruntime="false">
<classpath path="${result-classes-junit}"></classpath>
<classpath path="${result-classes-core}"></classpath>
<src path="${result-src-testbench}"/>
@@ -467,7 +519,7 @@
<target name="compile-helpers" depends="init">
<mkdir dir="${buildhelpers-classes}" />
<ivy:cachepath pathid="buildhelpers.dependencies" resolveId="buildhelpers" conf="compile" file="build/ivy/buildhelpers-ivy.xml"/>
<javac source="1.5" target="1.5" includeantruntime="false" srcdir="${buildhelpers-src}"
<javac source="${required.java.version}" target="${required.java.version}" includeantruntime="false" srcdir="${buildhelpers-src}"
classpathref="buildhelpers.dependencies" destdir="${buildhelpers-classes}" debug="true" encoding="UTF-8" />
</target>
@@ -520,6 +572,22 @@
<property name="widgetset-extraParams" value="" />
<echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo>
<mkdir dir="${widgetsets-output-dir}"/>

<!-- Disabled to reduce JAR size: precompile the widgetset to a .gwtar file -->
<!--
<java classname="com.google.gwt.dev.CompileModule" classpathref="compile.classpath.widgetset" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-out" />
<arg value="${result-precompiled-widgetsets}" />
<arg value="-strict" />
<arg value="${widgetset}" />

<jvmarg value="-Xss8M"/>
<jvmarg value="-XX:MaxPermSize=256M"/>
<jvmarg value="-Djava.awt.headless=true"/>
</java>
-->
<!-- compile the widgetset -->
<java classname="com.google.gwt.dev.Compiler" classpathref="compile.classpath.widgetset" failonerror="yes" fork="yes" maxmemory="512m">
<arg value="-war" />
<arg value="${widgetsets-output-dir}" />
@@ -528,13 +596,16 @@
<arg value="-strict" />
<arg value="-localWorkers" />
<arg value="${widgetset-localWorkers}" />
<arg line="${widgetset-extraParams}" />
<arg line="${widgetset-extraParams}" />
<arg value="${widgetset}" />
<sysproperty key="vFailIfNotSerializable" value="true" />

<jvmarg value="-Xss8M"/>
<jvmarg value="-XX:MaxPermSize=256M"/>
<jvmarg value="-Djava.awt.headless=true"/>
</java>
<antcall target="remove-widgetset-gwt-tmp"/>
<echo>Compiled ${widgetset}</echo>
@@ -570,7 +641,7 @@
<!-- Compiles all widgetsets. -->
<!-- This is called when building packages and when compiling all -->
<!-- widgetsets, but not when compiling individual widgetsets. -->
<target name="compile-client-side" depends="compile-server-side, compile-tests">
<target name="compile-client-side" depends="compile-gwt, compile-server-side, compile-tests">
<echo>Compiling widget sets in parallel.</echo>
<parallel threadsperprocessor="1">
<antcall inheritrefs="true" target="compile-widgetset-default"/>
@@ -592,14 +663,31 @@
<target name="widgetsets" depends="init-nonpackage, init, compile-widgetset-generator, compile-client-side"/>

<!-- Build each widgetset locally, i.e., not for an installation package. -->
<target name="widgetset-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-default" description="Compile the DefaultWidgetSet"/>
<target name="widgetset-testing" depends="init-nonpackage, init, compile-tests, compile-widgetset-generator, compile-widgetset-testing"/>
<target name="widgetset-portal-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-portal-default"/>
<target name="widgetset-default" depends="init-nonpackage, init, compile-gwt, compile-widgetset-generator, compile-widgetset-default" description="Compile the DefaultWidgetSet"/>
<target name="widgetset-testing" depends="init-nonpackage, init, compile-gwt, compile-tests, compile-widgetset-generator, compile-widgetset-testing"/>
<target name="widgetset-portal-default" depends="init-nonpackage, init, compile-gwt, compile-widgetset-generator, compile-widgetset-portal-default"/>

<!-- ================================================================== -->
<!-- Libraries and Tests -->
<!-- ================================================================== -->

<target name="compile-gwt" depends="init" unless="use.precompiled.gwt">
<!-- skipped based on a parameter, use pre-compiled JARs from elsewhere -->
<!-- Compile GWT in a directory defined by properties -->
<ant antfile="${gwt.root}/build.xml" target="user" dir="${gwt.root}" inheritall="false" inheritrefs="false">
<property name="gwt.root" value="${gwt.root}"/>
</ant>
<ant antfile="${gwt.root}/build.xml" target="dev" dir="${gwt.root}" inheritall="false" inheritrefs="false">
<property name="gwt.root" value="${gwt.root}"/>
</ant>
<ant antfile="${gwt.root}/build.xml" target="codeserver" dir="${gwt.root}" inheritall="false" inheritrefs="false">
<property name="gwt.root" value="${gwt.root}"/>
</ant>
<ant antfile="${gwt.root}/build.xml" target="elemental" dir="${gwt.root}" inheritall="false" inheritrefs="false">
<property name="gwt.root" value="${gwt.root}"/>
</ant>
</target>

<!-- Compile the Vaadin library JAR. -->
<!-- Need only the default widgetset for this, but can't depend -->
<!-- specifically on it, because dependence does not see compiled -->
@@ -610,7 +698,6 @@
<!-- Create Vaadin JAR -->
<mkdir dir="${output-dir}/META-INF"/>
<echo file="${output-dir}/META-INF/VERSION">${version.full}</echo>
<echo file="${output-dir}/META-INF/GWT-VERSION">${gwt-version}</echo>
<emma enabled="${emma.enabled}" >
<instr instrpath="${result-classes-core}"
@@ -622,10 +709,13 @@
<filter includes="com.vaadin.*" />
<filter excludes="com.vaadin.terminal.gwt.*" />
</instr>
</emma>
</emma>
<jar jarfile="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
compress="true" manifest="build/package/META-INF/MANIFEST.MF" duplicate="preserve">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${jarjar-jar}"/>
<jarjar jarfile="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
compress="true" manifest="build/package/META-INF/MANIFEST.MF" duplicate="preserve" index="true">
<metainf dir="${output-dir}/META-INF"/>
<manifest>
<attribute name="Vaadin-Package-Version" value="1" />
@@ -633,7 +723,8 @@
<attribute name="Implementation-Vendor" value="Vaadin Ltd" />
<attribute name="Implementation-URL" value="http://vaadin.com" />
<attribute name="Implementation-Version" value="${version.full}" />
<attribute name="GWT-Version" value="${gwt-version}" />
<!-- No separate GWT-Version attribute or file -->
<!-- <attribute name="GWT-Version" value="${gwt-version}" /> -->
<attribute name="GWT-Version-Dependencies" value="${gwt-version-dependencies}" />
<attribute name="Bundle-Version" value="${version.full}" />
</manifest>
@@ -658,7 +749,91 @@
<include name="img/**" />
</patternset>
</fileset>
</jar>
<!-- Precompiled widgetset (.gwtar file) not included to limit JAR size -->
<!-- <fileset dir="${result-precompiled-widgetsets}" includes="com/vaadin/terminal.gwt.DefaultWidgetSet.gwtar" /> -->

<!-- TODO GWT related license files etc. should be in subdirectories -->
<!-- GWT -->
<!-- Precompiled GWT modules (.gwtar file) not included to limit JAR size -->
<zipfileset src="${gwt.user.jar}" excludes="META-INF/**,javax/servlet/**,**/*.gwtar" />

<!-- TODO depends on locally compiled gwt-user -->
<!--
<fileset dir="${gwt.user.dir}/src" excludes="**/package.html" />
<fileset dir="${gwt.user.dir}/super" excludes="**/package.html" />
<fileset dir="${gwt.user.bin}" excludes="**/*.gwtar" />

<zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
<zipfileset src="${gwt.tools.lib}/w3c/flute/flute-1.3-gg2.jar" />
<zipfileset src="${gwt.tools.lib}/streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar" />
-->

<!-- GWT development JAR contents including many external dependencies -->
<zipfileset src="${gwt.dev.jar}" excludes="javax/servlet/**,javax/xml/**" />

<!-- Alternative approach: GWT compiler and its dependencies only from the dev JAR -->
<!--
<zipfileset src="${gwt.dev.jar}">
<include name="com/google/gwt/core/client/**"/>
<include name="com/google/gwt/core/shared/**"/>

<include name="com/google/gwt/core/ext/**"/>
<include name="com/google/gwt/core/linker/**"/>
<include name="com/google/gwt/dev/About.java"/>
<include name="com/google/gwt/dev/GwtVersion.java"/>
<include name="com/google/gwt/dev/Permutation.java"/>
<include name="com/google/gwt/dev/asm/**"/>
<include name="com/google/gwt/dev/cfg/**"/>
<include name="com/google/gwt/dev/javac/**"/>
<include name="com/google/gwt/dev/jdt/**"/>
<include name="com/google/gwt/dev/jjs/**"/>
<include name="com/google/gwt/dev/js/**"/>
<include name="com/google/gwt/dev/json/**"/>
<include name="com/google/gwt/dev/resource/**"/>
<include name="com/google/gwt/dev/util/**"/>
<include name="com/google/gwt/soyc/**"/>
<include name="com/google/gwt/util/**"/>
<include name="org/eclipse/jdt/**"/>
</zipfileset>
<zipfileset src="${gwt.tools.lib}/apache/ant-1.6.5.jar" />
<zipfileset src="${gwt.tools.lib}/eclipse/jdt-3.4.2_r894.jar" />
<zipfileset src="${gwt.tools.lib}/tomcat/commons-collections-3.1.jar" />
<zipfileset src="${gwt.tools.lib}/guava/guava-10.0.1/guava-10.0.1-rebased.jar" />
<zipfileset src="${gwt.tools.lib}/jscomp/r1649/compiler-rebased.jar" />
-->
<!-- GWT SuperDevMode -->
<zipfileset src="${gwt.codeserver.jar}" />
<!-- GWT Elemental -->
<zipfileset src="${gwt.elemental.jar}" />
<!-- jarjar rules: rebase packages from gwt-dev.jar but not those from gwt-user -->
<!-- Don't rebase these -->
<!-- xalan is used via reflection -->
<rule pattern="org.apache.xalan.**" result="@0"/>
<rule pattern="org.apache.xml.**" result="@0"/>
<!-- Cannot rebase - used in APIs etc. -->
<!-- <rule pattern="org.mortbay.**" result="@0"/> -->
<!-- <rule pattern="org.xml.**" result="@0"/> -->

<!-- Rebase these -->
<rule pattern="com.gargoylesoftware.**" result="com.vaadin.external.@0"/>
<rule pattern="com.ibm.**" result="com.vaadin.external.@0"/>
<rule pattern="com.steadystate.**" result="com.vaadin.external.@0"/>
<rule pattern="mx4j.**" result="com.vaadin.external.@0"/>
<rule pattern="net.sourceforge.htmlunit.**" result="com.vaadin.external.@0"/>
<rule pattern="org.apache.**" result="com.vaadin.external.@0"/>
<rule pattern="org.cyberneko.**" result="com.vaadin.external.@0"/>
<rule pattern="org.eclipse.**" result="com.vaadin.external.@0"/>
<!-- looked up based on class name? -->
<rule pattern="org.hibernate.validator.**" result="com.vaadin.external.@0"/>
<rule pattern="org.jdesktop.swingworker.**" result="com.vaadin.external.@0"/>
<rule pattern="org.kohsuke.args4j.**" result="com.vaadin.external.@0"/>
</jarjar>
<!-- Generate the Export-Package attribute in the manifest of the JAR -->
<java classname="com.vaadin.buildhelpers.GeneratePackageExports" failonerror="true" fork="yes">
@@ -704,7 +879,7 @@
<doctitle>${javadoc.doctitle}</doctitle>
<!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> -->
<bottom>${javadoc.bottom}</bottom>
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="build/javadoc/j2se-1.5.0" />
<link offline="true" href="http://docs.oracle.com/javase/6/docs/api/" packagelistLoc="build/javadoc/j2se-1.6.0" />
<link offline="true" href="http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc="build/javadoc/j2ee-1.4" />
</javadoc>


+ 40
- 28
build/buildhelpers/com/vaadin/buildhelpers/GeneratePackageExports.java Прегледај датотеку

@@ -7,37 +7,40 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Vector;
import java.util.jar.Attributes;
import java.util.jar.Attributes.Name;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.jar.Attributes.Name;

/**
* Generates Export-Packages attribute for OSGi compatible manifest.
*
* Reads the included Java packages in Vaadin JAR, generates a corresponding
* MANIFEST.MF file, and replaces the dummy one in the JAR with the
* generated one.
* MANIFEST.MF file, and replaces the dummy one in the JAR with the generated
* one.
*
* See #3521 for details.
*
* @author magi
*/
public class GeneratePackageExports {
public static final String VAADIN_PACKAGE_PATH_PREFIX = "com/vaadin/";
public static final String GOOGLE_PACKAGE_PATH_PREFIX = "com/google/";

public static void main(String[] args) {
if (args.length < 1) {
System.err.println("Invalid number of parameters\n"+
"Usage: java -cp .. GenerateManifest <package.jar>");
System.err.println("Invalid number of parameters\n"
+ "Usage: java -cp .. GenerateManifest <package.jar>");
System.exit(1);
}

// Open tje JAR
// Open the JAR
String jarFilename = args[0];
JarFile jar = null;
try {
jar = new JarFile(jarFilename);
} catch (IOException e) {
System.err.println("Unable to open JAR '"+jarFilename+"'");
System.err.println("Unable to open JAR '" + jarFilename + "'");
System.exit(1);
}

@@ -45,9 +48,12 @@ public class GeneratePackageExports {
HashSet<String> packages = new HashSet<String>();
for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) {
JarEntry entry = it.nextElement();
if (entry.getName().startsWith("com") && entry.getName().endsWith(".class")) {
if ((entry.getName().startsWith(VAADIN_PACKAGE_PATH_PREFIX) || entry
.getName().startsWith(GOOGLE_PACKAGE_PATH_PREFIX))
&& entry.getName().endsWith(".class")) {
int lastSlash = entry.getName().lastIndexOf('/');
String pkg = entry.getName().substring(0, lastSlash).replace('/', '.');
String pkg = entry.getName().substring(0, lastSlash)
.replace('/', '.');
packages.add(pkg);
}
}
@@ -55,14 +61,16 @@ public class GeneratePackageExports {
// List theme packages
for (Enumeration<JarEntry> it = jar.entries(); it.hasMoreElements();) {
JarEntry entry = it.nextElement();
if (entry.isDirectory() && entry.getName().startsWith("VAADIN/themes")) {
if (entry.isDirectory()
&& entry.getName().startsWith("VAADIN/themes")) {
// Strip ending slash
int lastSlash = entry.getName().lastIndexOf('/');
String pkg = entry.getName().substring(0, lastSlash).replace('/', '.');
String pkg = entry.getName().substring(0, lastSlash)
.replace('/', '.');
packages.add(pkg);
}
}
// Replacement for the "Export-Package" attribute in the manifest
String exportPackage = "";

@@ -70,13 +78,14 @@ public class GeneratePackageExports {
String packageArray[] = new String[packages.size()];
packages.toArray(packageArray);
Arrays.sort(packageArray);
for (int i=0; i<packageArray.length; i++) {
if (i == 0)
for (int i = 0; i < packageArray.length; i++) {
if (i == 0) {
exportPackage = packageArray[i];
else
} else {
exportPackage += ", " + packageArray[i];
}
}
// Read old manifest
Manifest oldMF = null;
try {
@@ -84,11 +93,12 @@ public class GeneratePackageExports {
} catch (IOException e) {
e.printStackTrace();
}
// Read main attributes
Attributes mainAtts = oldMF.getMainAttributes();
Vector<String> keys = new Vector<String>(mainAtts.size());
for (Iterator<Object> attrit = mainAtts.keySet().iterator(); attrit.hasNext();) {
for (Iterator<Object> attrit = mainAtts.keySet().iterator(); attrit
.hasNext();) {
Name name = (Name) attrit.next();
keys.add(name.toString());
}
@@ -98,11 +108,11 @@ public class GeneratePackageExports {
try {
jar.close();
} catch (IOException e) {
System.err.println("Unable to close JAR '"+jarFilename+"'");
System.err.println("Unable to close JAR '" + jarFilename + "'");
}
// Put the manifest version as the first line
String orderedKeys[] = new String[keys.size()];
String orderedKeys[] = new String[keys.size()];
keys.toArray(orderedKeys);
Arrays.sort(orderedKeys); // Must sort to be able to search
int mvPos = Arrays.binarySearch(orderedKeys, "Manifest-Version");
@@ -110,20 +120,21 @@ public class GeneratePackageExports {
orderedKeys[0] = "Manifest-Version";

// This final ordering is just for esthetic reasons and
// in practice unnecessary and will actually be messed up
// in practice unnecessary and will actually be messed up
// when the 'jar' command reads the manifest
Arrays.sort(orderedKeys, 1, orderedKeys.length-1);
Arrays.sort(orderedKeys, 1, orderedKeys.length - 1);

// Create the modified manifest
ManifestWriter manifest = new ManifestWriter();
for (int i=0; i<orderedKeys.length; i++) {
for (int i = 0; i < orderedKeys.length; i++) {
// Skip an existing Export-Package attribute
if (orderedKeys[i].equals("Export-Package")) {
// Copy the attribute to the modified manifest
manifest.writeAttribute(orderedKeys[i], mainAtts.getValue(orderedKeys[i]));
manifest.writeAttribute(orderedKeys[i],
mainAtts.getValue(orderedKeys[i]));
}
}
// Add the Export-Package attribute at the end of the manifest.
// The alternative would be replacing an existing attribute in
// the loop above, but it's not guaranteed that it exists.
@@ -133,8 +144,9 @@ public class GeneratePackageExports {
// before this is done.
int status = manifest.updateJar(jarFilename);

if (status != 0)
if (status != 0) {
System.exit(status);
}
}
}

+ 12
- 5
build/ivy/ivy.xml Прегледај датотеку

@@ -12,6 +12,9 @@
<publications />
<dependencies defaultconf="ss.compile" defaultconfmapping="ss.compile->master">

<!--Servlet API version 2.5 -->
<dependency org="javax.servlet" name="servlet-api" rev="2.5" />

<!-- Liferay Portal Service -->
<dependency org="com.liferay.portal" name="portal-service" rev="6.0.2" />
<!--Portlet API version 2.0 (JSR-286) -->
@@ -19,17 +22,21 @@
<!-- Google App Engine -->
<dependency org="com.google.appengine" name="appengine-api-1.0-sdk" rev="1.2.1" />
<!-- GWT user with dependencies (validation-api) -->
<dependency org="com.google.gwt" name="gwt-user" rev="2.4.0" conf="cs.compile->master" />
<!-- GWT dependencies (validation-api) -->
<dependency org="javax.validation" name="validation-api" rev="1.0.0.GA" conf="cs.compile->master,sources" />
<!-- GWT dev (incl. servlet-api 2.4 classes) -->
<dependency org="com.google.gwt" name="gwt-dev" rev="2.4.0" conf="cs.compile->master" />
<!-- Test frameworks & related -->
<dependency org="junit" name="junit" rev="4.5" conf="ss.test.compile -> master"/>
<dependency org="org.easymock" name="easymock" rev="3.0" conf="ss.test.compile -> master, runtime(*)"/>
<dependency org="org.hsqldb" name="hsqldb" rev="2.2.6" conf="ss.test.compile -> master, runtime(*)"/>

<!-- Additional libraries used by tests - also included from GWT -->
<dependency org="org.mortbay.jetty" name="jetty" rev="6.1.26" conf="ss.test.compile -> master"/>
<dependency org="org.mortbay.jetty" name="jetty-util" rev="6.1.26" conf="ss.test.compile -> master"/>
<dependency org="commons-lang" name="commons-lang" rev="2.6" conf="ss.test.compile -> master"/>
<dependency org="commons-io" name="commons-io" rev="2.3" conf="ss.test.compile -> master"/>
<dependency org="commons-codec" name="commons-codec" rev="1.6" conf="ss.test.compile -> master"/>

<!-- Ant tasks -->
<dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="taskdefs ->master"/>
<dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.0.10" conf="taskdefs ->master"/>

build/javadoc/j2se-1.5.0/package-list → build/javadoc/j2se-1.6.0/package-list Прегледај датотеку

@@ -39,6 +39,7 @@ java.security.interfaces
java.security.spec
java.sql
java.text
java.text.spi
java.util
java.util.concurrent
java.util.concurrent.atomic
@@ -47,9 +48,13 @@ java.util.jar
java.util.logging
java.util.prefs
java.util.regex
java.util.spi
java.util.zip
javax.accessibility
javax.activation
javax.activity
javax.annotation
javax.annotation.processing
javax.crypto
javax.crypto.interfaces
javax.crypto.spec
@@ -60,6 +65,12 @@ javax.imageio.plugins.bmp
javax.imageio.plugins.jpeg
javax.imageio.spi
javax.imageio.stream
javax.jws
javax.jws.soap
javax.lang.model
javax.lang.model.element
javax.lang.model.type
javax.lang.model.util
javax.management
javax.management.loading
javax.management.modelmbean
@@ -83,6 +94,7 @@ javax.print.event
javax.rmi
javax.rmi.CORBA
javax.rmi.ssl
javax.script
javax.security.auth
javax.security.auth.callback
javax.security.auth.kerberos
@@ -116,17 +128,42 @@ javax.swing.text.html.parser
javax.swing.text.rtf
javax.swing.tree
javax.swing.undo
javax.tools
javax.transaction
javax.transaction.xa
javax.xml
javax.xml.bind
javax.xml.bind.annotation
javax.xml.bind.annotation.adapters
javax.xml.bind.attachment
javax.xml.bind.helpers
javax.xml.bind.util
javax.xml.crypto
javax.xml.crypto.dom
javax.xml.crypto.dsig
javax.xml.crypto.dsig.dom
javax.xml.crypto.dsig.keyinfo
javax.xml.crypto.dsig.spec
javax.xml.datatype
javax.xml.namespace
javax.xml.parsers
javax.xml.soap
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.transform
javax.xml.transform.dom
javax.xml.transform.sax
javax.xml.transform.stax
javax.xml.transform.stream
javax.xml.validation
javax.xml.ws
javax.xml.ws.handler
javax.xml.ws.handler.soap
javax.xml.ws.http
javax.xml.ws.soap
javax.xml.ws.spi
javax.xml.ws.wsaddressing
javax.xml.xpath
org.ietf.jgss
org.omg.CORBA
@@ -163,4 +200,4 @@ org.w3c.dom.events
org.w3c.dom.ls
org.xml.sax
org.xml.sax.ext
org.xml.sax.helpers
org.xml.sax.helpers

+ 31
- 0
scripts/merge-check.sh Прегледај датотеку

@@ -0,0 +1,31 @@
#!/bin/bash
SINCE=$1
UNTIL=$2

if [ "$SINCE" = "" ] || [ "$UNTIL" = "" ]
then
echo "Usage: $0 <since> <until>"
exit 3
fi

testname="merge check for `pwd|sed "s/.*\///"`"
echo "##teamcity[testStarted name='$testname' captureStandardOutput='true']"

command="git --no-pager log --no-color $SINCE..$UNTIL"
# TODO Why do I get whitespace in the beginning of the wc output?
change_count=`$command --oneline|wc -l|tr -d ' '`

if [ "$change_count" = "0" ]
then
echo "No unmerged commits"
else
command="$command --format=short"
message="There are $change_count commits that have not been merged from $UNTIL to $SINCE"
echo $message
echo ""
$command
details=`$command|perl -p -e 's/\n/|n/' | sed "s/['\|\[\]]/|\&/g"`
echo "##teamcity[testFailed name='$testname' message='$message' details='|n$details']"
fi

echo "##teamcity[testFinished name='$testname']"

+ 16
- 0
src/com/vaadin/Application.java Прегледај датотеку

@@ -1066,6 +1066,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
* @see com.vaadin.terminal.Terminal.ErrorListener#terminalError(com.vaadin.terminal.Terminal.ErrorEvent)
*/

@Override
public void terminalError(Terminal.ErrorEvent event) {
final Throwable t = event.getThrowable();
if (t instanceof SocketException) {
@@ -1810,6 +1811,7 @@ public class Application implements Terminal.ErrorListener, Serializable {
this.throwable = throwable;
}

@Override
public Throwable getThrowable() {
return throwable;
}
@@ -2373,4 +2375,18 @@ public class Application implements Terminal.ErrorListener, Serializable {
private static final Logger getLogger() {
return Logger.getLogger(Application.class.getName());
}

/**
* Returns a Root with the given id.
* <p>
* This is meant for framework internal use.
* </p>
*
* @param rootId
* The root id
* @return The root with the given id or null if not found
*/
public Root getRootById(int rootId) {
return roots.get(rootId);
}
}

+ 85
- 0
src/com/vaadin/Vaadin.gwt.xml Прегледај датотеку

@@ -0,0 +1,85 @@
<module>
<!-- This GWT module inherits all Vaadin client side functionality modules.
This is the module you want to inherit in your client side project to be
able to use com.vaadin.* classes. -->

<!-- Hint for WidgetSetBuilder not to automatically update the file -->
<!-- WS Compiler: manually edited -->

<inherits name="com.google.gwt.user.User" />

<inherits name="com.google.gwt.http.HTTP" />

<inherits name="com.google.gwt.json.JSON" />

<inherits name="com.vaadin.terminal.gwt.VaadinBrowserSpecificOverrides" />

<source path="terminal/gwt/client" />
<source path="shared" />

<!-- Use own Scheduler implementation to be able to track if commands are
running -->
<replace-with class="com.vaadin.terminal.gwt.client.VSchedulerImpl">
<when-type-is class="com.google.gwt.core.client.impl.SchedulerImpl" />
</replace-with>

<!-- Generators for serializators for classes used in communication between
server and client -->
<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.SerializerMapGenerator">
<when-type-is
class="com.vaadin.terminal.gwt.client.communication.SerializerMap" />
</generate-with>

<replace-with class="com.vaadin.terminal.gwt.client.VDebugConsole">
<when-type-is class="com.vaadin.terminal.gwt.client.Console" />
</replace-with>

<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.EagerWidgetMapGenerator">
<when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap" />
</generate-with>

<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.AcceptCriteriaFactoryGenerator">
<when-type-is
class="com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterionFactory" />
</generate-with>

<!-- Generate client side proxies for client to server RPC interfaces -->
<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.RpcProxyGenerator">
<when-type-assignable
class="com.vaadin.shared.communication.ServerRpc" />
</generate-with>

<!-- Generate client side proxies for client to server RPC interfaces -->
<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.RpcProxyCreatorGenerator">
<when-type-assignable
class="com.vaadin.terminal.gwt.client.communication.RpcProxy.RpcProxyCreator" />
</generate-with>

<!-- Generate client side RPC manager for server to client RPC -->
<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.GeneratedRpcMethodProviderGenerator">
<when-type-assignable
class="com.vaadin.terminal.gwt.client.communication.GeneratedRpcMethodProvider" />
</generate-with>

<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.ConnectorWidgetFactoryGenerator">
<when-type-assignable
class="com.vaadin.terminal.gwt.client.ui.ConnectorWidgetFactory" />
</generate-with>

<generate-with
class="com.vaadin.terminal.gwt.widgetsetutils.ConnectorStateFactoryGenerator">
<when-type-assignable
class="com.vaadin.terminal.gwt.client.ui.ConnectorStateFactory" />
</generate-with>

<!-- Use the new cross site linker to get a nocache.js without document.write -->
<add-linker name="xsiframe" />

</module>

+ 42
- 0
src/com/vaadin/annotations/JavaScript.java Прегледај датотеку

@@ -0,0 +1,42 @@
/*
@VaadinApache2LicenseForJavaFiles@
*/

package com.vaadin.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.vaadin.terminal.gwt.server.ClientConnector;

/**
* If this annotation is present on a {@link ClientConnector} class, the
* framework ensures the referenced JavaScript files are loaded before the init
* method for the corresponding client-side connector is invoked.
* <p>
* Absolute URLs including protocol and host are used as is on the client-side.
* Relative urls are mapped to APP/CONNECTOR/[url] which are by default served
* from the classpath relative to the class where the annotation is defined.
* <p>
* Example: {@code @JavaScript( "http://host.com/file1.js", "file2.js"})} on
* the class com.example.MyConnector would load the file
* http://host.com/file1.js as is and file2.js from /com/example/file2.js on the
* server's classpath using the ClassLoader that was used to load
* com.example.MyConnector.
*
* @author Vaadin Ltd
* @version @VERSION@
* @since 7.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface JavaScript {
/**
* JavaScript files to load before initializing the client-side connector.
*
* @return an array of JavaScript file urls
*/
public String[] value();
}

+ 0
- 24
src/com/vaadin/annotations/LoadScripts.java Прегледај датотеку

@@ -1,24 +0,0 @@
/*
@VaadinApache2LicenseForJavaFiles@
*/
package com.vaadin.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Temporary hack used for ensuring external javascript libraries are included.
* To add a javascript, add this annotation to your Root class.
*
* @deprecated Will be removed in favor of a more robust solution before version
* 7.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Deprecated
public @interface LoadScripts {
public String[] value();

}

+ 38
- 0
src/com/vaadin/annotations/StyleSheet.java Прегледај датотеку

@@ -0,0 +1,38 @@
/*
@VaadinApache2LicenseForJavaFiles@
*/

package com.vaadin.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.vaadin.terminal.gwt.server.ClientConnector;

/**
* If this annotation is present on a {@link ClientConnector} class, the
* framework ensures the referenced style sheets are loaded before the init
* method for the corresponding client-side connector is invoked.
* <p>
* Example: {@code @StyleSheet( "http://host.com/file1.css", "file2.css"})} on
* the class com.example.MyConnector would load the file
* http://host.com/file1.css as is and file2.css from /com/example/file2.css on
* the server's classpath using the ClassLoader that was used to load
* com.example.MyConnector.
*
* @author Vaadin Ltd
* @version @VERSION@
* @since 7.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface StyleSheet {
/**
* Style sheets to load before initializing the client-side connector.
*
* @return an array of style sheet urls
*/
public String[] value();
}

+ 1
- 0
src/com/vaadin/data/Container.java Прегледај датотеку

@@ -697,6 +697,7 @@ public interface Container extends Serializable {
* @return <code>true</code> if the operation succeeded,
* <code>false</code> if not
*/
@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException;
}

+ 1
- 0
src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java Прегледај датотеку

@@ -23,6 +23,7 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory {

public static final Object CAPTION_PROPERTY_ID = "Caption";

@Override
public <T extends Field> T createField(Class<?> type, Class<T> fieldType) {
if (Enum.class.isAssignableFrom(type)) {
return createEnumField(type, fieldType);

+ 12
- 0
src/com/vaadin/data/util/AbstractBeanContainer.java Прегледај датотеку

@@ -96,6 +96,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
this.propertyId = propertyId;
}

@Override
@SuppressWarnings("unchecked")
public IDTYPE getIdForBean(BEANTYPE bean)
throws IllegalArgumentException {
@@ -163,6 +164,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
*
* @see com.vaadin.data.Container#getType(java.lang.Object)
*/
@Override
public Class<?> getType(Object propertyId) {
return model.get(propertyId).getPropertyType();
}
@@ -195,6 +197,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
*
* @see com.vaadin.data.Container#getContainerPropertyIds()
*/
@Override
public Collection<String> getContainerPropertyIds() {
return model.keySet();
}
@@ -258,6 +261,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* @see com.vaadin.data.Container#getContainerProperty(java.lang.Object,
* java.lang.Object)
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
Item item = getItem(itemId);
if (item == null) {
@@ -300,6 +304,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
/**
* Re-filter the container when one of the monitored properties changes.
*/
@Override
public void valueChange(ValueChangeEvent event) {
// if a property that is used in a filter is changed, refresh filtering
filterAll();
@@ -312,6 +317,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* com.vaadin.data.Container.Filterable#addContainerFilter(java.lang.Object,
* java.lang.String, boolean, boolean)
*/
@Override
public void addContainerFilter(Object propertyId, String filterString,
boolean ignoreCase, boolean onlyMatchPrefix) {
try {
@@ -328,6 +334,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
*
* @see com.vaadin.data.Container.Filterable#removeAllContainerFilters()
*/
@Override
public void removeAllContainerFilters() {
if (!getFilters().isEmpty()) {
for (Item item : itemIdToItem.values()) {
@@ -344,6 +351,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* com.vaadin.data.Container.Filterable#removeContainerFilters(java.lang
* .Object)
*/
@Override
public void removeContainerFilters(Object propertyId) {
Collection<Filter> removedFilters = super.removeFilters(propertyId);
if (!removedFilters.isEmpty()) {
@@ -354,11 +362,13 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
}
}

@Override
public void addContainerFilter(Filter filter)
throws UnsupportedFilterException {
addFilter(filter);
}

@Override
public void removeContainerFilter(Filter filter) {
removeFilter(filter);
}
@@ -416,6 +426,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
*
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds()
*/
@Override
public Collection<?> getSortableContainerPropertyIds() {
return getSortablePropertyIds();
}
@@ -426,6 +437,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[],
* boolean[])
*/
@Override
public void sort(Object[] propertyId, boolean[] ascending) {
sortContainer(propertyId, ascending);
}

+ 2
- 0
src/com/vaadin/data/util/AbstractContainer.java Прегледај датотеку

@@ -52,6 +52,7 @@ public abstract class AbstractContainer implements Container {
super(source);
}

@Override
public Container getContainer() {
return (Container) getSource();
}
@@ -72,6 +73,7 @@ public abstract class AbstractContainer implements Container {
super(source);
}

@Override
public Container getContainer() {
return (Container) getSource();
}

+ 22
- 0
src/com/vaadin/data/util/AbstractInMemoryContainer.java Прегледај датотеку

@@ -125,6 +125,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
// Container interface methods with more specific return class

// default implementation, can be overridden
@Override
public ITEMCLASS getItem(Object itemId) {
if (containsId(itemId)) {
return getUnfilteredItem(itemId);
@@ -152,10 +153,12 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE

// Container interface method implementations

@Override
public int size() {
return getVisibleItemIds().size();
}

@Override
public boolean containsId(Object itemId) {
// only look at visible items after filtering
if (itemId == null) {
@@ -165,12 +168,14 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
}
}

@Override
public List<?> getItemIds() {
return Collections.unmodifiableList(getVisibleItemIds());
}

// Container.Ordered

@Override
public ITEMIDTYPE nextItemId(Object itemId) {
int index = indexOfId(itemId);
if (index >= 0 && index < size() - 1) {
@@ -181,6 +186,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
}
}

@Override
public ITEMIDTYPE prevItemId(Object itemId) {
int index = indexOfId(itemId);
if (index > 0) {
@@ -191,6 +197,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
}
}

@Override
public ITEMIDTYPE firstItemId() {
if (size() > 0) {
return getIdByIndex(0);
@@ -199,6 +206,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
}
}

@Override
public ITEMIDTYPE lastItemId() {
if (size() > 0) {
return getIdByIndex(size() - 1);
@@ -207,6 +215,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
}
}

@Override
public boolean isFirstId(Object itemId) {
if (itemId == null) {
return false;
@@ -214,6 +223,7 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE
return itemId.equals(firstItemId());
}

@Override
public boolean isLastId(Object itemId) {
if (itemId == null) {
return false;
@@ -223,66 +233,78 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE

// Container.Indexed

@Override
public ITEMIDTYPE getIdByIndex(int index) {
return getVisibleItemIds().get(index);
}

@Override
public int indexOfId(Object itemId) {
return getVisibleItemIds().indexOf(itemId);
}

// methods that are unsupported by default, override to support

@Override
public Object addItemAt(int index) throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public Item addItemAt(int index, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public Object addItem() throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding items not supported. Override the relevant addItem*() methods if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Removing items not supported. Override the removeItem() method if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public boolean removeAllItems() throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Removing items not supported. Override the removeAllItems() method if required as specified in AbstractInMemoryContainer javadoc.");
}

@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"Adding container properties not supported. Override the addContainerProperty() method if required.");
}

@Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(

+ 8
- 0
src/com/vaadin/data/util/AbstractProperty.java Прегледај датотеку

@@ -42,10 +42,12 @@ public abstract class AbstractProperty<T> implements Property<T>,
* Override for additional restrictions on what is considered a read-only
* property.
*/
@Override
public boolean isReadOnly() {
return readOnly;
}

@Override
public void setReadOnly(boolean newStatus) {
boolean oldStatus = isReadOnly();
readOnly = newStatus;
@@ -93,6 +95,7 @@ public abstract class AbstractProperty<T> implements Property<T>,
*
* @return source Property of the event.
*/
@Override
public Property getProperty() {
return (Property) getSource();
}
@@ -105,6 +108,7 @@ public abstract class AbstractProperty<T> implements Property<T>,
* @param listener
* the new Listener to be registered.
*/
@Override
public void addListener(Property.ReadOnlyStatusChangeListener listener) {
if (readOnlyStatusChangeListeners == null) {
readOnlyStatusChangeListeners = new LinkedList<ReadOnlyStatusChangeListener>();
@@ -118,6 +122,7 @@ public abstract class AbstractProperty<T> implements Property<T>,
* @param listener
* the listener to be removed.
*/
@Override
public void removeListener(Property.ReadOnlyStatusChangeListener listener) {
if (readOnlyStatusChangeListeners != null) {
readOnlyStatusChangeListeners.remove(listener);
@@ -161,12 +166,14 @@ public abstract class AbstractProperty<T> implements Property<T>,
*
* @return source Property of the event.
*/
@Override
public Property getProperty() {
return (Property) getSource();
}

}

@Override
public void addListener(ValueChangeListener listener) {
if (valueChangeListeners == null) {
valueChangeListeners = new LinkedList<ValueChangeListener>();
@@ -175,6 +182,7 @@ public abstract class AbstractProperty<T> implements Property<T>,

}

@Override
public void removeListener(ValueChangeListener listener) {
if (valueChangeListeners != null) {
valueChangeListeners.remove(listener);

+ 1
- 0
src/com/vaadin/data/util/BeanItemContainer.java Прегледај датотеку

@@ -59,6 +59,7 @@ public class BeanItemContainer<BEANTYPE> extends
private static class IdentityBeanIdResolver<BT> implements
BeanIdResolver<BT, BT> {

@Override
public BT getIdForBean(BT bean) {
return bean;
}

+ 28
- 0
src/com/vaadin/data/util/ContainerHierarchicalWrapper.java Прегледај датотеку

@@ -71,6 +71,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
this.itemIds = itemIds;
}

@Override
public int compare(Object o1, Object o2) {
if (o1.equals(o2)) {
return 0;
@@ -233,6 +234,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* Can the specified Item have any children? Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public boolean areChildrenAllowed(Object itemId) {

// If the wrapped container implements the method directly, use it
@@ -253,6 +255,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> getChildren(Object itemId) {

// If the wrapped container implements the method directly, use it
@@ -272,6 +275,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object getParent(Object itemId) {

// If the wrapped container implements the method directly, use it
@@ -287,6 +291,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean hasChildren(Object itemId) {

// If the wrapped container implements the method directly, use it
@@ -303,6 +308,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean isRoot(Object itemId) {

// If the wrapped container implements the method directly, use it
@@ -322,6 +328,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> rootItemIds() {

// If the wrapped container implements the method directly, use it
@@ -351,6 +358,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
@Override
public boolean setChildrenAllowed(Object itemId, boolean childrenAllowed) {

// If the wrapped container implements the method directly, use it
@@ -391,6 +399,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
@Override
public boolean setParent(Object itemId, Object newParentId) {

// If the wrapped container implements the method directly, use it
@@ -483,6 +492,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @throws UnsupportedOperationException
* if the addItem is not supported.
*/
@Override
public Object addItem() throws UnsupportedOperationException {

final Object id = container.addItem();
@@ -502,6 +512,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @throws UnsupportedOperationException
* if the addItem is not supported.
*/
@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {

// Null ids are not accepted
@@ -524,6 +535,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @throws UnsupportedOperationException
* if the removeAllItems is not supported.
*/
@Override
public boolean removeAllItems() throws UnsupportedOperationException {

final boolean success = container.removeAllItems();
@@ -548,6 +560,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @throws UnsupportedOperationException
* if the removeItem is not supported.
*/
@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {

@@ -586,6 +599,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @throws UnsupportedOperationException
* if the addContainerProperty is not supported.
*/
@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {

@@ -606,6 +620,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* @throws UnsupportedOperationException
* if the removeContainerProperty is not supported.
*/
@Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
return container.removeContainerProperty(propertyId);
@@ -616,6 +631,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean containsId(Object itemId) {
return container.containsId(itemId);
}
@@ -624,6 +640,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* Gets the specified Item from the container. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public Item getItem(Object itemId) {
return container.getItem(itemId);
}
@@ -633,6 +650,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> getItemIds() {
return container.getItemIds();
}
@@ -642,6 +660,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* Container Don't add a JavaDoc comment here, we use the default
* documentation from implemented interface.
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
return container.getContainerProperty(itemId, propertyId);
}
@@ -651,6 +670,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> getContainerPropertyIds() {
return container.getContainerPropertyIds();
}
@@ -660,6 +680,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* Don't add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public Class<?> getType(Object propertyId) {
return container.getType(propertyId);
}
@@ -668,6 +689,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* Gets the number of Items in the Container. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public int size() {
return container.size();
}
@@ -677,6 +699,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void addListener(Container.ItemSetChangeListener listener) {
if (container instanceof Container.ItemSetChangeNotifier) {
((Container.ItemSetChangeNotifier) container)
@@ -689,6 +712,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void removeListener(Container.ItemSetChangeListener listener) {
if (container instanceof Container.ItemSetChangeNotifier) {
((Container.ItemSetChangeNotifier) container)
@@ -701,6 +725,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public void addListener(Container.PropertySetChangeListener listener) {
if (container instanceof Container.PropertySetChangeNotifier) {
((Container.PropertySetChangeNotifier) container)
@@ -713,6 +738,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void removeListener(Container.PropertySetChangeListener listener) {
if (container instanceof Container.PropertySetChangeNotifier) {
((Container.PropertySetChangeNotifier) container)
@@ -736,6 +762,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
listener = realListener;
}

@Override
public void containerItemSetChange(ItemSetChangeEvent event) {
updateHierarchicalWrapper();
((Container.ItemSetChangeListener) listener)
@@ -743,6 +770,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,

}

@Override
public void containerPropertySetChange(PropertySetChangeEvent event) {
updateHierarchicalWrapper();
((Container.PropertySetChangeListener) listener)

+ 27
- 0
src/com/vaadin/data/util/ContainerOrderedWrapper.java Прегледај датотеку

@@ -221,6 +221,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object firstItemId() {
if (ordered) {
return ((Container.Ordered) container).firstItemId();
@@ -233,6 +234,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean isFirstId(Object itemId) {
if (ordered) {
return ((Container.Ordered) container).isFirstId(itemId);
@@ -245,6 +247,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean isLastId(Object itemId) {
if (ordered) {
return ((Container.Ordered) container).isLastId(itemId);
@@ -257,6 +260,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object lastItemId() {
if (ordered) {
return ((Container.Ordered) container).lastItemId();
@@ -269,6 +273,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object nextItemId(Object itemId) {
if (ordered) {
return ((Container.Ordered) container).nextItemId(itemId);
@@ -284,6 +289,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object prevItemId(Object itemId) {
if (ordered) {
return ((Container.Ordered) container).prevItemId(itemId);
@@ -306,6 +312,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {

@@ -321,6 +328,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @throws UnsupportedOperationException
* if the addItem is not supported.
*/
@Override
public Object addItem() throws UnsupportedOperationException {

final Object id = container.addItem();
@@ -340,6 +348,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @throws UnsupportedOperationException
* if the addItem is not supported.
*/
@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
final Item item = container.addItem(itemId);
if (!ordered && item != null) {
@@ -356,6 +365,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @throws UnsupportedOperationException
* if the removeAllItems is not supported.
*/
@Override
public boolean removeAllItems() throws UnsupportedOperationException {
final boolean success = container.removeAllItems();
if (!ordered && success) {
@@ -377,6 +387,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @throws UnsupportedOperationException
* if the removeItem is not supported.
*/
@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {

@@ -401,6 +412,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @throws UnsupportedOperationException
* if the removeContainerProperty is not supported.
*/
@Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
return container.removeContainerProperty(propertyId);
@@ -411,6 +423,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean containsId(Object itemId) {
return container.containsId(itemId);
}
@@ -419,6 +432,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* Gets the specified Item from the container. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public Item getItem(Object itemId) {
return container.getItem(itemId);
}
@@ -428,6 +442,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> getItemIds() {
return container.getItemIds();
}
@@ -437,6 +452,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* Container Don't add a JavaDoc comment here, we use the default
* documentation from implemented interface.
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
return container.getContainerProperty(itemId, propertyId);
}
@@ -446,6 +462,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> getContainerPropertyIds() {
return container.getContainerPropertyIds();
}
@@ -455,6 +472,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* Don't add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public Class<?> getType(Object propertyId) {
return container.getType(propertyId);
}
@@ -463,6 +481,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* Gets the number of Items in the Container. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public int size() {
int newSize = container.size();
if (lastKnownSize != -1 && newSize != lastKnownSize
@@ -480,6 +499,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void addListener(Container.ItemSetChangeListener listener) {
if (container instanceof Container.ItemSetChangeNotifier) {
((Container.ItemSetChangeNotifier) container)
@@ -492,6 +512,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void removeListener(Container.ItemSetChangeListener listener) {
if (container instanceof Container.ItemSetChangeNotifier) {
((Container.ItemSetChangeNotifier) container)
@@ -504,6 +525,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public void addListener(Container.PropertySetChangeListener listener) {
if (container instanceof Container.PropertySetChangeNotifier) {
((Container.PropertySetChangeNotifier) container)
@@ -516,6 +538,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void removeListener(Container.PropertySetChangeListener listener) {
if (container instanceof Container.PropertySetChangeNotifier) {
((Container.PropertySetChangeNotifier) container)
@@ -529,6 +552,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object,
* java.lang.Object)
*/
@Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {

@@ -553,6 +577,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
*
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object)
*/
@Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {

@@ -588,6 +613,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,
listener = realListener;
}

@Override
public void containerItemSetChange(ItemSetChangeEvent event) {
updateOrderWrapper();
((Container.ItemSetChangeListener) listener)
@@ -595,6 +621,7 @@ public class ContainerOrderedWrapper implements Container.Ordered,

}

@Override
public void containerPropertySetChange(PropertySetChangeEvent event) {
updateOrderWrapper();
((Container.PropertySetChangeListener) listener)

+ 3
- 0
src/com/vaadin/data/util/DefaultItemSorter.java Прегледај датотеку

@@ -61,6 +61,7 @@ public class DefaultItemSorter implements ItemSorter {
* @see com.vaadin.data.util.ItemSorter#compare(java.lang.Object,
* java.lang.Object)
*/
@Override
public int compare(Object o1, Object o2) {
Item item1 = container.getItem(o1);
Item item2 = container.getItem(o2);
@@ -147,6 +148,7 @@ public class DefaultItemSorter implements ItemSorter {
* com.vaadin.data.util.ItemSorter#setSortProperties(com.vaadin.data.Container
* .Sortable, java.lang.Object[], boolean[])
*/
@Override
public void setSortProperties(Container.Sortable container,
Object[] propertyId, boolean[] ascending) {
this.container = container;
@@ -181,6 +183,7 @@ public class DefaultItemSorter implements ItemSorter {
public static class DefaultPropertyValueComparator implements
Comparator<Object>, Serializable {

@Override
@SuppressWarnings("unchecked")
public int compare(Object o1, Object o2) {
int r = 0;

+ 26
- 0
src/com/vaadin/data/util/FilesystemContainer.java Прегледај датотеку

@@ -187,6 +187,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* @return <code>true</code> if the specified Item is a directory,
* <code>false</code> otherwise.
*/
@Override
public boolean areChildrenAllowed(Object itemId) {
return itemId instanceof File && ((File) itemId).canRead()
&& ((File) itemId).isDirectory();
@@ -197,6 +198,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public Collection<File> getChildren(Object itemId) {

if (!(itemId instanceof File)) {
@@ -223,6 +225,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* Gets the parent item of the specified Item. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public Object getParent(Object itemId) {

if (!(itemId instanceof File)) {
@@ -235,6 +238,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* Tests if the specified Item has any children. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public boolean hasChildren(Object itemId) {

if (!(itemId instanceof File)) {
@@ -254,6 +258,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean isRoot(Object itemId) {

if (!(itemId instanceof File)) {
@@ -272,6 +277,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<File> rootItemIds() {

File[] f;
@@ -311,6 +317,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* @throws UnsupportedOperationException
* if the setChildrenAllowed is not supported.
*/
@Override
public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed)
throws UnsupportedOperationException {

@@ -332,6 +339,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* @throws UnsupportedOperationException
* if the setParent is not supported.
*/
@Override
public boolean setParent(Object itemId, Object newParentId)
throws UnsupportedOperationException {

@@ -343,6 +351,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean containsId(Object itemId) {

if (!(itemId instanceof File)) {
@@ -371,6 +380,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* Gets the specified Item from the filesystem. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public Item getItem(Object itemId) {

if (!(itemId instanceof File)) {
@@ -416,6 +426,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* Gets the IDs of Items in the filesystem. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public Collection<File> getItemIds() {

if (recursive) {
@@ -459,6 +470,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* the property's ID.
* @return the requested property's value, or <code>null</code>
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {

if (!(itemId instanceof File)) {
@@ -493,6 +505,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @return Unmodifiable collection containing all available file properties.
*/
@Override
public Collection<String> getContainerPropertyIds() {
return FILE_PROPERTIES;
}
@@ -506,6 +519,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* the ID of the property whose type is requested.
* @return data type of the requested property, or <code>null</code>
*/
@Override
public Class<?> getType(Object propertyId) {

if (propertyId.equals(PROPERTY_NAME)) {
@@ -556,6 +570,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @return Number of Items in the container.
*/
@Override
public int size() {

if (recursive) {
@@ -609,6 +624,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* Gets the specified property of this file. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public Property<?> getItemProperty(Object id) {
return getContainerProperty(file, id);
}
@@ -618,6 +634,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public Collection<String> getItemPropertyIds() {
return getContainerPropertyIds();
}
@@ -716,6 +733,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Item#addItemProperty(Object, Property)
*/
@Override
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Filesystem container "
@@ -727,6 +745,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Item#removeItemProperty(Object)
*/
@Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
@@ -763,6 +782,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see java.io.FilenameFilter#accept(File, String)
*/
@Override
public boolean accept(File dir, String name) {
if (name.endsWith(filter)) {
return true;
@@ -832,6 +852,7 @@ public class FilesystemContainer implements Container.Hierarchical {
* @see com.vaadin.data.Container#addContainerProperty(java.lang.Object,
* java.lang.Class, java.lang.Object)
*/
@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException(
@@ -843,6 +864,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Container#addItem()
*/
@Override
public Object addItem() throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"File system container does not support this operation");
@@ -853,6 +875,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Container#addItem(java.lang.Object)
*/
@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"File system container does not support this operation");
@@ -863,6 +886,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Container#removeAllItems()
*/
@Override
public boolean removeAllItems() throws UnsupportedOperationException {
throw new UnsupportedOperationException(
"File system container does not support this operation");
@@ -873,6 +897,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Container#removeItem(java.lang.Object)
*/
@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
@@ -884,6 +909,7 @@ public class FilesystemContainer implements Container.Hierarchical {
*
* @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object )
*/
@Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(

+ 8
- 0
src/com/vaadin/data/util/HierarchicalContainer.java Прегледај датотеку

@@ -77,6 +77,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* Can the specified Item have any children? Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public boolean areChildrenAllowed(Object itemId) {
if (noChildrenAllowed.contains(itemId)) {
return false;
@@ -89,6 +90,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> getChildren(Object itemId) {
LinkedList<Object> c;

@@ -109,6 +111,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object getParent(Object itemId) {
if (filteredParent != null) {
return filteredParent.get(itemId);
@@ -121,6 +124,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean hasChildren(Object itemId) {
if (filteredChildren != null) {
return filteredChildren.containsKey(itemId);
@@ -134,6 +138,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public boolean isRoot(Object itemId) {
// If the container is filtered the itemId must be among filteredRoots
// to be a root.
@@ -156,6 +161,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Collection<?> rootItemIds() {
if (filteredRoots != null) {
return Collections.unmodifiableCollection(filteredRoots);
@@ -183,6 +189,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
@Override
public boolean setChildrenAllowed(Object itemId, boolean childrenAllowed) {

// Checks that the item is in the container
@@ -217,6 +224,7 @@ public class HierarchicalContainer extends IndexedContainer implements
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
@Override
public boolean setParent(Object itemId, Object newParentId) {

// Checks that the item is in the container

+ 8
- 0
src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java Прегледај датотеку

@@ -25,35 +25,43 @@ public class HierarchicalContainerOrderedWrapper extends
hierarchical = toBeWrapped;
}

@Override
public boolean areChildrenAllowed(Object itemId) {
return hierarchical.areChildrenAllowed(itemId);
}

@Override
public Collection<?> getChildren(Object itemId) {
return hierarchical.getChildren(itemId);
}

@Override
public Object getParent(Object itemId) {
return hierarchical.getParent(itemId);
}

@Override
public boolean hasChildren(Object itemId) {
return hierarchical.hasChildren(itemId);
}

@Override
public boolean isRoot(Object itemId) {
return hierarchical.isRoot(itemId);
}

@Override
public Collection<?> rootItemIds() {
return hierarchical.rootItemIds();
}

@Override
public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed)
throws UnsupportedOperationException {
return hierarchical.setChildrenAllowed(itemId, areChildrenAllowed);
}

@Override
public boolean setParent(Object itemId, Object newParentId)
throws UnsupportedOperationException {
return hierarchical.setParent(itemId, newParentId);

+ 24
- 0
src/com/vaadin/data/util/IndexedContainer.java Прегледај датотеку

@@ -128,6 +128,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Container#getContainerPropertyIds()
*/
@Override
public Collection<?> getContainerPropertyIds() {
return Collections.unmodifiableCollection(propertyIds);
}
@@ -139,6 +140,7 @@ public class IndexedContainer extends
* the ID of the Property.
* @return Type of the requested Property
*/
@Override
public Class<?> getType(Object propertyId) {
return types.get(propertyId);
}
@@ -149,6 +151,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Container#getContainerProperty(java.lang.Object,
* java.lang.Object)
*/
@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (!containsId(itemId)) {
return null;
@@ -466,6 +469,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Property.ValueChangeEvent#getProperty()
*/
@Override
public Property getProperty() {
return (Property) getSource();
}
@@ -488,6 +492,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Property.ValueChangeNotifier#addListener(com.
* vaadin.data.Property.ValueChangeListener)
*/
@Override
public void addListener(Property.ValueChangeListener listener) {
if (propertyValueChangeListeners == null) {
propertyValueChangeListeners = new LinkedList<Property.ValueChangeListener>();
@@ -501,6 +506,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Property.ValueChangeNotifier#removeListener(com
* .vaadin.data.Property.ValueChangeListener)
*/
@Override
public void removeListener(Property.ValueChangeListener listener) {
if (propertyValueChangeListeners != null) {
propertyValueChangeListeners.remove(listener);
@@ -679,10 +685,12 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Item#getItemProperty(java.lang.Object)
*/
@Override
public Property<?> getItemProperty(Object id) {
return new IndexedContainerProperty(itemId, id);
}

@Override
public Collection<?> getItemPropertyIds() {
return Collections.unmodifiableCollection(propertyIds);
}
@@ -753,6 +761,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Item#addProperty(Object, Property)
*/
@Override
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Indexed container item "
@@ -766,6 +775,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Item#removeProperty(Object)
*/
@Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
throw new UnsupportedOperationException(
@@ -824,6 +834,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Property#getType()
*/
@Override
public Class<?> getType() {
return types.get(propertyId);
}
@@ -833,6 +844,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Property#getValue()
*/
@Override
public Object getValue() {
return items.get(itemId).get(propertyId);
}
@@ -842,6 +854,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Property#isReadOnly()
*/
@Override
public boolean isReadOnly() {
return readOnlyProperties.contains(this);
}
@@ -851,6 +864,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Property#setReadOnly(boolean)
*/
@Override
public void setReadOnly(boolean newStatus) {
if (newStatus) {
readOnlyProperties.add(this);
@@ -864,6 +878,7 @@ public class IndexedContainer extends
*
* @see com.vaadin.data.Property#setValue(java.lang.Object)
*/
@Override
public void setValue(Object newValue) throws Property.ReadOnlyException {
// Gets the Property set
final Map<Object, Object> propertySet = items.get(itemId);
@@ -946,6 +961,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Property.ValueChangeNotifier#addListener(
* com.vaadin.data.Property.ValueChangeListener)
*/
@Override
public void addListener(Property.ValueChangeListener listener) {
addSinglePropertyChangeListener(propertyId, itemId, listener);
}
@@ -956,6 +972,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Property.ValueChangeNotifier#removeListener
* (com.vaadin.data.Property.ValueChangeListener)
*/
@Override
public void removeListener(Property.ValueChangeListener listener) {
removeSinglePropertyChangeListener(propertyId, itemId, listener);
}
@@ -972,6 +989,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[],
* boolean[])
*/
@Override
public void sort(Object[] propertyId, boolean[] ascending) {
sortContainer(propertyId, ascending);
}
@@ -982,6 +1000,7 @@ public class IndexedContainer extends
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds
* ()
*/
@Override
public Collection<?> getSortableContainerPropertyIds() {
return getSortablePropertyIds();
}
@@ -1054,6 +1073,7 @@ public class IndexedContainer extends
return nc;
}

@Override
public void addContainerFilter(Object propertyId, String filterString,
boolean ignoreCase, boolean onlyMatchPrefix) {
try {
@@ -1065,19 +1085,23 @@ public class IndexedContainer extends
}
}

@Override
public void removeAllContainerFilters() {
removeAllFilters();
}

@Override
public void removeContainerFilters(Object propertyId) {
removeFilters(propertyId);
}

@Override
public void addContainerFilter(Filter filter)
throws UnsupportedFilterException {
addFilter(filter);
}

@Override
public void removeContainerFilter(Filter filter) {
removeFilter(filter);
}

+ 1
- 0
src/com/vaadin/data/util/ItemSorter.java Прегледај датотеку

@@ -51,6 +51,7 @@ public interface ItemSorter extends Comparator<Object>, Cloneable, Serializable
*
* @see Comparator#compare(Object, Object)
*/
@Override
int compare(Object itemId1, Object itemId2);

}

+ 3
- 0
src/com/vaadin/data/util/MethodProperty.java Прегледај датотеку

@@ -568,6 +568,7 @@ public class MethodProperty<T> extends AbstractProperty<T> {
*
* @return type of the Property
*/
@Override
public final Class<? extends T> getType() {
return type;
}
@@ -591,6 +592,7 @@ public class MethodProperty<T> extends AbstractProperty<T> {
*
* @return the value of the Property
*/
@Override
public T getValue() {
try {
return (T) getMethod.invoke(instance, getArgs);
@@ -638,6 +640,7 @@ public class MethodProperty<T> extends AbstractProperty<T> {
* read-only mode.
* @see #invokeSetMethod(Object)
*/
@Override
@SuppressWarnings("unchecked")
public void setValue(Object newValue) throws Property.ReadOnlyException {


+ 3
- 0
src/com/vaadin/data/util/MethodPropertyDescriptor.java Прегледај датотеку

@@ -112,14 +112,17 @@ public class MethodPropertyDescriptor<BT> implements
}
};

@Override
public String getName() {
return name;
}

@Override
public Class<?> getPropertyType() {
return propertyType;
}

@Override
public Property<?> createProperty(Object bean) {
return new MethodProperty<Object>(propertyType, bean, readMethod,
writeMethod);

+ 3
- 0
src/com/vaadin/data/util/NestedMethodProperty.java Прегледај датотеку

@@ -165,6 +165,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> {
this.setMethod = setMethod;
}

@Override
public Class<? extends T> getType() {
return type;
}
@@ -180,6 +181,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> {
*
* @return the value of the Property
*/
@Override
public T getValue() {
try {
Object object = instance;
@@ -202,6 +204,7 @@ public class NestedMethodProperty<T> extends AbstractProperty<T> {
* read-only mode.
* @see #invokeSetMethod(Object)
*/
@Override
public void setValue(Object newValue) throws ReadOnlyException {
// Checks the mode
if (isReadOnly()) {

+ 3
- 0
src/com/vaadin/data/util/NestedPropertyDescriptor.java Прегледај датотеку

@@ -42,14 +42,17 @@ public class NestedPropertyDescriptor<BT> implements
this.propertyType = property.getType();
}

@Override
public String getName() {
return name;
}

@Override
public Class<?> getPropertyType() {
return propertyType;
}

@Override
public Property<?> createProperty(BT bean) {
return new NestedMethodProperty<Object>(bean, name);
}

+ 3
- 0
src/com/vaadin/data/util/ObjectProperty.java Прегледај датотеку

@@ -91,6 +91,7 @@ public class ObjectProperty<T> extends AbstractProperty<T> {
*
* @return type of the Property
*/
@Override
public final Class<T> getType() {
return type;
}
@@ -100,6 +101,7 @@ public class ObjectProperty<T> extends AbstractProperty<T> {
*
* @return the value stored in the Property
*/
@Override
public T getValue() {
return value;
}
@@ -115,6 +117,7 @@ public class ObjectProperty<T> extends AbstractProperty<T> {
* @throws <code>Property.ReadOnlyException</code> if the object is in
* read-only mode
*/
@Override
@SuppressWarnings("unchecked")
public void setValue(Object newValue) throws Property.ReadOnlyException {


+ 7
- 0
src/com/vaadin/data/util/PropertyFormatter.java Прегледај датотеку

@@ -75,6 +75,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
* @return the current data source as a Property, or <code>null</code> if
* none defined.
*/
@Override
public Property<T> getPropertyDataSource() {
return dataSource;
}
@@ -91,6 +92,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
* @param newDataSource
* the new data source Property.
*/
@Override
public void setPropertyDataSource(Property newDataSource) {

boolean readOnly = false;
@@ -132,6 +134,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
}

/* Documented in the interface */
@Override
public Class<String> getType() {
return String.class;
}
@@ -142,6 +145,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
* @return If the datasource returns null, this is null. Otherwise this is
* String given by format().
*/
@Override
public String getValue() {
T value = dataSource == null ? null : dataSource.getValue();
if (value == null) {
@@ -195,6 +199,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
}
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
if (dataSource == null) {
return;
@@ -221,6 +226,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
*
* This should not be called directly.
*/
@Override
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
fireValueChange();
}
@@ -230,6 +236,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
*
* This should not be called directly.
*/
@Override
public void readOnlyStatusChange(
com.vaadin.data.Property.ReadOnlyStatusChangeEvent event) {
fireReadOnlyStatusChange();

+ 7
- 0
src/com/vaadin/data/util/PropertysetItem.java Прегледај датотеку

@@ -57,6 +57,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* the identifier of the Property to get.
* @return the Property with the given ID or <code>null</code>
*/
@Override
public Property<?> getItemProperty(Object id) {
return map.get(id);
}
@@ -67,6 +68,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @return unmodifiable collection containing IDs of the Properties stored
* the Item
*/
@Override
public Collection<?> getItemPropertyIds() {
return Collections.unmodifiableCollection(list);
}
@@ -83,6 +85,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @return <code>true</code> if the operation succeeded <code>false</code>
* if not
*/
@Override
public boolean removeItemProperty(Object id) {

// Cant remove missing properties
@@ -107,6 +110,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
@Override
public boolean addItemProperty(Object id, Property property) {

// Null ids are not accepted
@@ -175,6 +179,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
*
* @return source object of the event as an <code>Item</code>
*/
@Override
public Item getItem() {
return (Item) getSource();
}
@@ -186,6 +191,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @param listener
* the new Listener to be registered.
*/
@Override
public void addListener(Item.PropertySetChangeListener listener) {
if (propertySetChangeListeners == null) {
propertySetChangeListeners = new LinkedList<PropertySetChangeListener>();
@@ -199,6 +205,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
* @param listener
* the Listener to be removed.
*/
@Override
public void removeListener(Item.PropertySetChangeListener listener) {
if (propertySetChangeListeners != null) {
propertySetChangeListeners.remove(listener);

+ 29
- 0
src/com/vaadin/data/util/QueryContainer.java Прегледај датотеку

@@ -188,6 +188,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @return Item Id.
*/

@Override
public Item getItem(Object id) {
return new Row(id);
}
@@ -198,6 +199,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @return Collection of Property ID.
*/

@Override
public Collection<String> getContainerPropertyIds() {
return propertyIds;
}
@@ -207,6 +209,7 @@ public class QueryContainer implements Container, Container.Ordered,
*
* @return collection of Item IDs
*/
@Override
public Collection<?> getItemIds() {
final Collection<Integer> c = new ArrayList<Integer>(size);
for (int i = 1; i <= size; i++) {
@@ -229,6 +232,7 @@ public class QueryContainer implements Container, Container.Ordered,
* otherwise.
*/

@Override
public synchronized Property<?> getContainerProperty(Object itemId,
Object propertyId) {
if (!(itemId instanceof Integer && propertyId instanceof String)) {
@@ -256,6 +260,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @return data type of the Properties
*/

@Override
public Class<?> getType(Object id) {
return propertyTypes.get(id);
}
@@ -265,6 +270,7 @@ public class QueryContainer implements Container, Container.Ordered,
*
* @return the number of items in the container.
*/
@Override
public int size() {
return size;
}
@@ -277,6 +283,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @return <code>true</code> if given id is in the container;
* <code>false</code> otherwise.
*/
@Override
public boolean containsId(Object id) {
if (!(id instanceof Integer)) {
return false;
@@ -302,6 +309,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addItem method is not supported.
*/
@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -313,6 +321,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addItem method is not supported.
*/
@Override
public Object addItem() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -327,6 +336,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the removeItem method is not supported.
*/
@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -346,6 +356,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addContainerProperty method is not supported.
*/
@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -361,6 +372,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the removeContainerProperty method is not supported.
*/
@Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -374,6 +386,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the removeAllItems method is not supported.
*/
@Override
public boolean removeAllItems() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -389,6 +402,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addItemAfter method is not supported.
*/
@Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -404,6 +418,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addItemAfter method is not supported.
*/
@Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -414,6 +429,7 @@ public class QueryContainer implements Container, Container.Ordered,
*
* @return ID of the first Item in the list.
*/
@Override
public Object firstItemId() {
if (size < 1) {
return null;
@@ -427,6 +443,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @param id
* ID of an Item in the Container.
*/
@Override
public boolean isFirstId(Object id) {
return size > 0 && (id instanceof Integer)
&& ((Integer) id).intValue() == 1;
@@ -439,6 +456,7 @@ public class QueryContainer implements Container, Container.Ordered,
* ID of an Item in the Container
*
*/
@Override
public boolean isLastId(Object id) {
return size > 0 && (id instanceof Integer)
&& ((Integer) id).intValue() == size;
@@ -449,6 +467,7 @@ public class QueryContainer implements Container, Container.Ordered,
*
* @return ID of the last Item.
*/
@Override
public Object lastItemId() {
if (size < 1) {
return null;
@@ -463,6 +482,7 @@ public class QueryContainer implements Container, Container.Ordered,
* ID of an Item in the Container.
* @return ID of the next Item or null.
*/
@Override
public Object nextItemId(Object id) {
if (size < 1 || !(id instanceof Integer)) {
return null;
@@ -481,6 +501,7 @@ public class QueryContainer implements Container, Container.Ordered,
* ID of an Item in the Container.
* @return ID of the previous Item or null.
*/
@Override
public Object prevItemId(Object id) {
if (size < 1 || !(id instanceof Integer)) {
return null;
@@ -519,6 +540,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addItemProperty method is not supported.
*/
@Override
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -532,6 +554,7 @@ public class QueryContainer implements Container, Container.Ordered,
* identifier of the Property to get
* @return the Property with the given ID or <code>null</code>
*/
@Override
public Property<?> getItemProperty(Object propertyId) {
return getContainerProperty(id, propertyId);
}
@@ -542,6 +565,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @return unmodifiable collection containing IDs of the Properties
* stored the Item.
*/
@Override
public Collection<String> getItemPropertyIds() {
return propertyIds;
}
@@ -556,6 +580,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the removeItemProperty is not supported.
*/
@Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -588,6 +613,7 @@ public class QueryContainer implements Container, Container.Ordered,
* @throws UnsupportedOperationException
* if the addItemAt is not supported.
*/
@Override
public Item addItemAt(int index, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -605,6 +631,7 @@ public class QueryContainer implements Container, Container.Ordered,
* if the addItemAt is not supported.
*/

@Override
public Object addItemAt(int index) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -616,6 +643,7 @@ public class QueryContainer implements Container, Container.Ordered,
* Index Id.
* @return ID in the given index.
*/
@Override
public Object getIdByIndex(int index) {
if (size < 1 || index < 0 || index >= size) {
return null;
@@ -632,6 +660,7 @@ public class QueryContainer implements Container, Container.Ordered,
* Item
*/

@Override
public int indexOfId(Object id) {
if (size < 1 || !(id instanceof Integer)) {
return -1;

+ 3
- 0
src/com/vaadin/data/util/TextFileProperty.java Прегледај датотеку

@@ -64,6 +64,7 @@ public class TextFileProperty extends AbstractProperty<String> {
*
* @see com.vaadin.data.Property#getType()
*/
@Override
public Class<String> getType() {
return String.class;
}
@@ -73,6 +74,7 @@ public class TextFileProperty extends AbstractProperty<String> {
*
* @see com.vaadin.data.Property#getValue()
*/
@Override
public String getValue() {
if (file == null) {
return null;
@@ -114,6 +116,7 @@ public class TextFileProperty extends AbstractProperty<String> {
*
* @see com.vaadin.data.Property#setValue(java.lang.Object)
*/
@Override
public void setValue(Object newValue) throws ReadOnlyException {
if (isReadOnly()) {
throw new ReadOnlyException();

+ 7
- 0
src/com/vaadin/data/util/TransactionalPropertyWrapper.java Прегледај датотеку

@@ -44,6 +44,7 @@ public class TransactionalPropertyWrapper<T> extends AbstractProperty<T>
((ValueChangeNotifier) wrappedProperty)
.addListener(new ValueChangeListener() {

@Override
public void valueChange(ValueChangeEvent event) {
fireValueChange();
}
@@ -51,29 +52,35 @@ public class TransactionalPropertyWrapper<T> extends AbstractProperty<T>
}
}

@Override
public Class getType() {
return wrappedProperty.getType();
}

@Override
public T getValue() {
return wrappedProperty.getValue();
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
// Causes a value change to be sent to this listener which in turn fires
// a new value change event for this property
wrappedProperty.setValue(newValue);
}

@Override
public void startTransaction() {
inTransaction = true;
valueBeforeTransaction = getValue();
}

@Override
public void commit() {
endTransaction();
}

@Override
public void rollback() {
try {
wrappedProperty.setValue(valueBeforeTransaction);

+ 4
- 0
src/com/vaadin/data/util/converter/DateToLongConverter.java Прегледај датотеку

@@ -24,6 +24,7 @@ public class DateToLongConverter implements Converter<Date, Long> {
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object,
* java.util.Locale)
*/
@Override
public Long convertToModel(Date value, Locale locale) {
if (value == null) {
return null;
@@ -39,6 +40,7 @@ public class DateToLongConverter implements Converter<Date, Long> {
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
* .Object, java.util.Locale)
*/
@Override
public Date convertToPresentation(Long value, Locale locale) {
if (value == null) {
return null;
@@ -52,6 +54,7 @@ public class DateToLongConverter implements Converter<Date, Long> {
*
* @see com.vaadin.data.util.converter.Converter#getModelType()
*/
@Override
public Class<Long> getModelType() {
return Long.class;
}
@@ -61,6 +64,7 @@ public class DateToLongConverter implements Converter<Date, Long> {
*
* @see com.vaadin.data.util.converter.Converter#getPresentationType()
*/
@Override
public Class<Date> getPresentationType() {
return Date.class;
}

+ 1
- 0
src/com/vaadin/data/util/converter/DefaultConverterFactory.java Прегледај датотеку

@@ -27,6 +27,7 @@ public class DefaultConverterFactory implements ConverterFactory {
private final static Logger log = Logger
.getLogger(DefaultConverterFactory.class.getName());

@Override
public <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> createConverter(
Class<PRESENTATION> presentationType, Class<MODEL> modelType) {
Converter<PRESENTATION, MODEL> converter = findConverter(

+ 4
- 0
src/com/vaadin/data/util/converter/ReverseConverter.java Прегледај датотеку

@@ -42,6 +42,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements
* @see com.vaadin.data.util.converter.Converter#convertToModel(java
* .lang.Object, java.util.Locale)
*/
@Override
public MODEL convertToModel(PRESENTATION value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
return realConverter.convertToPresentation(value, locale);
@@ -54,6 +55,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
* .Object, java.util.Locale)
*/
@Override
public PRESENTATION convertToPresentation(MODEL value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
return realConverter.convertToModel(value, locale);
@@ -64,6 +66,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements
*
* @see com.vaadin.data.util.converter.Converter#getSourceType()
*/
@Override
public Class<MODEL> getModelType() {
return realConverter.getPresentationType();
}
@@ -73,6 +76,7 @@ public class ReverseConverter<PRESENTATION, MODEL> implements
*
* @see com.vaadin.data.util.converter.Converter#getTargetType()
*/
@Override
public Class<PRESENTATION> getPresentationType() {
return realConverter.getModelType();
}

+ 4
- 0
src/com/vaadin/data/util/converter/StringToBooleanConverter.java Прегледај датотеку

@@ -27,6 +27,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> {
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object,
* java.util.Locale)
*/
@Override
public Boolean convertToModel(String value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -71,6 +72,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> {
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
* .Object, java.util.Locale)
*/
@Override
public String convertToPresentation(Boolean value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -88,6 +90,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> {
*
* @see com.vaadin.data.util.converter.Converter#getModelType()
*/
@Override
public Class<Boolean> getModelType() {
return Boolean.class;
}
@@ -97,6 +100,7 @@ public class StringToBooleanConverter implements Converter<String, Boolean> {
*
* @see com.vaadin.data.util.converter.Converter#getPresentationType()
*/
@Override
public Class<String> getPresentationType() {
return String.class;
}

+ 4
- 0
src/com/vaadin/data/util/converter/StringToDateConverter.java Прегледај датотеку

@@ -52,6 +52,7 @@ public class StringToDateConverter implements Converter<String, Date> {
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object,
* java.util.Locale)
*/
@Override
public Date convertToModel(String value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
if (value == null) {
@@ -78,6 +79,7 @@ public class StringToDateConverter implements Converter<String, Date> {
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
* .Object, java.util.Locale)
*/
@Override
public String convertToPresentation(Date value, Locale locale)
throws com.vaadin.data.util.converter.Converter.ConversionException {
if (value == null) {
@@ -92,6 +94,7 @@ public class StringToDateConverter implements Converter<String, Date> {
*
* @see com.vaadin.data.util.converter.Converter#getModelType()
*/
@Override
public Class<Date> getModelType() {
return Date.class;
}
@@ -101,6 +104,7 @@ public class StringToDateConverter implements Converter<String, Date> {
*
* @see com.vaadin.data.util.converter.Converter#getPresentationType()
*/
@Override
public Class<String> getPresentationType() {
return String.class;
}

+ 4
- 0
src/com/vaadin/data/util/converter/StringToDoubleConverter.java Прегледај датотеку

@@ -49,6 +49,7 @@ public class StringToDoubleConverter implements Converter<String, Double> {
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object,
* java.util.Locale)
*/
@Override
public Double convertToModel(String value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -74,6 +75,7 @@ public class StringToDoubleConverter implements Converter<String, Double> {
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
* .Object, java.util.Locale)
*/
@Override
public String convertToPresentation(Double value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -88,6 +90,7 @@ public class StringToDoubleConverter implements Converter<String, Double> {
*
* @see com.vaadin.data.util.converter.Converter#getModelType()
*/
@Override
public Class<Double> getModelType() {
return Double.class;
}
@@ -97,6 +100,7 @@ public class StringToDoubleConverter implements Converter<String, Double> {
*
* @see com.vaadin.data.util.converter.Converter#getPresentationType()
*/
@Override
public Class<String> getPresentationType() {
return String.class;
}

+ 4
- 0
src/com/vaadin/data/util/converter/StringToIntegerConverter.java Прегледај датотеку

@@ -39,6 +39,7 @@ public class StringToIntegerConverter implements Converter<String, Integer> {
return NumberFormat.getIntegerInstance(locale);
}

@Override
public Integer convertToModel(String value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -64,6 +65,7 @@ public class StringToIntegerConverter implements Converter<String, Integer> {
return parsedValue.intValue();
}

@Override
public String convertToPresentation(Integer value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -73,10 +75,12 @@ public class StringToIntegerConverter implements Converter<String, Integer> {
return getFormat(locale).format(value);
}

@Override
public Class<Integer> getModelType() {
return Integer.class;
}

@Override
public Class<String> getPresentationType() {
return String.class;
}

+ 4
- 0
src/com/vaadin/data/util/converter/StringToNumberConverter.java Прегледај датотеку

@@ -45,6 +45,7 @@ public class StringToNumberConverter implements Converter<String, Number> {
* com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object,
* java.util.Locale)
*/
@Override
public Number convertToModel(String value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -77,6 +78,7 @@ public class StringToNumberConverter implements Converter<String, Number> {
* com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
* .Object, java.util.Locale)
*/
@Override
public String convertToPresentation(Number value, Locale locale)
throws ConversionException {
if (value == null) {
@@ -91,6 +93,7 @@ public class StringToNumberConverter implements Converter<String, Number> {
*
* @see com.vaadin.data.util.converter.Converter#getModelType()
*/
@Override
public Class<Number> getModelType() {
return Number.class;
}
@@ -100,6 +103,7 @@ public class StringToNumberConverter implements Converter<String, Number> {
*
* @see com.vaadin.data.util.converter.Converter#getPresentationType()
*/
@Override
public Class<String> getPresentationType() {
return String.class;
}

+ 1
- 0
src/com/vaadin/data/util/filter/AbstractJunctionFilter.java Прегледај датотеку

@@ -45,6 +45,7 @@ public abstract class AbstractJunctionFilter implements Filter {
* If there are no sub-filters, false is returned - override in subclasses
* to change this behavior.
*/
@Override
public boolean appliesToProperty(Object propertyId) {
for (Filter filter : getFilters()) {
if (filter.appliesToProperty(propertyId)) {

+ 1
- 0
src/com/vaadin/data/util/filter/And.java Прегледај датотеку

@@ -30,6 +30,7 @@ public final class And extends AbstractJunctionFilter {
super(filters);
}

@Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedFilterException {
for (Filter filter : getFilters()) {

+ 2
- 0
src/com/vaadin/data/util/filter/Between.java Прегледај датотеку

@@ -30,6 +30,7 @@ public class Between implements Filter {
return endValue;
}

@Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedOperationException {
Object value = item.getItemProperty(getPropertyId()).getValue();
@@ -41,6 +42,7 @@ public class Between implements Filter {
return false;
}

@Override
public boolean appliesToProperty(Object propertyId) {
return getPropertyId() != null && getPropertyId().equals(propertyId);
}

+ 2
- 0
src/com/vaadin/data/util/filter/Compare.java Прегледај датотеку

@@ -227,6 +227,7 @@ public abstract class Compare implements Filter {
this.operation = operation;
}

@Override
public boolean passesFilter(Object itemId, Item item) {
final Property<?> p = item.getItemProperty(getPropertyId());
if (null == p) {
@@ -264,6 +265,7 @@ public abstract class Compare implements Filter {
+ value1 + ", " + getValue());
}

@Override
public boolean appliesToProperty(Object propertyId) {
return getPropertyId().equals(propertyId);
}

+ 2
- 0
src/com/vaadin/data/util/filter/IsNull.java Прегледај датотеку

@@ -33,6 +33,7 @@ public final class IsNull implements Filter {
this.propertyId = propertyId;
}

@Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedOperationException {
final Property<?> p = item.getItemProperty(getPropertyId());
@@ -42,6 +43,7 @@ public final class IsNull implements Filter {
return null == p.getValue();
}

@Override
public boolean appliesToProperty(Object propertyId) {
return getPropertyId().equals(propertyId);
}

+ 2
- 0
src/com/vaadin/data/util/filter/Like.java Прегледај датотеку

@@ -37,6 +37,7 @@ public class Like implements Filter {
return caseSensitive;
}

@Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedOperationException {
if (!item.getItemProperty(getPropertyId()).getType()
@@ -54,6 +55,7 @@ public class Like implements Filter {
return colValue.toUpperCase().matches(pattern.toUpperCase());
}

@Override
public boolean appliesToProperty(Object propertyId) {
return getPropertyId() != null && getPropertyId().equals(propertyId);
}

+ 2
- 0
src/com/vaadin/data/util/filter/Not.java Прегледај датотеку

@@ -36,6 +36,7 @@ public final class Not implements Filter {
return filter;
}

@Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedOperationException {
return !filter.passesFilter(itemId, item);
@@ -48,6 +49,7 @@ public final class Not implements Filter {
*
* @return boolean
*/
@Override
public boolean appliesToProperty(Object propertyId) {
return filter.appliesToProperty(propertyId);
}

+ 1
- 0
src/com/vaadin/data/util/filter/Or.java Прегледај датотеку

@@ -30,6 +30,7 @@ public final class Or extends AbstractJunctionFilter {
super(filters);
}

@Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedFilterException {
for (Filter filter : getFilters()) {

+ 2
- 0
src/com/vaadin/data/util/filter/SimpleStringFilter.java Прегледај датотеку

@@ -39,6 +39,7 @@ public final class SimpleStringFilter implements Filter {
this.onlyMatchPrefix = onlyMatchPrefix;
}

@Override
public boolean passesFilter(Object itemId, Item item) {
final Property<?> p = item.getItemProperty(propertyId);
if (p == null) {
@@ -62,6 +63,7 @@ public final class SimpleStringFilter implements Filter {
return true;
}

@Override
public boolean appliesToProperty(Object propertyId) {
return this.propertyId.equals(propertyId);
}

+ 5
- 0
src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java Прегледај датотеку

@@ -61,6 +61,7 @@ final public class ColumnProperty implements Property {
this.readOnly = readOnly;
}

@Override
public Object getValue() {
if (isModified()) {
return changedValue;
@@ -68,6 +69,7 @@ final public class ColumnProperty implements Property {
return value;
}

@Override
public void setValue(Object newValue) throws ReadOnlyException {
if (newValue == null && !nullable) {
throw new NotNullableException(
@@ -134,10 +136,12 @@ final public class ColumnProperty implements Property {
|| newValue.equals(referenceValue);
}

@Override
public Class<?> getType() {
return type;
}

@Override
public boolean isReadOnly() {
return readOnly;
}
@@ -146,6 +150,7 @@ final public class ColumnProperty implements Property {
return allowReadOnlyChange;
}

@Override
public void setReadOnly(boolean newStatus) {
if (allowReadOnlyChange) {
readOnly = newStatus;

+ 4
- 0
src/com/vaadin/data/util/sqlcontainer/RowItem.java Прегледај датотеку

@@ -48,6 +48,7 @@ public final class RowItem implements Item {
this.id = id;
}

@Override
public Property<?> getItemProperty(Object id) {
if (id instanceof String && id != null) {
for (ColumnProperty cp : properties) {
@@ -59,6 +60,7 @@ public final class RowItem implements Item {
return null;
}

@Override
public Collection<?> getItemPropertyIds() {
Collection<String> ids = new ArrayList<String>(properties.size());
for (ColumnProperty cp : properties) {
@@ -71,6 +73,7 @@ public final class RowItem implements Item {
* Adding properties is not supported. Properties are generated by
* SQLContainer.
*/
@Override
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -80,6 +83,7 @@ public final class RowItem implements Item {
* Removing properties is not supported. Properties are generated by
* SQLContainer.
*/
@Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();

+ 34
- 0
src/com/vaadin/data/util/sqlcontainer/SQLContainer.java Прегледај датотеку

@@ -130,6 +130,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/

@Override
public Object addItem() throws UnsupportedOperationException {
Object emptyKey[] = new Object[delegate.getPrimaryKeyColumns().size()];
RowId itemId = new TemporaryRowId(emptyKey);
@@ -186,6 +187,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#containsId(java.lang.Object)
*/

@Override
public boolean containsId(Object itemId) {
if (itemId == null) {
return false;
@@ -227,6 +229,7 @@ public class SQLContainer implements Container, Container.Filterable,
* java.lang.Object)
*/

@Override
public Property<?> getContainerProperty(Object itemId, Object propertyId) {
Item item = getItem(itemId);
if (item == null) {
@@ -241,6 +244,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#getContainerPropertyIds()
*/

@Override
public Collection<?> getContainerPropertyIds() {
return Collections.unmodifiableCollection(propertyIds);
}
@@ -251,6 +255,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#getItem(java.lang.Object)
*/

@Override
public Item getItem(Object itemId) {
if (!cachedItems.containsKey(itemId)) {
int index = indexOfId(itemId);
@@ -298,6 +303,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/

@Override
public Collection<?> getItemIds() {
updateCount();
ArrayList<RowId> ids = new ArrayList<RowId>();
@@ -355,6 +361,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#getType(java.lang.Object)
*/

@Override
public Class<?> getType(Object propertyId) {
if (!propertyIds.contains(propertyId)) {
return null;
@@ -368,6 +375,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#size()
*/

@Override
public int size() {
updateCount();
return size + sizeOfAddedItems() - removedItems.size();
@@ -379,6 +387,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#removeItem(java.lang.Object)
*/

@Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
if (!containsId(itemId)) {
@@ -447,6 +456,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#removeAllItems()
*/

@Override
public boolean removeAllItems() throws UnsupportedOperationException {
if (autoCommit) {
/* Remove and commit instantly. */
@@ -508,6 +518,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/

@Override
public void addContainerFilter(Filter filter)
throws UnsupportedFilterException {
// filter.setCaseSensitive(!ignoreCase);
@@ -520,8 +531,10 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/

@Override
public void removeContainerFilter(Filter filter) {
filters.remove(filter);
refresh();
}

/**
@@ -560,6 +573,7 @@ public class SQLContainer implements Container, Container.Filterable,
* {@inheritDoc}
*/

@Override
public void removeAllContainerFilters() {
filters.clear();
refresh();
@@ -575,6 +589,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#indexOfId(java.lang.Object)
*/

@Override
public int indexOfId(Object itemId) {
// First check if the id is in the added items
for (int ix = 0; ix < addedItems.size(); ix++) {
@@ -622,6 +637,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#getIdByIndex(int)
*/

@Override
public Object getIdByIndex(int index) {
if (index < 0 || index > size() - 1) {
return null;
@@ -649,6 +665,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object)
*/

@Override
public Object nextItemId(Object itemId) {
return getIdByIndex(indexOfId(itemId) + 1);
}
@@ -659,6 +676,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object)
*/

@Override
public Object prevItemId(Object itemId) {
return getIdByIndex(indexOfId(itemId) - 1);
}
@@ -669,6 +687,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#firstItemId()
*/

@Override
public Object firstItemId() {
updateCount();
if (size == 0) {
@@ -697,6 +716,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#lastItemId()
*/

@Override
public Object lastItemId() {
if (addedItems.isEmpty()) {
int lastIx = size() - 1;
@@ -723,6 +743,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object)
*/

@Override
public boolean isFirstId(Object itemId) {
return firstItemId().equals(itemId);
}
@@ -733,6 +754,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object)
*/

@Override
public boolean isLastId(Object itemId) {
return lastItemId().equals(itemId);
}
@@ -748,6 +770,7 @@ public class SQLContainer implements Container, Container.Filterable,
* boolean[])
*/

@Override
public void sort(Object[] propertyId, boolean[] ascending) {
sorters.clear();
if (propertyId == null || propertyId.length == 0) {
@@ -777,6 +800,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds()
*/

@Override
public Collection<?> getSortableContainerPropertyIds() {
return getContainerPropertyIds();
}
@@ -1351,6 +1375,7 @@ public class SQLContainer implements Container, Container.Filterable,
* java.lang.Class, java.lang.Object)
*/

@Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1362,6 +1387,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object)
*/

@Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1373,6 +1399,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container#addItem(java.lang.Object)
*/

@Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -1384,6 +1411,7 @@ public class SQLContainer implements Container, Container.Filterable,
* java.lang.Object)
*/

@Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1395,6 +1423,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#addItemAt(int, java.lang.Object)
*/

@Override
public Item addItemAt(int index, Object newItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1406,6 +1435,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Indexed#addItemAt(int)
*/

@Override
public Object addItemAt(int index) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@@ -1416,6 +1446,7 @@ public class SQLContainer implements Container, Container.Filterable,
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object)
*/

@Override
public Object addItemAfter(Object previousItemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
@@ -1433,6 +1464,7 @@ public class SQLContainer implements Container, Container.Filterable,
* .data.Container.ItemSetChangeListener)
*/

@Override
public void addListener(Container.ItemSetChangeListener listener) {
if (itemSetChangeListeners == null) {
itemSetChangeListeners = new LinkedList<Container.ItemSetChangeListener>();
@@ -1448,6 +1480,7 @@ public class SQLContainer implements Container, Container.Filterable,
* .data.Container.ItemSetChangeListener)
*/

@Override
public void removeListener(Container.ItemSetChangeListener listener) {
if (itemSetChangeListeners != null) {
itemSetChangeListeners.remove(listener);
@@ -1477,6 +1510,7 @@ public class SQLContainer implements Container, Container.Filterable,
super(source);
}

@Override
public Container getContainer() {
return (Container) getSource();
}

+ 3
- 0
src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java Прегледај датотеку

@@ -26,6 +26,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool {
this.dataSourceJndiName = dataSourceJndiName;
}

@Override
public Connection reserveConnection() throws SQLException {
Connection conn = getDataSource().getConnection();
conn.setAutoCommit(false);
@@ -51,6 +52,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool {
}
}

@Override
public void releaseConnection(Connection conn) {
if (conn != null) {
try {
@@ -62,6 +64,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool {
}
}

@Override
public void destroy() {
dataSource = null;
}

+ 3
- 0
src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java Прегледај датотеку

@@ -81,6 +81,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
initialized = true;
}

@Override
public synchronized Connection reserveConnection() throws SQLException {
if (!initialized) {
initializeConnections();
@@ -100,6 +101,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
return c;
}

@Override
public synchronized void releaseConnection(Connection conn) {
if (conn == null || !initialized) {
return;
@@ -139,6 +141,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool {
return c;
}

@Override
public void destroy() {
for (Connection c : availableConnections) {
try {

+ 12
- 0
src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java Прегледај датотеку

@@ -99,6 +99,7 @@ public class FreeformQuery implements QueryDelegate {
*
* {@inheritDoc}
*/
@Override
public int getCount() throws SQLException {
// First try the delegate
int count = countByDelegate();
@@ -187,6 +188,7 @@ public class FreeformQuery implements QueryDelegate {
*
* @see FreeformQueryDelegate#getQueryString(int, int)
*/
@Override
@SuppressWarnings("deprecation")
public ResultSet getResults(int offset, int pagelength) throws SQLException {
if (activeConnection == null) {
@@ -218,6 +220,7 @@ public class FreeformQuery implements QueryDelegate {
return rs;
}

@Override
@SuppressWarnings("deprecation")
public boolean implementationRespectsPagingLimits() {
if (delegate == null) {
@@ -251,6 +254,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setFilters(java
* .util.List)
*/
@Override
public void setFilters(List<Filter> filters)
throws UnsupportedOperationException {
if (delegate != null) {
@@ -268,6 +272,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setOrderBy(java
* .util.List)
*/
@Override
public void setOrderBy(List<OrderBy> orderBys)
throws UnsupportedOperationException {
if (delegate != null) {
@@ -285,6 +290,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin
* .data.util.sqlcontainer.RowItem)
*/
@Override
public int storeRow(RowItem row) throws SQLException {
if (activeConnection == null) {
throw new IllegalStateException("No transaction is active!");
@@ -307,6 +313,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin
* .data.util.sqlcontainer.RowItem)
*/
@Override
public boolean removeRow(RowItem row) throws SQLException {
if (activeConnection == null) {
throw new IllegalStateException("No transaction is active!");
@@ -328,6 +335,7 @@ public class FreeformQuery implements QueryDelegate {
* @see
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#beginTransaction()
*/
@Override
public synchronized void beginTransaction()
throws UnsupportedOperationException, SQLException {
if (activeConnection != null) {
@@ -342,6 +350,7 @@ public class FreeformQuery implements QueryDelegate {
*
* @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#commit()
*/
@Override
public synchronized void commit() throws UnsupportedOperationException,
SQLException {
if (activeConnection == null) {
@@ -359,6 +368,7 @@ public class FreeformQuery implements QueryDelegate {
*
* @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#rollback()
*/
@Override
public synchronized void rollback() throws UnsupportedOperationException,
SQLException {
if (activeConnection == null) {
@@ -376,6 +386,7 @@ public class FreeformQuery implements QueryDelegate {
* com.vaadin.data.util.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns
* ()
*/
@Override
public List<String> getPrimaryKeyColumns() {
return primaryKeyColumns;
}
@@ -403,6 +414,7 @@ public class FreeformQuery implements QueryDelegate {
* @see FreeformQueryDelegate#getContainsRowQueryString(Object...)
*
*/
@Override
@SuppressWarnings("deprecation")
public boolean containsRowWithKey(Object... keys) throws SQLException {
String query = null;

+ 16
- 0
src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java Прегледај датотеку

@@ -111,6 +111,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getCount()
*/
@Override
public int getCount() throws SQLException {
getLogger().log(Level.FINE, "Fetching count...");
StatementHelper sh = sqlGenerator.generateSelectQuery(tableName,
@@ -137,6 +138,7 @@ public class TableQuery implements QueryDelegate,
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getResults(int,
* int)
*/
@Override
public ResultSet getResults(int offset, int pagelength) throws SQLException {
StatementHelper sh;
/*
@@ -161,6 +163,7 @@ public class TableQuery implements QueryDelegate,
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#
* implementationRespectsPagingLimits()
*/
@Override
public boolean implementationRespectsPagingLimits() {
return true;
}
@@ -172,6 +175,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin
* .addon.sqlcontainer.RowItem)
*/
@Override
public int storeRow(RowItem row) throws UnsupportedOperationException,
SQLException {
if (row == null) {
@@ -254,6 +258,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#setFilters(java.util
* .List)
*/
@Override
public void setFilters(List<Filter> filters)
throws UnsupportedOperationException {
if (filters == null) {
@@ -270,6 +275,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#setOrderBy(java.util
* .List)
*/
@Override
public void setOrderBy(List<OrderBy> orderBys)
throws UnsupportedOperationException {
if (orderBys == null) {
@@ -284,6 +290,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#beginTransaction()
*/
@Override
public void beginTransaction() throws UnsupportedOperationException,
SQLException {
if (transactionOpen && activeConnection != null) {
@@ -301,6 +308,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#commit()
*/
@Override
public void commit() throws UnsupportedOperationException, SQLException {
if (transactionOpen && activeConnection != null) {
getLogger().log(Level.FINE, "DB -> commit");
@@ -329,6 +337,7 @@ public class TableQuery implements QueryDelegate,
*
* @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#rollback()
*/
@Override
public void rollback() throws UnsupportedOperationException, SQLException {
if (transactionOpen && activeConnection != null) {
getLogger().log(Level.FINE, "DB -> rollback");
@@ -346,6 +355,7 @@ public class TableQuery implements QueryDelegate,
* @see
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns()
*/
@Override
public List<String> getPrimaryKeyColumns() {
return Collections.unmodifiableList(primaryKeyColumns);
}
@@ -581,6 +591,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin
* .addon.sqlcontainer.RowItem)
*/
@Override
public boolean removeRow(RowItem row) throws UnsupportedOperationException,
SQLException {
getLogger().log(Level.FINE,
@@ -604,6 +615,7 @@ public class TableQuery implements QueryDelegate,
* com.vaadin.addon.sqlcontainer.query.QueryDelegate#containsRowWithKey(
* java.lang.Object[])
*/
@Override
public boolean containsRowWithKey(Object... keys) throws SQLException {
ArrayList<Filter> filtersAndKeys = new ArrayList<Filter>();
if (filters != null) {
@@ -665,10 +677,12 @@ public class TableQuery implements QueryDelegate,
this.newId = newId;
}

@Override
public RowId getNewRowId() {
return newId;
}

@Override
public RowId getOldRowId() {
return oldId;
}
@@ -677,6 +691,7 @@ public class TableQuery implements QueryDelegate,
/**
* Adds RowIdChangeListener to this query
*/
@Override
public void addListener(RowIdChangeListener listener) {
if (rowIdChangeListeners == null) {
rowIdChangeListeners = new LinkedList<QueryDelegate.RowIdChangeListener>();
@@ -687,6 +702,7 @@ public class TableQuery implements QueryDelegate,
/**
* Removes the given RowIdChangeListener from this query
*/
@Override
public void removeListener(RowIdChangeListener listener) {
if (rowIdChangeListeners != null) {
rowIdChangeListeners.remove(listener);

+ 61
- 5
src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java Прегледај датотеку

@@ -24,10 +24,24 @@ import com.vaadin.data.util.sqlcontainer.query.generator.filter.StringDecorator;
@SuppressWarnings("serial")
public class DefaultSQLGenerator implements SQLGenerator {

private Class<? extends StatementHelper> statementHelperClass = null;

public DefaultSQLGenerator() {

}

/**
* Create a new DefaultSqlGenerator instance that uses the given
* implementation of {@link StatementHelper}
*
* @param statementHelper
*/
public DefaultSQLGenerator(
Class<? extends StatementHelper> statementHelperClazz) {
this();
statementHelperClass = statementHelperClazz;
}

/**
* Construct a DefaultSQLGenerator with the specified identifiers for start
* and end of quoted strings. The identifiers may be different depending on
@@ -44,6 +58,20 @@ public class DefaultSQLGenerator implements SQLGenerator {
quoteEnd));
}

/**
* Same as {@link #DefaultSQLGenerator(String, String)} but with support for
* custom {@link StatementHelper} implementation.
*
* @param quoteStart
* @param quoteEnd
* @param statementHelperClazz
*/
public DefaultSQLGenerator(String quoteStart, String quoteEnd,
Class<? extends StatementHelper> statementHelperClazz) {
this(quoteStart, quoteEnd);
statementHelperClass = statementHelperClazz;
}

/*
* (non-Javadoc)
*
@@ -51,6 +79,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateSelectQuery(java.lang.String, java.util.List, java.util.List,
* int, int, java.lang.String)
*/
@Override
public StatementHelper generateSelectQuery(String tableName,
List<Filter> filters, List<OrderBy> orderBys, int offset,
int pagelength, String toSelect) {
@@ -58,7 +87,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
throw new IllegalArgumentException("Table name must be given.");
}
toSelect = toSelect == null ? "*" : toSelect;
StatementHelper sh = new StatementHelper();
StatementHelper sh = getStatementHelper();
StringBuffer query = new StringBuffer();
query.append("SELECT " + toSelect + " FROM ").append(
SQLUtil.escapeSQL(tableName));
@@ -84,6 +113,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateUpdateQuery(java.lang.String,
* com.vaadin.addon.sqlcontainer.RowItem)
*/
@Override
public StatementHelper generateUpdateQuery(String tableName, RowItem item) {
if (tableName == null || tableName.trim().equals("")) {
throw new IllegalArgumentException("Table name must be given.");
@@ -91,7 +121,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
if (item == null) {
throw new IllegalArgumentException("Updated item must be given.");
}
StatementHelper sh = new StatementHelper();
StatementHelper sh = getStatementHelper();
StringBuffer query = new StringBuffer();
query.append("UPDATE ").append(tableName).append(" SET");

@@ -133,6 +163,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateInsertQuery(java.lang.String,
* com.vaadin.addon.sqlcontainer.RowItem)
*/
@Override
public StatementHelper generateInsertQuery(String tableName, RowItem item) {
if (tableName == null || tableName.trim().equals("")) {
throw new IllegalArgumentException("Table name must be given.");
@@ -144,7 +175,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
throw new IllegalArgumentException(
"Cannot generate an insert query for item already in database.");
}
StatementHelper sh = new StatementHelper();
StatementHelper sh = getStatementHelper();
StringBuffer query = new StringBuffer();
query.append("INSERT INTO ").append(tableName).append(" (");

@@ -184,6 +215,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
* generateDeleteQuery(java.lang.String,
* com.vaadin.addon.sqlcontainer.RowItem)
*/
@Override
public StatementHelper generateDeleteQuery(String tableName,
List<String> primaryKeyColumns, String versionColumn, RowItem item) {
if (tableName == null || tableName.trim().equals("")) {
@@ -197,7 +229,7 @@ public class DefaultSQLGenerator implements SQLGenerator {
throw new IllegalArgumentException(
"Valid keyColumnNames must be provided.");
}
StatementHelper sh = new StatementHelper();
StatementHelper sh = getStatementHelper();
StringBuffer query = new StringBuffer();
query.append("DELETE FROM ").append(tableName).append(" WHERE ");
int count = 1;
@@ -308,4 +340,28 @@ public class DefaultSQLGenerator implements SQLGenerator {
}
return rowIdentifiers;
}
}

/**
* Returns the statement helper for the generator. Override this to handle
* platform specific data types.
*
* @see http://dev.vaadin.com/ticket/9148
* @return a new instance of the statement helper
*/
protected StatementHelper getStatementHelper() {
if (statementHelperClass == null) {
return new StatementHelper();
}

try {
return statementHelperClass.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException(
"Unable to instantiate custom StatementHelper", e);
} catch (IllegalAccessException e) {
throw new RuntimeException(
"Unable to instantiate custom StatementHelper", e);
}
}

}

+ 1
- 1
src/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java Прегледај датотеку

@@ -50,7 +50,7 @@ public class MSSQLGenerator extends DefaultSQLGenerator {
offset = pagelength > 1 ? ++offset : offset;
pagelength = pagelength > 1 ? --pagelength : pagelength;
toSelect = toSelect == null ? "*" : toSelect;
StatementHelper sh = new StatementHelper();
StatementHelper sh = getStatementHelper();
StringBuffer query = new StringBuffer();

/* Row count request is handled here */

+ 11
- 1
src/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java Прегледај датотеку

@@ -16,6 +16,10 @@ public class OracleGenerator extends DefaultSQLGenerator {

}

public OracleGenerator(Class<? extends StatementHelper> statementHelperClazz) {
super(statementHelperClazz);
}

/**
* Construct an OracleSQLGenerator with the specified identifiers for start
* and end of quoted strings. The identifiers may be different depending on
@@ -31,6 +35,11 @@ public class OracleGenerator extends DefaultSQLGenerator {
super(quoteStart, quoteEnd);
}

public OracleGenerator(String quoteStart, String quoteEnd,
Class<? extends StatementHelper> statementHelperClazz) {
super(quoteStart, quoteEnd, statementHelperClazz);
}

/*
* (non-Javadoc)
*
@@ -50,7 +59,7 @@ public class OracleGenerator extends DefaultSQLGenerator {
offset = pagelength > 1 ? ++offset : offset;
pagelength = pagelength > 1 ? --pagelength : pagelength;
toSelect = toSelect == null ? "*" : toSelect;
StatementHelper sh = new StatementHelper();
StatementHelper sh = getStatementHelper();
StringBuffer query = new StringBuffer();

/* Row count request is handled here */
@@ -99,4 +108,5 @@ public class OracleGenerator extends DefaultSQLGenerator {
sh.setQueryString(query.toString());
return sh;
}

}

+ 24
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java Прегледај датотеку

@@ -128,8 +128,32 @@ public class StatementHelper implements Serializable {
} else if (Timestamp.class.equals(dataTypes.get(i))) {
pstmt.setTimestamp(i + 1, null);
} else {

if (handleUnrecognizedTypeNullValue(i, pstmt, dataTypes)) {
return;
}

throw new SQLException("Data type not supported by SQLContainer: "
+ parameters.get(i).getClass().toString());
}
}

/**
* Handle unrecognized null values. Override this to handle null values for
* platform specific data types that are not handled by the default
* implementation of the {@link StatementHelper}.
*
* @param i
* @param pstmt
* @param dataTypes2
*
* @return true if handled, false otherwise
*
* @see {@link http://dev.vaadin.com/ticket/9148}
*/
protected boolean handleUnrecognizedTypeNullValue(int i,
PreparedStatement pstmt, Map<Integer, Class<?>> dataTypes)
throws SQLException {
return false;
}
}

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java Прегледај датотеку

@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class AndTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof And;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
return QueryBuilder.group(QueryBuilder.getJoinedFilterString(
((And) filter).getFilters(), "AND", sh));

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java Прегледај датотеку

@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class BetweenTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Between;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Between between = (Between) filter;
sh.addParameterValue(between.getStartValue());

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java Прегледај датотеку

@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class CompareTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Compare;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Compare compare = (Compare) filter;
sh.addParameterValue(compare.getValue());

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java Прегледај датотеку

@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class IsNullTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof IsNull;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
IsNull in = (IsNull) filter;
return QueryBuilder.quote(in.getPropertyId()) + " IS NULL";

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java Прегледај датотеку

@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class LikeTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Like;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Like like = (Like) filter;
if (like.isCaseSensitive()) {

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java Прегледај датотеку

@@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class NotTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Not;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
Not not = (Not) filter;
if (not.getFilter() instanceof IsNull) {

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java Прегледај датотеку

@@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class OrTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof Or;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
return QueryBuilder.group(QueryBuilder.getJoinedFilterString(
((Or) filter).getFilters(), "OR", sh));

+ 2
- 0
src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java Прегледај датотеку

@@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;

public class SimpleStringTranslator implements FilterTranslator {

@Override
public boolean translatesFilter(Filter filter) {
return filter instanceof SimpleStringFilter;
}

@Override
public String getWhereStringForFilter(Filter filter, StatementHelper sh) {
SimpleStringFilter ssf = (SimpleStringFilter) filter;
// Create a Like filter based on the SimpleStringFilter and execute the

+ 1
- 0
src/com/vaadin/data/validator/AbstractValidator.java Прегледај датотеку

@@ -84,6 +84,7 @@ public abstract class AbstractValidator<T> implements Validator {
*/
protected abstract boolean isValidValue(T value);

@Override
public void validate(Object value) throws InvalidValueException {
// isValidType ensures that value can safely be cast to TYPE
if (!isValidType(value) || !isValidValue((T) value)) {

+ 3
- 0
src/com/vaadin/data/validator/BeanValidator.java Прегледај датотеку

@@ -67,10 +67,12 @@ public class BeanValidator implements Validator {
this.descriptor = descriptor;
}

@Override
public ConstraintDescriptor<?> getConstraintDescriptor() {
return descriptor;
}

@Override
public Object getValidatedValue() {
return value;
}
@@ -96,6 +98,7 @@ public class BeanValidator implements Validator {
*
* @see com.vaadin.data.Validator#validate(java.lang.Object)
*/
@Override
public void validate(final Object value) throws InvalidValueException {
Set<?> violations = getJavaxBeanValidator().validateValue(beanClass,
propertyName, value);

+ 1
- 0
src/com/vaadin/data/validator/CompositeValidator.java Прегледај датотеку

@@ -101,6 +101,7 @@ public class CompositeValidator implements Validator {
* @throws Validator.InvalidValueException
* if the value is not valid.
*/
@Override
public void validate(Object value) throws Validator.InvalidValueException {
switch (mode) {
case AND:

+ 1
- 0
src/com/vaadin/data/validator/NullValidator.java Прегледај датотеку

@@ -43,6 +43,7 @@ public class NullValidator implements Validator {
* @throws Validator.InvalidValueException
* if the value was invalid.
*/
@Override
public void validate(Object value) throws Validator.InvalidValueException {
if ((onlyNullAllowed && value != null)
|| (!onlyNullAllowed && value == null)) {

+ 6
- 0
src/com/vaadin/event/ActionManager.java Прегледај датотеку

@@ -75,6 +75,7 @@ public class ActionManager implements Action.Container, Action.Handler,
requestRepaint(); // this goes to the new viewer
}

@Override
public <T extends Action & Action.Listener> void addAction(T action) {
if (ownActions == null) {
ownActions = new HashSet<Action>();
@@ -84,6 +85,7 @@ public class ActionManager implements Action.Container, Action.Handler,
}
}

@Override
public <T extends Action & Action.Listener> void removeAction(T action) {
if (ownActions != null) {
if (ownActions.remove(action)) {
@@ -92,6 +94,7 @@ public class ActionManager implements Action.Container, Action.Handler,
}
}

@Override
public void addActionHandler(Handler actionHandler) {
if (actionHandler == this) {
// don't add the actionHandler to itself
@@ -109,6 +112,7 @@ public class ActionManager implements Action.Container, Action.Handler,
}
}

@Override
public void removeActionHandler(Action.Handler actionHandler) {
if (actionHandlers != null && actionHandlers.contains(actionHandler)) {

@@ -206,6 +210,7 @@ public class ActionManager implements Action.Container, Action.Handler,
}
}

@Override
public Action[] getActions(Object target, Object sender) {
HashSet<Action> actions = new HashSet<Action>();
if (ownActions != null) {
@@ -226,6 +231,7 @@ public class ActionManager implements Action.Container, Action.Handler,
return actions.toArray(new Action[actions.size()]);
}

@Override
public void handleAction(Action action, Object sender, Object target) {
if (actionHandlers != null) {
Handler[] array = actionHandlers.toArray(new Handler[actionHandlers

+ 5
- 0
src/com/vaadin/event/EventRouter.java Прегледај датотеку

@@ -35,6 +35,7 @@ public class EventRouter implements MethodEventSource {
* events generated by this component. Don't add a JavaDoc comment here, we
* use the default documentation from implemented interface.
*/
@Override
public void addListener(Class<?> eventType, Object object, Method method) {
if (listenerList == null) {
listenerList = new LinkedHashSet<ListenerMethod>();
@@ -47,6 +48,7 @@ public class EventRouter implements MethodEventSource {
* listen events generated by this component. Don't add a JavaDoc comment
* here, we use the default documentation from implemented interface.
*/
@Override
public void addListener(Class<?> eventType, Object object, String methodName) {
if (listenerList == null) {
listenerList = new LinkedHashSet<ListenerMethod>();
@@ -59,6 +61,7 @@ public class EventRouter implements MethodEventSource {
* a JavaDoc comment here, we use the default documentation from implemented
* interface.
*/
@Override
public void removeListener(Class<?> eventType, Object target) {
if (listenerList != null) {
final Iterator<ListenerMethod> i = listenerList.iterator();
@@ -77,6 +80,7 @@ public class EventRouter implements MethodEventSource {
* Don't add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public void removeListener(Class<?> eventType, Object target, Method method) {
if (listenerList != null) {
final Iterator<ListenerMethod> i = listenerList.iterator();
@@ -95,6 +99,7 @@ public class EventRouter implements MethodEventSource {
* Don't add a JavaDoc comment here, we use the default documentation from
* implemented interface.
*/
@Override
public void removeListener(Class<?> eventType, Object target,
String methodName) {


+ 4
- 2
src/com/vaadin/event/FieldEvents.java Прегледај датотеку

@@ -7,8 +7,8 @@ package com.vaadin.event;
import java.io.Serializable;
import java.lang.reflect.Method;

import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.communication.FieldRpc.FocusAndBlurServerRpc;
import com.vaadin.shared.EventId;
import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc;
import com.vaadin.tools.ReflectTools;
import com.vaadin.ui.Component;
import com.vaadin.ui.Component.Event;
@@ -261,10 +261,12 @@ public interface FieldEvents {

protected abstract void fireEvent(Event event);

@Override
public void blur() {
fireEvent(new BlurEvent(component));
}

@Override
public void focus() {
fireEvent(new FocusEvent(component));
}

+ 1
- 1
src/com/vaadin/event/ItemClickEvent.java Прегледај датотеку

@@ -9,7 +9,7 @@ import java.lang.reflect.Method;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.ui.Component;

/**

+ 2
- 2
src/com/vaadin/event/LayoutEvents.java Прегледај датотеку

@@ -7,8 +7,8 @@ import java.io.Serializable;
import java.lang.reflect.Method;

import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.shared.Connector;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.tools.ReflectTools;
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;

+ 1
- 1
src/com/vaadin/event/MouseEvents.java Прегледај датотеку

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

import java.lang.reflect.Method;

import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.tools.ReflectTools;
import com.vaadin.ui.Component;


+ 1
- 0
src/com/vaadin/event/ShortcutListener.java Прегледај датотеку

@@ -28,5 +28,6 @@ public abstract class ShortcutListener extends ShortcutAction implements
super(shorthandCaption);
}

@Override
abstract public void handleAction(Object sender, Object target);
}

+ 4
- 0
src/com/vaadin/event/TransferableImpl.java Прегледај датотеку

@@ -24,18 +24,22 @@ public class TransferableImpl implements Transferable {
this.rawVariables = rawVariables;
}

@Override
public Component getSourceComponent() {
return sourceComponent;
}

@Override
public Object getData(String dataFlavor) {
return rawVariables.get(dataFlavor);
}

@Override
public void setData(String dataFlavor, Object value) {
rawVariables.put(dataFlavor, value);
}

@Override
public Collection<String> getDataFlavors() {
return rawVariables.keySet();
}

+ 2
- 0
src/com/vaadin/event/dd/TargetDetailsImpl.java Прегледај датотеку

@@ -29,6 +29,7 @@ public class TargetDetailsImpl implements TargetDetails {
this.dropTarget = dropTarget;
}

@Override
public Object getData(String key) {
return data.get(key);
}
@@ -37,6 +38,7 @@ public class TargetDetailsImpl implements TargetDetails {
return data.put(key, value);
}

@Override
public DropTarget getTarget() {
return dropTarget;
}

+ 1
- 0
src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java Прегледај датотеку

@@ -29,6 +29,7 @@ public final class AcceptAll extends ClientSideCriterion {
return singleton;
}

@Override
public boolean accept(DragAndDropEvent dragEvent) {
return true;
}

+ 1
- 0
src/com/vaadin/event/dd/acceptcriteria/And.java Прегледај датотеку

@@ -41,6 +41,7 @@ public class And extends ClientSideCriterion {
}
}

@Override
public boolean accept(DragAndDropEvent dragEvent) {
for (ClientSideCriterion crit : criteria) {
if (!crit.accept(dragEvent)) {

+ 3
- 0
src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java Прегледај датотеку

@@ -33,10 +33,12 @@ public abstract class ClientSideCriterion implements Serializable,
* com.vaadin.event.dd.acceptCriteria.AcceptCriterion#isClientSideVerifiable
* ()
*/
@Override
public final boolean isClientSideVerifiable() {
return true;
}

@Override
public void paint(PaintTarget target) throws PaintException {
target.startTag("-ac");
target.addAttribute("name", getIdentifier());
@@ -51,6 +53,7 @@ public abstract class ClientSideCriterion implements Serializable,
return getClass().getCanonicalName();
}

@Override
public final void paintResponse(PaintTarget target) throws PaintException {
// NOP, nothing to do as this is client side verified criterion
}

+ 1
- 0
src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java Прегледај датотеку

@@ -39,6 +39,7 @@ public class ContainsDataFlavor extends ClientSideCriterion {
target.addAttribute("p", dataFlavorId);
}

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

+ 1
- 0
src/com/vaadin/event/dd/acceptcriteria/Not.java Прегледај датотеку

@@ -31,6 +31,7 @@ public class Not extends ClientSideCriterion {
acceptCriterion.paint(target);
}

@Override
public boolean accept(DragAndDropEvent dragEvent) {
return !acceptCriterion.accept(dragEvent);
}

+ 1
- 0
src/com/vaadin/event/dd/acceptcriteria/Or.java Прегледај датотеку

@@ -39,6 +39,7 @@ public class Or extends ClientSideCriterion {
}
}

@Override
public boolean accept(DragAndDropEvent dragEvent) {
for (AcceptCriterion crit : criteria) {
if (crit.accept(dragEvent)) {

+ 0
- 0
src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java Прегледај датотеку


Неке датотеке нису приказане због велике количине промена

Loading…
Откажи
Сачувај