ソースを参照

Use simple class names

tags/8.2.0.alpha2
Ahmed Ashour 6年前
コミット
d1520204ea
41個のファイルの変更136行の追加112行の削除
  1. 2
    1
      compatibility-server/src/main/java/com/vaadin/v7/data/util/BeanItem.java
  2. 1
    1
      compatibility-server/src/main/java/com/vaadin/v7/data/util/DefaultItemSorter.java
  3. 8
    6
      compatibility-server/src/main/java/com/vaadin/v7/data/util/MethodProperty.java
  4. 4
    2
      compatibility-server/src/main/java/com/vaadin/v7/data/util/MethodPropertyDescriptor.java
  5. 5
    3
      compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java
  6. 2
    1
      compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/CacheFlushNotifier.java
  7. 4
    2
      compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainer.java
  8. 2
    1
      compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java
  9. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/event/ItemClickEvent.java
  10. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java
  11. 4
    4
      compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
  12. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java
  13. 8
    8
      compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java
  14. 4
    3
      compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java
  15. 3
    3
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/handler/BasicBackwardHandler.java
  16. 3
    3
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/handler/BasicForwardHandler.java
  17. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGradient.java
  18. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java
  19. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java
  20. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java
  21. 2
    2
      compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java
  22. 3
    1
      compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/connection/MockInitialContextFactory.java
  23. 1
    1
      compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/Color.java
  24. 27
    24
      server/src/main/java/com/vaadin/event/ListenerMethod.java
  25. 2
    2
      server/src/main/java/com/vaadin/event/MethodEventSource.java
  26. 1
    1
      server/src/main/java/com/vaadin/server/LocaleService.java
  27. 1
    1
      server/src/main/java/com/vaadin/server/PaintTarget.java
  28. 4
    2
      server/src/main/java/com/vaadin/ui/ConnectorTracker.java
  29. 2
    2
      server/src/main/java/com/vaadin/ui/GridLayout.java
  30. 4
    4
      server/src/main/java/com/vaadin/ui/PopupView.java
  31. 2
    2
      server/src/main/java/com/vaadin/ui/TabSheet.java
  32. 2
    2
      server/src/main/java/com/vaadin/ui/Upload.java
  33. 4
    4
      server/src/main/java/com/vaadin/ui/Window.java
  34. 4
    3
      server/src/main/java/com/vaadin/util/ReflectTools.java
  35. 4
    2
      server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java
  36. 3
    1
      server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java
  37. 1
    1
      shared/src/main/java/com/vaadin/shared/ui/colorpicker/Color.java
  38. 1
    1
      uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java
  39. 1
    1
      uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java
  40. 2
    2
      uitest/src/main/java/com/vaadin/tests/components/table/MissingScrollbar.java
  41. 1
    1
      uitest/src/test/java/com/vaadin/tests/components/table/DisabledSortingTableTest.java

+ 2
- 1
compatibility-server/src/main/java/com/vaadin/v7/data/util/BeanItem.java ファイルの表示



package com.vaadin.v7.data.util; package com.vaadin.v7.data.util;


import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor; import java.beans.PropertyDescriptor;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Arrays; import java.util.Arrays;
pdMap.put(pd.getName(), vaadinPropertyDescriptor); pdMap.put(pd.getName(), vaadinPropertyDescriptor);
} }
} }
} catch (final java.beans.IntrospectionException ignored) {
} catch (final IntrospectionException ignored) {
} }


return pdMap; return pdMap;

+ 1
- 1
compatibility-server/src/main/java/com/vaadin/v7/data/util/DefaultItemSorter.java ファイルの表示

@Deprecated @Deprecated
public class DefaultItemSorter implements ItemSorter { public class DefaultItemSorter implements ItemSorter {


private java.lang.Object[] sortPropertyIds;
private Object[] sortPropertyIds;
private boolean[] sortDirections; private boolean[] sortDirections;
private Container container; private Container container;
private Comparator<Object> propertyValueComparator; private Comparator<Object> propertyValueComparator;

+ 8
- 6
compatibility-server/src/main/java/com/vaadin/v7/data/util/MethodProperty.java ファイルの表示

import static com.vaadin.util.ReflectTools.convertPrimitiveType; import static com.vaadin.util.ReflectTools.convertPrimitiveType;


import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Arrays; import java.util.Arrays;
private static final Object[] DEFAULT_SET_ARGS = new Object[1]; private static final Object[] DEFAULT_SET_ARGS = new Object[1];


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
out.defaultWriteObject(); out.defaultWriteObject();
SerializerHelper.writeClass(out, type); SerializerHelper.writeClass(out, type);
} }


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();
try { try {
getMethod = null; getMethod = null;
try { try {
getMethod = initGetterMethod(beanPropertyName, beanClass); getMethod = initGetterMethod(beanPropertyName, beanClass);
} catch (final java.lang.NoSuchMethodException ignored) {
} catch (final NoSuchMethodException ignored) {
throw new MethodException(this, throw new MethodException(this,
"Bean property " + beanPropertyName + " can not be found"); "Bean property " + beanPropertyName + " can not be found");
} }
try { try {
setMethod = beanClass.getMethod("set" + beanPropertyName, setMethod = beanClass.getMethod("set" + beanPropertyName,
new Class[] { returnType }); new Class[] { returnType });
} catch (final java.lang.NoSuchMethodException skipped) {
} catch (final NoSuchMethodException skipped) {
} }


// Gets the return type from get method // Gets the return type from get method
try { try {
getMethod = beanClass.getMethod("get" + propertyName, getMethod = beanClass.getMethod("get" + propertyName,
new Class[] {}); new Class[] {});
} catch (final java.lang.NoSuchMethodException ignored) {
} catch (final NoSuchMethodException ignored) {
try { try {
getMethod = beanClass.getMethod("is" + propertyName, getMethod = beanClass.getMethod("is" + propertyName,
new Class[] {}); new Class[] {});
} catch (final java.lang.NoSuchMethodException ignoredAsWell) {
} catch (final NoSuchMethodException ignoredAsWell) {
getMethod = beanClass.getMethod("are" + propertyName, getMethod = beanClass.getMethod("are" + propertyName,
new Class[] {}); new Class[] {});
} }

+ 4
- 2
compatibility-server/src/main/java/com/vaadin/v7/data/util/MethodPropertyDescriptor.java ファイルの表示

package com.vaadin.v7.data.util; package com.vaadin.v7.data.util;


import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
} }


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
out.defaultWriteObject(); out.defaultWriteObject();
SerializerHelper.writeClass(out, propertyType); SerializerHelper.writeClass(out, propertyType);
} }


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();
try { try {

+ 5
- 3
compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java ファイルの表示

import static com.vaadin.util.ReflectTools.convertPrimitiveType; import static com.vaadin.util.ReflectTools.convertPrimitiveType;


import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
private Class<? extends T> type; private Class<? extends T> type;


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
out.defaultWriteObject(); out.defaultWriteObject();
// getMethods and setMethod are reconstructed on read based on // getMethods and setMethod are reconstructed on read based on
} }


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();


simplePropertyName, propertyClass); simplePropertyName, propertyClass);
propertyClass = getter.getReturnType(); propertyClass = getter.getReturnType();
getMethods.add(getter); getMethods.add(getter);
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
throw new IllegalArgumentException("Bean property '" throw new IllegalArgumentException("Bean property '"
+ simplePropertyName + "' not found", e); + simplePropertyName + "' not found", e);
} }

+ 2
- 1
compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/CacheFlushNotifier.java ファイルの表示

package com.vaadin.v7.data.util.sqlcontainer; package com.vaadin.v7.data.util.sqlcontainer;


import java.io.Serializable; import java.io.Serializable;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue; import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.ArrayList; import java.util.ArrayList;
* Removes dead references from instance list * Removes dead references from instance list
*/ */
private static void removeDeadReferences() { private static void removeDeadReferences() {
java.lang.ref.Reference<? extends SQLContainer> dead = deadInstances
Reference<? extends SQLContainer> dead = deadInstances
.poll(); .poll();
while (dead != null) { while (dead != null) {
allInstances.remove(dead); allInstances.remove(dead);

+ 4
- 2
compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainer.java ファイルの表示

package com.vaadin.v7.data.util.sqlcontainer; package com.vaadin.v7.data.util.sqlcontainer;


import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.ResultSetMetaData; import java.sql.ResultSetMetaData;
import java.sql.SQLException; import java.sql.SQLException;
return refdCont.getItem(getReferencedItemId(itemId, refdCont)); return refdCont.getItem(getReferencedItemId(itemId, refdCont));
} }


private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
out.defaultWriteObject(); out.defaultWriteObject();
} }


private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();
if (notificationsEnabled) { if (notificationsEnabled) {

+ 2
- 1
compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java ファイルの表示

package com.vaadin.v7.data.util.sqlcontainer.connection; package com.vaadin.v7.data.util.sqlcontainer.connection;


import java.io.IOException; import java.io.IOException;
import java.io.ObjectOutputStream;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;


} }


private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
initialized = false; initialized = false;
out.defaultWriteObject(); out.defaultWriteObject();

+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/event/ItemClickEvent.java ファイルの表示

try { try {
ITEM_CLICK_METHOD = ItemClickListener.class.getDeclaredMethod( ITEM_CLICK_METHOD = ItemClickListener.class.getDeclaredMethod(
"itemClick", new Class[] { ItemClickEvent.class }); "itemClick", new Class[] { ItemClickEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException();
throw new RuntimeException();
} }
} }



+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractColorPicker.java ファイルの表示

try { try {
COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod( COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod(
"colorChanged", new Class[] { ColorChangeEvent.class }); "colorChanged", new Class[] { ColorChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in ColorPicker"); "Internal error finding methods in ColorPicker");
} }
} }

+ 4
- 4
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java ファイルの表示

VALUE_CHANGE_METHOD = Property.ValueChangeListener.class VALUE_CHANGE_METHOD = Property.ValueChangeListener.class
.getDeclaredMethod("valueChange", .getDeclaredMethod("valueChange",
new Class[] { Property.ValueChangeEvent.class }); new Class[] { Property.ValueChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in AbstractField"); "Internal error finding methods in AbstractField");
} }
} }
READ_ONLY_STATUS_CHANGE_METHOD = Property.ReadOnlyStatusChangeListener.class READ_ONLY_STATUS_CHANGE_METHOD = Property.ReadOnlyStatusChangeListener.class
.getDeclaredMethod("readOnlyStatusChange", new Class[] { .getDeclaredMethod("readOnlyStatusChange", new Class[] {
Property.ReadOnlyStatusChangeEvent.class }); Property.ReadOnlyStatusChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in AbstractField"); "Internal error finding methods in AbstractField");
} }
} }

+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/Label.java ファイルの表示

VALUE_CHANGE_METHOD = Property.ValueChangeListener.class VALUE_CHANGE_METHOD = Property.ValueChangeListener.class
.getDeclaredMethod("valueChange", .getDeclaredMethod("valueChange",
new Class[] { Property.ValueChangeEvent.class }); new Class[] { Property.ValueChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in Label"); "Internal error finding methods in Label");
} }
} }

+ 8
- 8
compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java ファイルの表示

HEADER_CLICK_METHOD = HeaderClickListener.class HEADER_CLICK_METHOD = HeaderClickListener.class
.getDeclaredMethod("headerClick", .getDeclaredMethod("headerClick",
new Class[] { HeaderClickEvent.class }); new Class[] { HeaderClickEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(e);
throw new RuntimeException(e);
} }
} }


FOOTER_CLICK_METHOD = FooterClickListener.class FOOTER_CLICK_METHOD = FooterClickListener.class
.getDeclaredMethod("footerClick", .getDeclaredMethod("footerClick",
new Class[] { FooterClickEvent.class }); new Class[] { FooterClickEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(e);
throw new RuntimeException(e);
} }
} }


COLUMN_RESIZE_METHOD = ColumnResizeListener.class COLUMN_RESIZE_METHOD = ColumnResizeListener.class
.getDeclaredMethod("columnResize", .getDeclaredMethod("columnResize",
new Class[] { ColumnResizeEvent.class }); new Class[] { ColumnResizeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(e);
throw new RuntimeException(e);
} }
} }


METHOD = ColumnReorderListener.class.getDeclaredMethod( METHOD = ColumnReorderListener.class.getDeclaredMethod(
"columnReorder", "columnReorder",
new Class[] { ColumnReorderEvent.class }); new Class[] { ColumnReorderEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(e);
throw new RuntimeException(e);
} }
} }



+ 4
- 3
compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java ファイルの表示

import java.io.OutputStream; import java.io.OutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
"uploadStarted", new Class[] { StartedEvent.class }); "uploadStarted", new Class[] { StartedEvent.class });
UPLOAD_SUCCEEDED_METHOD = SucceededListener.class.getDeclaredMethod( UPLOAD_SUCCEEDED_METHOD = SucceededListener.class.getDeclaredMethod(
"uploadSucceeded", new Class[] { SucceededEvent.class }); "uploadSucceeded", new Class[] { SucceededEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in Upload"); "Internal error finding methods in Upload");
} }
} }
} }


@Override @Override
public java.util.Collection<?> getListeners(java.lang.Class<?> eventType) {
public Collection<?> getListeners(Class<?> eventType) {
if (StreamingProgressEvent.class.isAssignableFrom(eventType)) { if (StreamingProgressEvent.class.isAssignableFrom(eventType)) {
if (progressListeners == null) { if (progressListeners == null) {
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;

+ 3
- 3
compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/handler/BasicBackwardHandler.java ファイルの表示

// set new start and end times // set new start and end times
Calendar javaCalendar = event.getComponent().getInternalCalendar(); Calendar javaCalendar = event.getComponent().getInternalCalendar();
javaCalendar.setTime(start); javaCalendar.setTime(start);
javaCalendar.add(java.util.Calendar.DATE, durationInDays);
javaCalendar.add(Calendar.DATE, durationInDays);
Date newStart = javaCalendar.getTime(); Date newStart = javaCalendar.getTime();


javaCalendar.setTime(end); javaCalendar.setTime(end);
javaCalendar.add(java.util.Calendar.DATE, durationInDays);
javaCalendar.add(Calendar.DATE, durationInDays);
Date newEnd = javaCalendar.getTime(); Date newEnd = javaCalendar.getTime();


if (start.equals(end)) { // day view if (start.equals(end)) { // day view


// we suppose that 7 >= lastDay >= firstDay >= 1 // we suppose that 7 >= lastDay >= firstDay >= 1
while (!(firstDay <= dayOfWeek && dayOfWeek <= lastDay)) { while (!(firstDay <= dayOfWeek && dayOfWeek <= lastDay)) {
javaCalendar.add(java.util.Calendar.DATE, -1);
javaCalendar.add(Calendar.DATE, -1);
dayOfWeek = javaCalendar.get(Calendar.DAY_OF_WEEK); dayOfWeek = javaCalendar.get(Calendar.DAY_OF_WEEK);
} }



+ 3
- 3
compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/handler/BasicForwardHandler.java ファイルの表示

// set new start and end times // set new start and end times
Calendar javaCalendar = Calendar.getInstance(); Calendar javaCalendar = Calendar.getInstance();
javaCalendar.setTime(start); javaCalendar.setTime(start);
javaCalendar.add(java.util.Calendar.DATE, durationInDays);
javaCalendar.add(Calendar.DATE, durationInDays);
Date newStart = javaCalendar.getTime(); Date newStart = javaCalendar.getTime();


javaCalendar.setTime(end); javaCalendar.setTime(end);
javaCalendar.add(java.util.Calendar.DATE, durationInDays);
javaCalendar.add(Calendar.DATE, durationInDays);
Date newEnd = javaCalendar.getTime(); Date newEnd = javaCalendar.getTime();


if (start.equals(end)) { // day view if (start.equals(end)) { // day view


// we suppose that 7 >= lastDay >= firstDay >= 1 // we suppose that 7 >= lastDay >= firstDay >= 1
while (!(firstDay <= dayOfWeek && dayOfWeek <= lastDay)) { while (!(firstDay <= dayOfWeek && dayOfWeek <= lastDay)) {
javaCalendar.add(java.util.Calendar.DATE, 1);
javaCalendar.add(Calendar.DATE, 1);
dayOfWeek = javaCalendar.get(Calendar.DAY_OF_WEEK); dayOfWeek = javaCalendar.get(Calendar.DAY_OF_WEEK);
} }



+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGradient.java ファイルの表示

try { try {
COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod( COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod(
"colorChanged", new Class[] { ColorChangeEvent.class }); "colorChanged", new Class[] { ColorChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in ColorPicker"); "Internal error finding methods in ColorPicker");
} }
} }

+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java ファイルの表示

try { try {
COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod( COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod(
"colorChanged", new Class[] { ColorChangeEvent.class }); "colorChanged", new Class[] { ColorChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in ColorPicker"); "Internal error finding methods in ColorPicker");
} }
} }

+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java ファイルの表示

try { try {
COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod( COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod(
"colorChanged", new Class[] { ColorChangeEvent.class }); "colorChanged", new Class[] { ColorChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in ColorPicker"); "Internal error finding methods in ColorPicker");
} }
} }

+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java ファイルの表示

try { try {
COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod( COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod(
"colorChanged", new Class[] { ColorChangeEvent.class }); "colorChanged", new Class[] { ColorChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in ColorPicker"); "Internal error finding methods in ColorPicker");
} }
} }

+ 2
- 2
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPreview.java ファイルの表示

try { try {
COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod( COLOR_CHANGE_METHOD = ColorChangeListener.class.getDeclaredMethod(
"colorChanged", new Class[] { ColorChangeEvent.class }); "colorChanged", new Class[] { ColorChangeEvent.class });
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in ColorPicker"); "Internal error finding methods in ColorPicker");
} }
} }

+ 3
- 1
compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/connection/MockInitialContextFactory.java ファイルの表示

package com.vaadin.v7.data.util.sqlcontainer.connection; package com.vaadin.v7.data.util.sqlcontainer.connection;


import java.util.Hashtable;

import javax.naming.Context; import javax.naming.Context;
import javax.naming.NamingException; import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory; import javax.naming.spi.InitialContextFactory;
} }


@Override @Override
public Context getInitialContext(java.util.Hashtable<?, ?> environment)
public Context getInitialContext(Hashtable<?, ?> environment)
throws NamingException { throws NamingException {
if (mockCtx == null) { if (mockCtx == null) {
throw new IllegalStateException("mock context was not set."); throw new IllegalStateException("mock context was not set.");

+ 1
- 1
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/Color.java ファイルの表示

red = green = blue = (int) (value * 255.0f + 0.5f); red = green = blue = (int) (value * 255.0f + 0.5f);
} else { } else {
float h = (hue - (float) Math.floor(hue)) * 6.0f; float h = (hue - (float) Math.floor(hue)) * 6.0f;
float f = h - (float) java.lang.Math.floor(h);
float f = h - (float) Math.floor(h);
float p = value * (1.0f - saturation); float p = value * (1.0f - saturation);
float q = value * (1.0f - saturation * f); float q = value * (1.0f - saturation * f);
float t = value * (1.0f - (saturation * (1.0f - f))); float t = value * (1.0f - (saturation * (1.0f - f)));

+ 27
- 24
server/src/main/java/com/vaadin/event/ListenerMethod.java ファイルの表示



import java.io.IOException; import java.io.IOException;
import java.io.NotSerializableException; import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Arrays; import java.util.Arrays;
import java.util.EventListener; import java.util.EventListener;
private int eventArgumentIndex; private int eventArgumentIndex;


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
try { try {
out.defaultWriteObject(); out.defaultWriteObject();
} }


/* Special serialization to handle method references */ /* Special serialization to handle method references */
private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();
try { try {
* eventArgumentIndex is negative, the triggering event object * eventArgumentIndex is negative, the triggering event object
* will not be passed to the trigger method, though it is still * will not be passed to the trigger method, though it is still
* called. * called.
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* if <code>method</code> is not a member of <code>target</code> * if <code>method</code> is not a member of <code>target</code>
* . * .
*/ */
public ListenerMethod(Class<?> eventType, Object target, Method method, public ListenerMethod(Class<?> eventType, Object target, Method method,
Object[] arguments, int eventArgumentIndex) Object[] arguments, int eventArgumentIndex)
throws java.lang.IllegalArgumentException {
throws IllegalArgumentException {


// Checks that the object is of correct type // Checks that the object is of correct type
if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"The method " + method.getName() "The method " + method.getName()
+ " cannot be used for the given target: " + " cannot be used for the given target: "
+ target.getClass().getName()); + target.getClass().getName());


// Checks that the event argument is null // Checks that the event argument is null
if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) { if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"argument[" + eventArgumentIndex + "] must be null"); "argument[" + eventArgumentIndex + "] must be null");
} }


if (eventArgumentIndex >= 0 if (eventArgumentIndex >= 0
&& !method.getParameterTypes()[eventArgumentIndex] && !method.getParameterTypes()[eventArgumentIndex]
.isAssignableFrom(eventType)) { .isAssignableFrom(eventType)) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"The method " + method.getName() "The method " + method.getName()
+ " does not accept the given eventType: " + " does not accept the given eventType: "
+ eventType.getName()); + eventType.getName());
* eventArgumentIndex is negative, the triggering event object * eventArgumentIndex is negative, the triggering event object
* will not be passed to the trigger method, though it is still * will not be passed to the trigger method, though it is still
* called. * called.
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* unless exactly one match <code>methodName</code> is found in * unless exactly one match <code>methodName</code> is found in
* <code>target</code>. * <code>target</code>.
*/ */
public ListenerMethod(Class<?> eventType, Object target, String methodName, public ListenerMethod(Class<?> eventType, Object target, String methodName,
Object[] arguments, int eventArgumentIndex) Object[] arguments, int eventArgumentIndex)
throws java.lang.IllegalArgumentException {
throws IllegalArgumentException {


// Finds the correct method // Finds the correct method
final Method[] methods = target.getClass().getMethods(); final Method[] methods = target.getClass().getMethods();


// Checks that the event argument is null // Checks that the event argument is null
if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) { if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"argument[" + eventArgumentIndex + "] must be null"); "argument[" + eventArgumentIndex + "] must be null");
} }


if (eventArgumentIndex >= 0 if (eventArgumentIndex >= 0
&& !method.getParameterTypes()[eventArgumentIndex] && !method.getParameterTypes()[eventArgumentIndex]
.isAssignableFrom(eventType)) { .isAssignableFrom(eventType)) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"The method " + method.getName() "The method " + method.getName()
+ " does not accept the given eventType: " + " does not accept the given eventType: "
+ eventType.getName()); + eventType.getName());
* the trigger method. * the trigger method.
* @param arguments * @param arguments
* the arguments to be passed to the trigger method. * the arguments to be passed to the trigger method.
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* if <code>method</code> is not a member of <code>target</code> * if <code>method</code> is not a member of <code>target</code>
* . * .
*/ */
public ListenerMethod(Class<?> eventType, Object target, Method method, public ListenerMethod(Class<?> eventType, Object target, Method method,
Object[] arguments) throws java.lang.IllegalArgumentException {
Object[] arguments) throws IllegalArgumentException {


// Check that the object is of correct type // Check that the object is of correct type
if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"The method " + method.getName() "The method " + method.getName()
+ " cannot be used for the given target: " + " cannot be used for the given target: "
+ target.getClass().getName()); + target.getClass().getName());
* <code>java.lang.IllegalArgumentException</code> is thrown. * <code>java.lang.IllegalArgumentException</code> is thrown.
* @param arguments * @param arguments
* the arguments to be passed to the trigger method. * the arguments to be passed to the trigger method.
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* unless exactly one match <code>methodName</code> is found in * unless exactly one match <code>methodName</code> is found in
* <code>object</code>. * <code>object</code>.
*/ */
public ListenerMethod(Class<?> eventType, Object target, String methodName, public ListenerMethod(Class<?> eventType, Object target, String methodName,
Object[] arguments) throws java.lang.IllegalArgumentException {
Object[] arguments) throws IllegalArgumentException {


// Find the correct method // Find the correct method
final Method[] methods = target.getClass().getMethods(); final Method[] methods = target.getClass().getMethods();
* the object instance that contains the trigger method. * the object instance that contains the trigger method.
* @param method * @param method
* the trigger method. * the trigger method.
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* if <code>method</code> is not a member of <code>object</code> * if <code>method</code> is not a member of <code>object</code>
* . * .
*/ */
public ListenerMethod(Class<?> eventType, Object target, Method method) public ListenerMethod(Class<?> eventType, Object target, Method method)
throws java.lang.IllegalArgumentException {
throws IllegalArgumentException {


// Checks that the object is of correct type // Checks that the object is of correct type
if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) {
throw new java.lang.IllegalArgumentException(
throw new IllegalArgumentException(
"The method " + method.getName() "The method " + method.getName()
+ " cannot be used for the given target: " + " cannot be used for the given target: "
+ target.getClass().getName()); + target.getClass().getName());
* the name of the trigger method. If the object does not contain * the name of the trigger method. If the object does not contain
* the method or it contains more than one matching methods * the method or it contains more than one matching methods
* <code>java.lang.IllegalArgumentException</code> is thrown. * <code>java.lang.IllegalArgumentException</code> is thrown.
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* unless exactly one match <code>methodName</code> is found in * unless exactly one match <code>methodName</code> is found in
* <code>target</code>. * <code>target</code>.
*/ */
public ListenerMethod(Class<?> eventType, Object target, String methodName) public ListenerMethod(Class<?> eventType, Object target, String methodName)
throws java.lang.IllegalArgumentException {
throws IllegalArgumentException {


// Finds the correct method // Finds the correct method
final Method[] methods = target.getClass().getMethods(); final Method[] methods = target.getClass().getMethods();
method.invoke(target, arguments); method.invoke(target, arguments);
} }


} catch (final java.lang.IllegalAccessException e) {
} catch (final IllegalAccessException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error - please report", e); "Internal error - please report", e);
} catch (final java.lang.reflect.InvocationTargetException e) {
} catch (final InvocationTargetException e) {
// An exception was thrown by the invocation target. Throw it // An exception was thrown by the invocation target. Throw it
// forwards. // forwards.
throw new MethodException( throw new MethodException(

+ 2
- 2
server/src/main/java/com/vaadin/event/MethodEventSource.java ファイルの表示

* @param method * @param method
* the activation method. * the activation method.
* @return a registration object for removing the listener * @return a registration object for removing the listener
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* unless <code>method</code> has exactly one match in * unless <code>method</code> has exactly one match in
* <code>object</code> * <code>object</code>
* @throws NullPointerException * @throws NullPointerException
* @param methodName * @param methodName
* the name of the activation method. * the name of the activation method.
* @return a registration object for removing the listener * @return a registration object for removing the listener
* @throws java.lang.IllegalArgumentException
* @throws IllegalArgumentException
* unless <code>method</code> has exactly one match in * unless <code>method</code> has exactly one match in
* <code>object</code> * <code>object</code>
* @throws NullPointerException * @throws NullPointerException

+ 1
- 1
server/src/main/java/com/vaadin/server/LocaleService.java ファイルの表示

/* /*
* First day of week (0 = sunday, 1 = monday) * First day of week (0 = sunday, 1 = monday)
*/ */
final java.util.Calendar cal = new GregorianCalendar(locale);
final Calendar cal = new GregorianCalendar(locale);
localeData.firstDayOfWeek = cal.getFirstDayOfWeek() - 1; localeData.firstDayOfWeek = cal.getFirstDayOfWeek() - 1;


/* /*

+ 1
- 1
server/src/main/java/com/vaadin/server/PaintTarget.java ファイルの表示

* @throws PaintException * @throws PaintException
* if the paint operation failed. * if the paint operation failed.
*/ */
public void addUIDL(java.lang.String uidl) throws PaintException;
public void addUIDL(String uidl) throws PaintException;


/** /**
* Adds text node. All the contents of the text are XML-escaped. * Adds text node. All the contents of the text are XML-escaped.

+ 4
- 2
server/src/main/java/com/vaadin/ui/ConnectorTracker.java ファイルの表示

package com.vaadin.ui; package com.vaadin.ui;


import java.io.IOException; import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
} }


/* Special serialization to JsonObjects which are not serializable */ /* Special serialization to JsonObjects which are not serializable */
private void writeObject(java.io.ObjectOutputStream out)
private void writeObject(ObjectOutputStream out)
throws IOException { throws IOException {
out.defaultWriteObject(); out.defaultWriteObject();
// Convert JsonObjects in diff state to String representation as // Convert JsonObjects in diff state to String representation as
} }


/* Special serialization to JsonObjects which are not serializable */ /* Special serialization to JsonObjects which are not serializable */
private void readObject(java.io.ObjectInputStream in)
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();



+ 2
- 2
server/src/main/java/com/vaadin/ui/GridLayout.java ファイルの表示

* @author Vaadin Ltd. * @author Vaadin Ltd.
* @since 3.0 * @since 3.0
*/ */
public class OverlapsException extends java.lang.RuntimeException {
public class OverlapsException extends RuntimeException {


private final Area existingArea; private final Area existingArea;


* @author Vaadin Ltd. * @author Vaadin Ltd.
* @since 3.0 * @since 3.0
*/ */
public class OutOfBoundsException extends java.lang.RuntimeException {
public class OutOfBoundsException extends RuntimeException {


private final Area areaOutOfBounds; private final Area areaOutOfBounds;



+ 4
- 4
server/src/main/java/com/vaadin/ui/PopupView.java ファイルの表示

POPUP_VISIBILITY_METHOD = PopupVisibilityListener.class POPUP_VISIBILITY_METHOD = PopupVisibilityListener.class
.getDeclaredMethod("popupVisibilityChange", .getDeclaredMethod("popupVisibilityChange",
PopupVisibilityEvent.class); PopupVisibilityEvent.class);
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in PopupView"); "Internal error finding methods in PopupView");
} }
} }
* @param large * @param large
* the full, Component-type representation * the full, Component-type representation
*/ */
public PopupView(final java.lang.String small, final Component large) {
public PopupView(final String small, final Component large) {
this(createContent(small, large)); this(createContent(small, large));
} }


if (visible) { if (visible) {
visibleComponent = content.getPopupComponent(); visibleComponent = content.getPopupComponent();
if (visibleComponent == null) { if (visibleComponent == null) {
throw new java.lang.IllegalStateException(
throw new IllegalStateException(
"PopupView.Content did not return Component to set visible"); "PopupView.Content did not return Component to set visible");
} }
if (visibleComponent.getParent() != null) { if (visibleComponent.getParent() != null) {

+ 2
- 2
server/src/main/java/com/vaadin/ui/TabSheet.java ファイルの表示

SELECTED_TAB_CHANGE_METHOD = SelectedTabChangeListener.class SELECTED_TAB_CHANGE_METHOD = SelectedTabChangeListener.class
.getDeclaredMethod("selectedTabChange", .getDeclaredMethod("selectedTabChange",
SelectedTabChangeEvent.class); SelectedTabChangeEvent.class);
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in TabSheet"); "Internal error finding methods in TabSheet");
} }
} }

+ 2
- 2
server/src/main/java/com/vaadin/ui/Upload.java ファイルの表示

.getDeclaredMethod("uploadStarted", StartedEvent.class); .getDeclaredMethod("uploadStarted", StartedEvent.class);
UPLOAD_SUCCEEDED_METHOD = SucceededListener.class UPLOAD_SUCCEEDED_METHOD = SucceededListener.class
.getDeclaredMethod("uploadSucceeded", SucceededEvent.class); .getDeclaredMethod("uploadSucceeded", SucceededEvent.class);
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error finding methods in Upload"); "Internal error finding methods in Upload");
} }
} }

+ 4
- 4
server/src/main/java/com/vaadin/ui/Window.java ファイルの表示

try { try {
WINDOW_CLOSE_METHOD = CloseListener.class WINDOW_CLOSE_METHOD = CloseListener.class
.getDeclaredMethod("windowClose", CloseEvent.class); .getDeclaredMethod("windowClose", CloseEvent.class);
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error, window close method not found"); "Internal error, window close method not found");
} }
} }
try { try {
WINDOW_RESIZE_METHOD = ResizeListener.class WINDOW_RESIZE_METHOD = ResizeListener.class
.getDeclaredMethod("windowResized", ResizeEvent.class); .getDeclaredMethod("windowResized", ResizeEvent.class);
} catch (final java.lang.NoSuchMethodException e) {
} catch (final NoSuchMethodException e) {
// This should never happen // This should never happen
throw new java.lang.RuntimeException(
throw new RuntimeException(
"Internal error, window resized method not found"); "Internal error, window resized method not found");
} }
} }

+ 4
- 3
server/src/main/java/com/vaadin/util/ReflectTools.java ファイルの表示

import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor; import java.beans.PropertyDescriptor;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
* If the value could not be retrieved * If the value could not be retrieved
*/ */
public static Object getJavaFieldValue(Object object, public static Object getJavaFieldValue(Object object,
java.lang.reflect.Field field) throws IllegalArgumentException,
Field field) throws IllegalArgumentException,
IllegalAccessException, InvocationTargetException { IllegalAccessException, InvocationTargetException {
PropertyDescriptor pd; PropertyDescriptor pd;
try { try {
* If the value could not be retrieved * If the value could not be retrieved
*/ */
public static Object getJavaFieldValue(Object object, public static Object getJavaFieldValue(Object object,
java.lang.reflect.Field field, Class<?> propertyType)
Field field, Class<?> propertyType)
throws IllegalArgumentException, IllegalAccessException, throws IllegalArgumentException, IllegalAccessException,
InvocationTargetException { InvocationTargetException {
PropertyDescriptor pd; PropertyDescriptor pd;
* If the value could not be assigned to the field * If the value could not be assigned to the field
*/ */
public static void setJavaFieldValue(Object object, public static void setJavaFieldValue(Object object,
java.lang.reflect.Field field, Object value)
Field field, Object value)
throws IllegalAccessException, IllegalArgumentException, throws IllegalAccessException, IllegalArgumentException,
InvocationTargetException { InvocationTargetException {
PropertyDescriptor pd; PropertyDescriptor pd;

+ 4
- 2
server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java ファイルの表示

import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;


import java.lang.reflect.Field;

import org.junit.Test; import org.junit.Test;


public class ReflectToolsGetFieldValueByTypeTest { public class ReflectToolsGetFieldValueByTypeTest {


MySubClass myInstance = new MySubClass(); MySubClass myInstance = new MySubClass();


java.lang.reflect.Field memberField;
Field memberField;
Object fieldValue = false; Object fieldValue = false;
try { try {
memberField = myInstance.getClass().getField("field"); memberField = myInstance.getClass().getField("field");


MySubClass myInstance = new MySubClass(); MySubClass myInstance = new MySubClass();


java.lang.reflect.Field memberField;
Field memberField;
try { try {
memberField = myInstance.getClass().getField("field"); memberField = myInstance.getClass().getField("field");
// Should throw an IllegalArgument exception as the mySubClass class // Should throw an IllegalArgument exception as the mySubClass class

+ 3
- 1
server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java ファイルの表示



import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;


import java.lang.reflect.Field;

import org.junit.Test; import org.junit.Test;


public class ReflectToolsGetPrimitiveFieldValueTest { public class ReflectToolsGetPrimitiveFieldValueTest {


MyClass myInstance = new MyClass(); MyClass myInstance = new MyClass();


java.lang.reflect.Field memberField;
Field memberField;
Object fieldValue = false; Object fieldValue = false;
try { try {
memberField = myInstance.getClass().getField("field"); memberField = myInstance.getClass().getField("field");

+ 1
- 1
shared/src/main/java/com/vaadin/shared/ui/colorpicker/Color.java ファイルの表示

red = green = blue = (int) (value * 255.0f + 0.5f); red = green = blue = (int) (value * 255.0f + 0.5f);
} else { } else {
float h = (hue - (float) Math.floor(hue)) * 6.0f; float h = (hue - (float) Math.floor(hue)) * 6.0f;
float f = h - (float) java.lang.Math.floor(h);
float f = h - (float) Math.floor(h);
float p = value * (1.0f - saturation); float p = value * (1.0f - saturation);
float q = value * (1.0f - saturation * f); float q = value * (1.0f - saturation * f);
float t = value * (1.0f - (saturation * (1.0f - f))); float t = value * (1.0f - (saturation * (1.0f - f)));

+ 1
- 1
uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java ファイルの表示

panelBLayout.addComponent(layoutB); panelBLayout.addComponent(layoutB);


// Create grid layout // Create grid layout
final int gridSize = (int) java.lang.Math.sqrt(componentCountC);
final int gridSize = (int) Math.sqrt(componentCountC);
VerticalLayout panelGLayout = new VerticalLayout(); VerticalLayout panelGLayout = new VerticalLayout();
panelGLayout.setMargin(true); panelGLayout.setMargin(true);
final Panel panelG = new Panel("Panel containing grid layout (" final Panel panelG = new Panel("Panel containing grid layout ("

+ 1
- 1
uitest/src/main/java/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java ファイルの表示

public class MyImageSource implements StreamResource.StreamSource { public class MyImageSource implements StreamResource.StreamSource {


/** The imagebuffer. */ /** The imagebuffer. */
private java.io.ByteArrayOutputStream imagebuffer = null;
private ByteArrayOutputStream imagebuffer;


/** The bg color. */ /** The bg color. */
private final java.awt.Color bgColor; private final java.awt.Color bgColor;

+ 2
- 2
uitest/src/main/java/com/vaadin/tests/components/table/MissingScrollbar.java ファイルの表示

package com.vaadin.tests.components.table; package com.vaadin.tests.components.table;


import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;


import com.vaadin.tests.components.TestBase; import com.vaadin.tests.components.TestBase;
return ic; return ic;
} }


private void writeObject(java.io.ObjectOutputStream out) throws Exception {

private void writeObject(ObjectOutputStream out) throws Exception {
out.defaultWriteObject(); out.defaultWriteObject();
System.out.println("Serialize " + getClass().getName() + "(" System.out.println("Serialize " + getClass().getName() + "("
+ (this instanceof Serializable) + ")"); + (this instanceof Serializable) + ")");

+ 1
- 1
uitest/src/test/java/com/vaadin/tests/components/table/DisabledSortingTableTest.java ファイルの表示

Class<?> uiClass; Class<?> uiClass;


@Override @Override
protected java.lang.Class<?> getUIClass() {
protected Class<?> getUIClass() {
return uiClass; return uiClass;
}; };



読み込み中…
キャンセル
保存