Also includes some other minor cleanup.
* the id of the application to get configuration data for
* @return a native javascript object containing the configuration data
*/
- private native static JsoConfiguration getJsoConfiguration(String appId)
+ private static native JsoConfiguration getJsoConfiguration(String appId)
/*-{
return $wnd.vaadin.getApp(appId);
}-*/;
* @param widgetsetName
* the name of this widgetset
*/
- public native static void registerCallback(String widgetsetName)
+ public static native void registerCallback(String widgetsetName)
/*-{
var callbackHandler = $entry(@com.vaadin.client.ApplicationConfiguration::startApplication(Ljava/lang/String;));
$wnd.vaadin.registerWidgetset(widgetsetName, callbackHandler);
return !isDebugAvailable();
}
- private native static boolean isDebugAvailable()
+ private static native boolean isDebugAvailable()
/*-{
if($wnd.vaadin.debug) {
return true;
}
}
- public static abstract class ApplicationConnectionEvent
+ public abstract static class ApplicationConnectionEvent
extends GwtEvent<CommunicationHandler> {
private ApplicationConnection connection;
return browserDetails.isOpera() && getBrowserMajorVersion() == 11;
}
- public native static String getBrowserString()
+ public static native String getBrowserString()
/*-{
return $wnd.navigator.userAgent;
}-*/;
* element of the connector whose id is desired
* @return the id of the element's connector, if it's a connector
*/
- native static final String getConnectorId(Element el)
+ static final native String getConnectorId(Element el)
/*-{
return el.tkPid;
}-*/;
import com.google.gwt.dom.client.Element;
public class MeasuredSize {
- private final static boolean debugSizeChanges = false;
+ private static final boolean debugSizeChanges = false;
public static class MeasureResult {
private final boolean widthChanged;
return RELATIVE_TIME_SUPPLIER.getRelativeTime();
}
- private static native final void logGwtEvent(String name, String type)
+ private static final native void logGwtEvent(String name, String type)
/*-{
$wnd.__gwtStatsEvent({
evtGroup: @com.vaadin.client.Profiler::evtGroup,
+ ".nocache.js";
}
- private native static String getRecompileParameters(String moduleName)
+ private static native String getRecompileParameters(String moduleName)
/*-{
var prop_map = $wnd.__gwt_activeModules[moduleName].bindings();
return isSuperDevModeEnabledInModule(moduleName);
}
- protected native static boolean isSuperDevModeEnabledInModule(
+ protected static native boolean isSuperDevModeEnabledInModule(
String moduleName)
/*-{
if (!$wnd.__gwt_activeModules)
* @deprecated should not be used anymore
*/
@Deprecated
- public final static class XML extends JavaScriptObject {
+ public static final class XML extends JavaScriptObject {
protected XML() {
}
* a JavaScript object to be converted to a string
* @return JSON in string representation
*/
- private native static String stringify(JavaScriptObject json)
+ private static native String stringify(JavaScriptObject json)
/*-{
return JSON.stringify(json);
}-*/;
* @param jsonAsString
* @return a JavaScript object constructed from the parse
*/
- public native static <T extends JavaScriptObject> T parse(
+ public static native <T extends JavaScriptObject> T parse(
String jsonAsString)
/*-{
return JSON.parse(jsonAsString);
return getOwnerPid(e);
}
- private native static void setOwnerPid(Element el, String pid)
+ private static native void setOwnerPid(Element el, String pid)
/*-{
el.vOwnerPid = pid;
}-*/;
- public native static String getOwnerPid(Element el)
+ public static native String getOwnerPid(Element el)
/*-{
return el.vOwnerPid;
}-*/;
*
* @return The active element or null if no active element could be found.
*/
- public native static Element getFocusedElement()
+ public static native Element getFocusedElement()
/*-{
if ($wnd.document.activeElement) {
return $wnd.document.activeElement;
*
* @since 7.3
*/
- public native static void setSelectionRange(Element elem, int pos,
+ public static native void setSelectionRange(Element elem, int pos,
int length, String direction)
/*-{
try {
* <code>true</code> if selection is enabled; <code>false</code>
* if not
*/
- public native static void setTextSelectionEnabled(Element e, boolean enable)
+ public static native void setTextSelectionEnabled(Element e, boolean enable)
/*-{
if (!enable) {
e.ondrag = function () { return false; };
*
* @since 7.6
*/
- public native static void clearTextSelection()
+ public static native void clearTextSelection()
/*-{
if ($wnd.getSelection) {
$wnd.getSelection().removeAllRanges();
getConnectionStateHandler().pushReconnectPending(this);
}
- public static abstract class AbstractJSO extends JavaScriptObject {
+ public abstract static class AbstractJSO extends JavaScriptObject {
protected AbstractJSO() {
-
}
protected final native String getStringValue(String key)
}
}
- private static native final int calculateBootstrapTime()
+ private static final native int calculateBootstrapTime()
/*-{
if ($wnd.performance && $wnd.performance.timing) {
return (new Date).getTime() - $wnd.performance.timing.responseStart;
* the JavaScript object to check
* @return true if the property is defined
*/
- private static native final boolean isInJson(String property,
+ private static final native boolean isInJson(String property,
JavaScriptObject target)
/*-{
var segments = property.split('.');
* Path is of type "targetWidgetPath#componentPart" or
* "targetWidgetPath".
*/
- String parts[] = path.split(LegacyLocatorStrategy.SUBPART_SEPARATOR, 2);
+ String[] parts = path.split(LegacyLocatorStrategy.SUBPART_SEPARATOR, 2);
String widgetPath = parts[0];
// Note that this only works if baseElement can be mapped to a
* if the element could not be found.
*/
private Element getElementByDOMPath(Element baseElement, String path) {
- String parts[] = path.split(PARENTCHILD_SEPARATOR);
+ String[] parts = path.split(PARENTCHILD_SEPARATOR);
Element element = baseElement;
for (int i = 0, l = parts.length; i < l; ++i) {
@SuppressWarnings("unchecked")
private Widget getWidgetFromPath(String path, Widget baseWidget) {
Widget w = baseWidget;
- String parts[] = path.split(PARENTCHILD_SEPARATOR);
+ String[] parts = path.split(PARENTCHILD_SEPARATOR);
for (int i = 0; i < parts.length; i++) {
String part = parts[i];
@Connect(com.vaadin.ui.Grid.Column.class)
public class ColumnConnector extends AbstractExtensionConnector {
- public static abstract class CustomColumn
+ public abstract static class CustomColumn
extends Column<Object, JsonObject> {
private final String connectorId;
* @return a non-null object that uniquely and consistently represents the
* row object
*/
- abstract public Object getRowKey(T row);
+ public abstract Object getRowKey(T row);
@Override
public int size() {
* This simple approach rules out more advanced heuristics that would take
* the current scrolling direction or past scrolling behavior into account.
*/
- public static abstract class AbstractBasicSymmetricalCacheStrategy
+ public abstract static class AbstractBasicSymmetricalCacheStrategy
implements CacheStrategy {
@Override
return isPrimary(getNativeEvent());
}
- private static native final int getPointerId(NativeEvent e)
+ private static final native int getPointerId(NativeEvent e)
/*-{
return e.pointerId;
}-*/;
- private static native final int getWidth(NativeEvent e)
+ private static final native int getWidth(NativeEvent e)
/*-{
return e.width;
}-*/;
- private static native final int getHeight(NativeEvent e)
+ private static final native int getHeight(NativeEvent e)
/*-{
return e.height;
}-*/;
- private static native final double getPressure(NativeEvent e)
+ private static final native double getPressure(NativeEvent e)
/*-{
return e.pressure;
}-*/;
- private static native final double getTiltX(NativeEvent e)
+ private static final native double getTiltX(NativeEvent e)
/*-{
return e.tiltX;
}-*/;
- private static native final double getTiltY(NativeEvent e)
+ private static final native double getTiltY(NativeEvent e)
/*-{
return e.tiltY;
}-*/;
- private static native final String getPointerType(NativeEvent e)
+ private static final native String getPointerType(NativeEvent e)
/*-{
var pointerType = e.pointerType;
if (typeof pointerType === "number") {
return pointerType || "";
}-*/;
- private static native final boolean isPrimary(NativeEvent e)
+ private static final native boolean isPrimary(NativeEvent e)
/*-{
return e.isPrimary;
}-*/;
return cellReference;
}
- private native static Escalator getEscalator(Grid<?> grid)
+ private static native Escalator getEscalator(Grid<?> grid)
/*-{
return grid.@com.vaadin.client.widgets.Grid::escalator;
}-*/;
return (TableCellElement) element;
}
- private native static RowReference<Object> getRowReference(
+ private static native RowReference<Object> getRowReference(
RendererCellReference cell) /*-{
return cell.@com.vaadin.client.widget.grid.CellReference::getRowReference()();
}-*/;
- private native static FlyweightCell getFlyweightCell(
+ private static native FlyweightCell getFlyweightCell(
RendererCellReference cell) /*-{
return cell.@com.vaadin.client.widget.grid.RendererCellReference::cell;
}-*/;
private void setLabel() {
if (getDateField() instanceof VAbstractPopupCalendar) {
- ((VAbstractPopupCalendar) getDateField()).setFocusedDate(this);
+ ((VAbstractPopupCalendar<?, ?>) getDateField()).setFocusedDate(this);
}
}
}
*
* @since 7.5.1
*/
- abstract protected void startResize();
+ protected abstract void startResize();
/**
* Called when stopping drag resize
*
* @since 7.5.1
*/
- abstract protected void stopResize();
+ protected abstract void stopResize();
/**
* Gets the first container
return false;
}
- protected final static int NONE = 0;
- protected final static int COMPONENT = 1;
- protected final static int WRAPPER = 2;
- protected final static int HTML5 = 3;
- protected final static int COMPONENT_OTHER = 4;
+ protected static final int NONE = 0;
+ protected static final int COMPONENT = 1;
+ protected static final int WRAPPER = 2;
+ protected static final int HTML5 = 3;
+ protected static final int COMPONENT_OTHER = 4;
/** For internal use only. May be removed or replaced in the future. */
public int dragStartMode;
*/
public class VFormLayout extends SimplePanel {
- private final static String CLASSNAME = "v-formlayout";
+ private static final String CLASSNAME = "v-formlayout";
/** For internal use only. May be removed or replaced in the future. */
public VFormLayoutTable table;
}
return handler;
}
- }// class CustomPopup
+ }
public HandlerRegistration addVisibilityChangeHandler(
final VisibilityChangeHandler visibilityChangeHandler) {
return popupShowInProgress;
}
-}// class VPopupView
+}
connection.flushActiveConnector();
}
- private native static void loadAppIdListFromDOM(List<String> list)
+ private static native void loadAppIdListFromDOM(List<String> list)
/*-{
var j;
for(j in $wnd.vaadin.vaadinConfigurations) {
// as it is added directly to the child component?
String[] cssRules = css.split(";");
for (String cssRule : cssRules) {
- String parts[] = cssRule.split(":", 2);
+ String[] parts = cssRule.split(":", 2);
if (parts.length == 2) {
style.setProperty(makeCamelCase(parts[0].trim()),
parts[1].trim());
*
* @param drag
*/
- abstract protected void dragAccepted(VDragEvent drag);
+ protected abstract void dragAccepted(VDragEvent drag);
protected void validate(final VAcceptCallback cb, final VDragEvent event) {
Command checkCriteria = new Command() {
*/
@Deprecated
@AcceptCriterion(AcceptAll.class)
-final public class VAcceptAll extends VAcceptCriterion {
+public final class VAcceptAll extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
*/
@Deprecated
@AcceptCriterion(And.class)
-final public class VAnd extends VAcceptCriterion implements VAcceptCallback {
+public final class VAnd extends VAcceptCriterion implements VAcceptCallback {
private boolean b1;
static VAcceptCriterion getCriteria(VDragEvent drag, UIDL configuration,
*/
@Deprecated
@AcceptCriterion(ContainsDataFlavor.class)
-final public class VContainsDataFlavor extends VAcceptCriterion {
+public final class VContainsDataFlavor extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
*/
@Deprecated
@AcceptCriterion(SourceIs.class)
-final public class VDragSourceIs extends VAcceptCriterion {
+public final class VDragSourceIs extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
protected VHtml5File() {
}
- public native final String getName()
+ public final native String getName()
/*-{
return this.name;
}-*/;
- public native final String getType()
+ public final native String getType()
/*-{
return this.type;
}-*/;
* and then cast back to a long value.
* www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html#important
*/
- public native final double getSize()
+ public final native double getSize()
/*-{
return this.size ? this.size : 0;
}-*/;
* and extending classes
*/
@Deprecated
-final public class VOverTreeNode extends VAcceptCriterion {
+public final class VOverTreeNode extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
itr = iteratorStack.pop();
currentMenu = menuStack.pop();
}
- } // while
+ }
getLayoutManager().setNeedsHorizontalLayout(this);
-
- }// updateFromUIDL
+ }
@Override
public VMenuBar getWidget() {
*
* @see VerticalScrollbarBundle#getElement()
*/
- public final static class VerticalScrollbarBundle extends ScrollbarBundle {
+ public static final class VerticalScrollbarBundle extends ScrollbarBundle {
@Override
public void setStylePrimaryName(String primaryStyleName) {
*
* @see HorizontalScrollbarBundle#getElement()
*/
- public final static class HorizontalScrollbarBundle
+ public static final class HorizontalScrollbarBundle
extends ScrollbarBundle {
@Override
/**
* Handler type.
*/
- public final static Type<RowHeightChangedHandler> TYPE = new Type<>();
+ public static final Type<RowHeightChangedHandler> TYPE = new Type<>();
public static final Type<RowHeightChangedHandler> getType() {
return TYPE;
/**
* Handler type.
*/
- private final static Type<ColumnReorderHandler<?>> TYPE = new Type<>();
+ private static final Type<ColumnReorderHandler<?>> TYPE = new Type<>();
public static final Type<ColumnReorderHandler<?>> getType() {
return TYPE;
/**
* Handler type.
*/
- private final static Type<ColumnResizeHandler<?>> TYPE = new Type<>();
+ private static final Type<ColumnResizeHandler<?>> TYPE = new Type<>();
private Column<?, T> column;
public class ColumnVisibilityChangeEvent<T>
extends GwtEvent<ColumnVisibilityChangeHandler<T>> {
- private final static Type<ColumnVisibilityChangeHandler<?>> TYPE = new Type<>();
+ private static final Type<ColumnVisibilityChangeHandler<?>> TYPE = new Type<>();
public static final Type<ColumnVisibilityChangeHandler<?>> getType() {
return TYPE;
* {@link com.google.gwt.dom.client.NativeEvent NativeEvent} isn't
* properly populated with the correct values.
*/
- private final static class CustomTouchEvent
+ private static final class CustomTouchEvent
extends JavaScriptObject {
protected CustomTouchEvent() {
}
return elem;
}
- abstract protected void recalculateSectionHeight();
+ protected abstract void recalculateSectionHeight();
/**
* Returns the height of all rows in the row container.
* @return <code>true</code> iff this the given element, or any of its
* descendants, can be frozen
*/
- abstract protected boolean rowCanBeFrozen(TableRowElement tr);
+ protected abstract boolean rowCanBeFrozen(TableRowElement tr);
/**
* Iterates through all the cells in a column and returns the width of
}
}
- public static abstract class AbstractGridKeyEvent<HANDLER extends AbstractGridKeyEventHandler>
+ public abstract static class AbstractGridKeyEvent<HANDLER extends AbstractGridKeyEventHandler>
extends KeyEvent<HANDLER> {
/**
protected abstract void doDispatch(HANDLER handler, Section section);
}
- public static abstract class AbstractGridMouseEvent<HANDLER extends AbstractGridMouseEventHandler>
+ public abstract static class AbstractGridMouseEvent<HANDLER extends AbstractGridMouseEventHandler>
extends MouseEvent<HANDLER> {
/**
* @param parent
* The parent to set
*/
- private static native final void setParent(Widget widget, Grid<?> parent)
+ private static final native void setParent(Widget widget, Grid<?> parent)
/*-{
widget.@com.google.gwt.user.client.ui.Widget::setParent(Lcom/google/gwt/user/client/ui/Widget;)(parent);
}-*/;
- private static native final void onAttach(Widget widget)
+ private static final native void onAttach(Widget widget)
/*-{
widget.@Widget::onAttach()();
}-*/;
- private static native final void onDetach(Widget widget)
+ private static final native void onDetach(Widget widget)
/*-{
widget.@Widget::onDetach()();
}-*/;
return topFix;
}
- private native static int detectRelativeBodyFixes(String axis)
+ private static native int detectRelativeBodyFixes(String axis)
/*-{
try {
var b = $wnd.document.body;
return cellReference;
}
- private native static Escalator getEscalator(Grid<?> grid)
+ private static native Escalator getEscalator(Grid<?> grid)
/*-{
return grid.@com.vaadin.v7.client.widgets.Grid::escalator;
}-*/;
void contextMenu(ContextMenuEvent event, Widget widget);
}
- private static abstract class AbstractEventComparator
+ private abstract static class AbstractEventComparator
implements Comparator<CalendarEvent> {
@Override
// Ctrl and Shift selection not supported
if (ctrl || shift) {
return false;
- }
-
- else if (keycode == getPreviousKey()) {
+ } else if (keycode == getPreviousKey()) {
focusNextYear(10); // Add 10 years
return true;
- }
-
- else if (keycode == getForwardKey()) {
+ } else if (keycode == getForwardKey()) {
focusNextYear(1); // Add 1 year
return true;
- }
-
- else if (keycode == getNextKey()) {
+ } else if (keycode == getNextKey()) {
focusPreviousYear(10); // Subtract 10 years
return true;
- }
-
- else if (keycode == getBackwardKey()) {
+ } else if (keycode == getBackwardKey()) {
focusPreviousYear(1); // Subtract 1 year
return true;
-
} else if (keycode == getSelectKey()) {
value = (Date) focusedDate.clone();
onSubmit();
return true;
-
} else if (keycode == getResetKey()) {
// Restore showing value the selected value
focusedDate.setTime(value.getTime());
renderCalendar();
return true;
-
} else if (keycode == getCloseKey()) {
// TODO fire listener, on users responsibility??
boolean shift) {
if (!isEnabled() || isReadonly()) {
return false;
- }
-
- else if (resolution == Resolution.YEAR) {
+ } else if (resolution == Resolution.YEAR) {
return handleNavigationYearMode(keycode, ctrl, shift);
- }
-
- else if (resolution == Resolution.MONTH) {
+ } else if (resolution == Resolution.MONTH) {
return handleNavigationMonthMode(keycode, ctrl, shift);
- }
-
- else if (resolution == Resolution.DAY) {
+ } else if (resolution == Resolution.DAY) {
return handleNavigationDayMode(keycode, ctrl, shift);
- }
-
- else {
+ } else {
return handleNavigationDayMode(keycode, ctrl, shift);
}
-
}
/**
import com.vaadin.v7.ui.AbstractSelect;
@AcceptCriterion(AbstractSelect.TargetItemIs.class)
-final public class VIsOverId extends VAcceptCriterion {
+public final class VIsOverId extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
import com.vaadin.v7.ui.AbstractSelect;
@AcceptCriterion(AbstractSelect.AcceptItem.class)
-final public class VItemIdIs extends VAcceptCriterion {
+public final class VItemIdIs extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
import com.vaadin.v7.ui.Tree;
@AcceptCriterion(Tree.TargetInSubtree.class)
-final public class VTargetInSubtree extends VAcceptCriterion {
+public final class VTargetInSubtree extends VAcceptCriterion {
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
*
* @see VerticalScrollbarBundle#getElement()
*/
- public final static class VerticalScrollbarBundle extends ScrollbarBundle {
+ public static final class VerticalScrollbarBundle extends ScrollbarBundle {
@Override
public void setStylePrimaryName(String primaryStyleName) {
*
* @see HorizontalScrollbarBundle#getElement()
*/
- public final static class HorizontalScrollbarBundle
+ public static final class HorizontalScrollbarBundle
extends ScrollbarBundle {
@Override
/**
* Handler type.
*/
- public final static Type<RowHeightChangedHandler> TYPE = new Type<RowHeightChangedHandler>();
+ public static final Type<RowHeightChangedHandler> TYPE = new Type<RowHeightChangedHandler>();
public static final Type<RowHeightChangedHandler> getType() {
return TYPE;
/**
* Handler type.
*/
- private final static Type<ColumnReorderHandler<?>> TYPE = new Type<ColumnReorderHandler<?>>();
+ private static final Type<ColumnReorderHandler<?>> TYPE = new Type<ColumnReorderHandler<?>>();
public static final Type<ColumnReorderHandler<?>> getType() {
return TYPE;
/**
* Handler type.
*/
- private final static Type<ColumnResizeHandler<?>> TYPE = new Type<ColumnResizeHandler<?>>();
+ private static final Type<ColumnResizeHandler<?>> TYPE = new Type<ColumnResizeHandler<?>>();
private Column<?, T> column;
public class ColumnVisibilityChangeEvent<T>
extends GwtEvent<ColumnVisibilityChangeHandler<T>> {
- private final static Type<ColumnVisibilityChangeHandler<?>> TYPE = new Type<ColumnVisibilityChangeHandler<?>>();
+ private static final Type<ColumnVisibilityChangeHandler<?>> TYPE = new Type<ColumnVisibilityChangeHandler<?>>();
public static final Type<ColumnVisibilityChangeHandler<?>> getType() {
return TYPE;
/**
* Handler type.
*/
- private final static Type<SelectAllHandler<?>> TYPE = new Type<SelectAllHandler<?>>();;
+ private static final Type<SelectAllHandler<?>> TYPE = new Type<SelectAllHandler<?>>();;
private SelectionModel.Multi<T> selectionModel;
* {@link com.google.gwt.dom.client.NativeEvent NativeEvent} isn't
* properly populated with the correct values.
*/
- private final static class CustomTouchEvent
+ private static final class CustomTouchEvent
extends JavaScriptObject {
protected CustomTouchEvent() {
}
return elem;
}
- abstract protected void recalculateSectionHeight();
+ protected abstract void recalculateSectionHeight();
/**
* Returns the height of all rows in the row container.
* @return <code>true</code> iff this the given element, or any of its
* descendants, can be frozen
*/
- abstract protected boolean rowCanBeFrozen(TableRowElement tr);
+ protected abstract boolean rowCanBeFrozen(TableRowElement tr);
/**
* Iterates through all the cells in a column and returns the width of
}
}
- public static abstract class AbstractGridKeyEvent<HANDLER extends AbstractGridKeyEventHandler>
+ public abstract static class AbstractGridKeyEvent<HANDLER extends AbstractGridKeyEventHandler>
extends KeyEvent<HANDLER> {
/**
protected abstract void doDispatch(HANDLER handler, Section section);
}
- public static abstract class AbstractGridMouseEvent<HANDLER extends AbstractGridMouseEventHandler>
+ public abstract static class AbstractGridMouseEvent<HANDLER extends AbstractGridMouseEventHandler>
extends MouseEvent<HANDLER> {
/**
* @param <T>
* the row type
*/
- public static abstract class Column<C, T> {
+ public abstract static class Column<C, T> {
/**
* Default renderer for GridColumns. Renders everything into text
* @param parent
* The parent to set
*/
- private static native final void setParent(Widget widget, Grid<?> parent)
+ private static final native void setParent(Widget widget, Grid<?> parent)
/*-{
widget.@com.google.gwt.user.client.ui.Widget::setParent(Lcom/google/gwt/user/client/ui/Widget;)(parent);
}-*/;
- private static native final void onAttach(Widget widget)
+ private static final native void onAttach(Widget widget)
/*-{
widget.@Widget::onAttach()();
}-*/;
- private static native final void onDetach(Widget widget)
+ private static final native void onDetach(Widget widget)
/*-{
widget.@Widget::onDetach()();
}-*/;
}
}
- private static abstract class BaseItemAddOrRemoveEvent extends EventObject
+ private abstract static class BaseItemAddOrRemoveEvent extends EventObject
implements Serializable {
protected Object itemId;
protected int index;
*/
public static Collection<String> FILE_PROPERTIES;
- private final static Method FILEITEM_LASTMODIFIED;
+ private static final Method FILEITEM_LASTMODIFIED;
- private final static Method FILEITEM_NAME;
+ private static final Method FILEITEM_NAME;
- private final static Method FILEITEM_ICON;
+ private static final Method FILEITEM_ICON;
- private final static Method FILEITEM_SIZE;
+ private static final Method FILEITEM_SIZE;
static {
* datasource.
* @return
*/
- abstract public String format(T value);
+ public abstract String format(T value);
/**
* Parse string and convert it to format compatible with datasource.
* Any type of exception can be thrown to indicate that the
* conversion was not succesful.
*/
- abstract public T parse(String formattedValue) throws Exception;
+ public abstract T parse(String formattedValue) throws Exception;
/**
* Sets the Property's read-only mode to the specified status.
: new InputStreamReader(fis, charset);
BufferedReader r = new BufferedReader(isr);
StringBuilder b = new StringBuilder();
- char buf[] = new char[8 * 1024];
+ char[] buf = new char[8 * 1024];
int len;
while ((len = r.read(buf)) != -1) {
b.append(buf, 0, len);
@Deprecated
public class DefaultConverterFactory implements ConverterFactory {
- private final static Logger log = Logger
+ private static final Logger log = Logger
.getLogger(DefaultConverterFactory.class.getName());
@Override
* @deprecated As of 8.0, no replacement available.
*/
@Deprecated
-final public class ColumnProperty implements Property {
+public final class ColumnProperty implements Property {
private static final long serialVersionUID = -3694463129581802457L;
private RowItem owner;
@Override
public Object addItem() throws UnsupportedOperationException {
- Object emptyKey[] = new Object[queryDelegate.getPrimaryKeyColumns()
+ Object[] emptyKey = new Object[queryDelegate.getPrimaryKeyColumns()
.size()];
RowId itemId = new TemporaryRowId(emptyKey);
// Create new empty column properties for the row item.
addFilterTranslator(new SimpleStringTranslator());
}
- public synchronized static void addFilterTranslator(
+ public static synchronized void addFilterTranslator(
FilterTranslator translator) {
filterTranslators.add(translator);
}
* the statement helper to update with the value(s) of the filter
* @return a string representing the filter.
*/
- public synchronized static String getWhereStringForFilter(Filter filter,
+ public static synchronized String getWhereStringForFilter(Filter filter,
StatementHelper sh) {
for (FilterTranslator ft : filterTranslators) {
if (ft.translatesFilter(filter)) {
* @since 6.5
*/
@Deprecated
- public static abstract class TextChangeEvent extends Component.Event {
+ public abstract static class TextChangeEvent extends Component.Event {
public TextChangeEvent(Component source) {
super(source);
* Sets the default styles of the component
*
*/
- abstract protected void setDefaultStyles();
+ protected abstract void setDefaultStyles();
/**
* Shows a popup-window for color selection.
* @since 6.3
*
*/
- private static abstract class AbstractItemSetCriterion
+ private abstract static class AbstractItemSetCriterion
extends ClientSideCriterion {
protected final Collection<Object> itemIds = new HashSet<Object>();
protected AbstractSelect select;
* @since 7.6.1
*/
@Deprecated
- public final static class DetailComponentManager
+ public static final class DetailComponentManager
extends AbstractGridExtension implements DataGenerator {
/**
* Base class for editor related events
*/
@Deprecated
- public static abstract class EditorEvent extends Component.Event {
+ public abstract static class EditorEvent extends Component.Event {
private Object itemID;
* reusable.
*/
@Deprecated
- public static abstract class AbstractSelectionModel extends
+ public abstract static class AbstractSelectionModel extends
AbstractGridExtension implements SelectionModel, DataGenerator {
protected final LinkedHashSet<Object> selection = new LinkedHashSet<Object>();
}
}
- abstract protected String getCellTagName();
+ protected abstract String getCellTagName();
void detach() {
for (CELLTYPE cell : cells.values()) {
* the type this renderer knows how to present
*/
@Deprecated
- public static abstract class AbstractRenderer<T>
+ public abstract static class AbstractRenderer<T>
extends AbstractGridExtension implements Renderer<T> {
private final Class<T> presentationType;
* @since 7.5
*/
@Deprecated
- public static abstract class AbstractGridExtension
+ public abstract static class AbstractGridExtension
extends AbstractExtension {
/**
* during that drag and drop operation.
*/
@Deprecated
- public static abstract class TableDropCriterion
+ public abstract static class TableDropCriterion
extends ServerSideCriterion {
private Table table;
* during that drag and drop operation.
*/
@Deprecated
- public static abstract class TreeDropCriterion extends ServerSideCriterion {
+ public abstract static class TreeDropCriterion extends ServerSideCriterion {
private Tree tree;
public class BeanItemContainerGenerator {
public static class PortableRandom {
- private final static long multiplier = 0x5DEECE66DL;
- private final static long addend = 0xBL;
- private final static long mask = (1L << 48) - 1;
+ private static final long multiplier = 0x5DEECE66DL;
+ private static final long addend = 0xBL;
+ private static final long mask = (1L << 48) - 1;
private AtomicLong seed;
public PortableRandom(long seed) {
public class PerformanceTestIndexedContainerTest {
private static final int REPEATS = 10;
- private final static int ITEMS = 50000;
+ private static final int ITEMS = 50000;
private static final long ADD_ITEM_FAIL_THRESHOLD = 200;
// TODO should improve performance of these methods
private static final long ADD_ITEM_AT_FAIL_THRESHOLD = 5000;
*/
public class ContextClickListenerTest extends AbstractComponent {
- private final static ContextClickEvent contextClickEvent = EasyMock
+ private static final ContextClickEvent contextClickEvent = EasyMock
.createMock(ContextClickEvent.class);
- private final static GridContextClickEvent gridContextClickEvent = EasyMock
+ private static final GridContextClickEvent gridContextClickEvent = EasyMock
.createMock(GridContextClickEvent.class);
- private final static TableContextClickEvent tableContextClickEvent = EasyMock
+ private static final TableContextClickEvent tableContextClickEvent = EasyMock
.createMock(TableContextClickEvent.class);
private final AssertListener contextListener = new AssertListener();
* @since 8.1
*
*/
- protected DataKeyMapper<T> createKeyMapper(ValueProvider<T,Object> identifierGetter) {
+ protected DataKeyMapper<T> createKeyMapper(ValueProvider<T, Object> identifierGetter) {
return new KeyMapper<T>(identifierGetter);
}
public void blur(BlurEvent event);
}
- public static abstract class FocusAndBlurServerRpcImpl
+ public abstract static class FocusAndBlurServerRpcImpl
implements FocusAndBlurServerRpc {
private final Component component;
}
@Override
- abstract public void handleAction(Object sender, Object target);
+ public abstract void handleAction(Object sender, Object target);
}
*/
public class Or extends ClientSideCriterion {
private static final long serialVersionUID = 1L;
- private final AcceptCriterion criteria[];
+ private final AcceptCriterion[] criteria;
/**
* @param criteria
@SuppressWarnings({ "serial", "deprecation" })
public class ComponentSizeValidator implements Serializable {
- private final static int LAYERS_SHOWN = 4;
+ private static final int LAYERS_SHOWN = 4;
/**
* Recursively checks given component and its subtree for invalid layout
/* Document type declarations */
- private final static String UIDL_ARG_NAME = "name";
+ private static final String UIDL_ARG_NAME = "name";
private final Deque<String> mOpenTags;
* @return A new string instance where all occurrences of XML sensitive
* characters are substituted with entities.
*/
- static public String escapeXML(String xml) {
+ public static String escapeXML(String xml) {
if (xml == null || xml.length() <= 0) {
return "";
}
* The string to escape
* @return Escaped version of the string
*/
- static public String escapeJSON(String s) {
+ public static String escapeJSON(String s) {
// FIXME: Move this method to another class as other classes use it
// also.
if (s == null) {
* Base class for portlet requests that need access to HTTP servlet
* requests.
*/
- public static abstract class VaadinHttpAndPortletRequest
+ public abstract static class VaadinHttpAndPortletRequest
extends VaadinPortletRequest {
/**
private void streamContent(HttpServletResponse response, InputStream is)
throws IOException {
final OutputStream os = response.getOutputStream();
- final byte buffer[] = new byte[DEFAULT_BUFFER_SIZE];
+ final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
int bytes;
while ((bytes = is.read(buffer)) >= 0) {
os.write(buffer, 0, bytes);
"The multipart stream ended unexpectedly");
}
bout.write(readByte);
- if(bout.size() > MULTIPART_BOUNDARY_LINE_LIMIT) {
+ if (bout.size() > MULTIPART_BOUNDARY_LINE_LIMIT) {
throw new IOException(
"The multipart stream does not contain boundary");
}
throw new NoInputStreamException();
}
- final byte buffer[] = new byte[MAX_UPLOAD_BUFFER_SIZE];
+ final byte[] buffer = new byte[MAX_UPLOAD_BUFFER_SIZE];
long lastStreamingEvent = 0;
int bytesReadToBuffer = 0;
do {
// We don't want to use callWithUi here, as it assumes there's a client
// request active and does requestStart and requestEnd among other
// things.
- if(event == null){
+ if (event == null) {
getLogger().log(Level.SEVERE,
"Could not get event. This should never happen.");
return;
AtmosphereResource resource = event.getResource();
- if(resource == null){
+ if (resource == null) {
getLogger().log(Level.SEVERE,
"Could not get resource. This should never happen.");
return;
/**
* File filter that only accepts directories.
*/
- private final static FileFilter DIRECTORIES_ONLY = (File f) ->
+ private static final FileFilter DIRECTORIES_ONLY = (File f) ->
f.exists() && f.isDirectory();
/**
*
* @return filtered list of class path entries
*/
- private final static List<String> getRawClasspathEntries() {
+ private static final List<String> getRawClasspathEntries() {
// try to keep the order of the classpath
List<String> locations = new ArrayList<>();
* string
* @return map of classpath locations, see {@link #classpathLocations}
*/
- private final static Map<String, URL> getClasspathLocations(
+ private static final Map<String, URL> getClasspathLocations(
List<String> rawClasspathEntries) {
long start = System.currentTimeMillis();
// try to keep the order of the classpath
* @param file
* @param locations
*/
- private final static void include(String name, File file,
+ private static final void include(String name, File file,
Map<String, URL> locations) {
if (!file.exists()) {
return;
if (value == null) return "";
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);
Locale locale = getLocale();
- if (locale != null){
+ if (locale != null) {
dateTimeFormatter = dateTimeFormatter.withLocale(locale);
}
return value.format(dateTimeFormatter);
private Component getRootOrThrow() {
Component root = getCompositionRoot();
- if(root == null) throw new IllegalStateException("Composition root has not been set");
+ if (root == null) throw new IllegalStateException("Composition root has not been set");
return root;
}
private <T> T getRootAbstractComponentPropertyOrNull(SerializableFunction<AbstractComponent, T> getter) {
Component root = getCompositionRoot();
- if(root instanceof AbstractComponent) {
+ if (root instanceof AbstractComponent) {
return getter.apply((AbstractComponent) root);
}
return null;
tmpItem.getCommand().menuSelected(tmpItem);
}
}
- } // if
- }// changeVariables
+ }
+ }
/**
* Constructs an empty, horizontal menu
this.checked = checked;
markAsDirty();
}
- }// class MenuItem
+ }
@Override
public void writeDesign(Element design, DesignContext designContext) {
result.add("html-content-allowed");
return result;
}
-}// class MenuBar
+}
*
* @since 8.1
*/
- public final static class TreeMultiSelectionModel<T>
+ public static final class TreeMultiSelectionModel<T>
extends MultiSelectionModelImpl<T> {
@Override
return Logger.getLogger(DesignAttributeHandler.class.getName());
}
- private final static Map<Class<?>, AttributeCacheEntry> cache = new ConcurrentHashMap<>();
+ private static final Map<Class<?>, AttributeCacheEntry> cache = new ConcurrentHashMap<>();
// translates string <-> object
- private final static DesignFormatter FORMATTER = new DesignFormatter();
+ private static final DesignFormatter FORMATTER = new DesignFormatter();
/**
* Returns the currently used formatter. All primitive types and all types
/**
* Default icon given if no icon is specified for a mime-type.
*/
- static public Resource DEFAULT_ICON = new ThemeResource(
+ public static Resource DEFAULT_ICON = new ThemeResource(
"../runo/icons/16/document.png");
/**
* Default mime-type.
*/
- static public String DEFAULT_MIME_TYPE = "application/octet-stream";
+ public static String DEFAULT_MIME_TYPE = "application/octet-stream";
/**
* Initial file extension to mime-type mapping.
*
* @return List of class path segment strings
*/
- private final static List<String> getRawClasspathEntries() {
+ private static final List<String> getRawClasspathEntries() {
// try to keep the order of the classpath
List<String> locations = new ArrayList<>();
* File representing the directory to scan
* @return collection of fully qualified class names in the directory
*/
- private final static Collection<String> findClassesInDirectory(
+ private static final Collection<String> findClassesInDirectory(
String parentPackage, File parent) {
if (parent.isHidden()
|| parent.getPath().contains(File.separator + ".")) {
}
}
- private final static List<String> getRawClasspathEntries() {
+ private static final List<String> getRawClasspathEntries() {
List<String> locations = new ArrayList<>();
String pathSep = System.getProperty("path.separator");
return getApplicationRunnerURIs(request).applicationClassname;
}
- private final static class ProxyDeploymentConfiguration
+ private static final class ProxyDeploymentConfiguration
implements InvocationHandler, Serializable {
private final DeploymentConfiguration originalConfiguration;
public class DevelopmentServerLauncher {
private static final String KEYSTORE = "src/main/resources/com/vaadin/launcher/keystore";
- private final static int serverPort = 8888;
+ private static final int serverPort = 8888;
/**
* Main function for running Jetty.
private List<T> testComponents = new ArrayList<>();
- abstract protected Class<T> getTestClass();
+ protected abstract Class<T> getTestClass();
protected static ThemeResource uncacheableThemeResource(
String resourceLocation) {
return new ThemeResource(resourceLocation);
}
- abstract protected void initializeComponents();
+ protected abstract void initializeComponents();
@Override
protected void setup(VaadinRequest request) {
public class ButtonClick extends AbstractReindeerTestUI {
- public final static String SUCCESS_TEXT = "Click received succesfully!";
- public final static String WRONG_BUTTON_TEXT = "Wrong button clicked.";
+ public static final String SUCCESS_TEXT = "Click received succesfully!";
+ public static final String WRONG_BUTTON_TEXT = "Wrong button clicked.";
@Override
protected void setup(VaadinRequest request) {
private final Label label = new Label("Initial content");
// The captions and icons used in the second MenuBar.
- public final static String[] itemNames = { "Icon item", "Arrow down",
+ public static final String[] itemNames = { "Icon item", "Arrow down",
"Arrow up", "Warning" };
- private final static Resource[] itemIcons = {
+ private static final Resource[] itemIcons = {
new ThemeResource("window/img/restore.png"), VaadinIcons.ARROW_DOWN,
VaadinIcons.ARROW_UP, VaadinIcons.WARNING };
// The last menu item is nested with the following submenu items.
- public final static String[] nestedItemnames = { "No icon", "Font icon",
+ public static final String[] nestedItemnames = { "No icon", "Font icon",
"Image icon" };
- private final static Resource[] nestedItemIcons = { null, VaadinIcons.LINK,
+ private static final Resource[] nestedItemIcons = { null, VaadinIcons.LINK,
new ThemeResource("window/img/restore.png") };
private MenuBar.Command selectionCommand;
public class TableNavigationPageDown extends AbstractReindeerTestUI {
- private final static int ROW_NUMBER = 50;
+ private static final int ROW_NUMBER = 50;
@Override
protected void setup(VaadinRequest req) {
return 5100;
}
- public final static String LABEL_ID = "sheetLabel";
+ public static final String LABEL_ID = "sheetLabel";
- public final static String labelID(int index) {
+ public static final String labelID(int index) {
return LABEL_ID + index;
}
}
- private final static ThemeResource FOLDER = new ThemeResource(
+ private static final ThemeResource FOLDER = new ThemeResource(
"../runo/icons/16/folder.png");
- private final static ThemeResource DOC = new ThemeResource(
+ private static final ThemeResource DOC = new ThemeResource(
"../runo/icons/16/document.png");
private void popuplateTrees() {
}
- private final static ThemeResource FOLDER = new ThemeResource(
+ private static final ThemeResource FOLDER = new ThemeResource(
"../runo/icons/64/folder.png");
- private final static ThemeResource DOC = new ThemeResource(
+ private static final ThemeResource DOC = new ThemeResource(
"../runo/icons/64/document.png");
public static class File {
public class NotificationGetTypeAndDescription extends AbstractTestUI {
- private final static Type[] types = { Type.WARNING_MESSAGE,
+ private static final Type[] types = { Type.WARNING_MESSAGE,
Type.ERROR_MESSAGE, Type.HUMANIZED_MESSAGE,
Type.TRAY_NOTIFICATION };
- public final static String[] type_names = { "warning", "error", "humanized",
+ public static final String[] type_names = { "warning", "error", "humanized",
"tray_notification" };
- public final static String[] captions = { "warningC", "errorC",
+ public static final String[] captions = { "warningC", "errorC",
"humanizedC", "tray_notificationC" };
- public final static String[] descriptions = { "warning", "error",
+ public static final String[] descriptions = { "warning", "error",
"humanized", "tray_notification" };
@Override
* @since
* @author Vaadin Ltd
*/
-abstract public class BaseAlignment extends BaseLayoutTestUI {
+public abstract class BaseAlignment extends BaseLayoutTestUI {
@Override
protected void setup(VaadinRequest request) {
import java.util.concurrent.atomic.AtomicLong;
public class PortableRandom {
- private final static long multiplier = 0x5DEECE66DL;
- private final static long addend = 0xBL;
- private final static long mask = (1L << 48) - 1;
+ private static final long multiplier = 0x5DEECE66DL;
+ private static final long addend = 0xBL;
+ private static final long mask = (1L << 48) - 1;
private AtomicLong seed;
public PortableRandom(long seed) {
private final TestWidgetRegistry registry = GWT
.create(TestWidgetRegistry.class);
- public static abstract class TestWidgetRegistry {
+ public abstract static class TestWidgetRegistry {
private Map<String, Invoker> creators = new HashMap<>();
// Called by generated sub class
return GWT.create(VButton.class);
}
- public final static String ID = "CsrfButton";
+ public static final String ID = "CsrfButton";
@Override
public void init() {
/**
* Our basic data object
*/
- public final static class Data {
+ public static final class Data {
Object value;
}
/**
* Id of the button triggering the test case.
*/
- public final static String BUTTON_ID = "gwtRpcButton";
+ public static final String BUTTON_ID = "gwtRpcButton";
@Override
protected void setup(VaadinRequest request) {
public class EscalatorColumnFreezingTest
extends EscalatorBasicClientFeaturesTest {
- private final static Pattern TRANSFORM_PATTERN = Pattern.compile(// @formatter:off
+ private static final Pattern TRANSFORM_PATTERN = Pattern.compile(// @formatter:off
// any start of the string
".*"
// @formatter:on
- private final static Pattern LEFT_PATTERN = Pattern
+ private static final Pattern LEFT_PATTERN = Pattern
.compile(".*left: (\\d+)px.*", Pattern.CASE_INSENSITIVE);
private static final int NO_FREEZE = -1;
// translate3d(0px, 40px, 123px);
// translate3d(24px, 15.251px, 0);
// translate(0, 40px);
- private final static String TRANSLATE_VALUE_REGEX =
+ private static final String TRANSLATE_VALUE_REGEX =
"translate(?:3d|)" // "translate" or "translate3d"
+ "\\(" // literal "("
+ "(" // start capturing the x argument
// 40px;
// 12.34px
- private final static String PIXEL_VALUE_REGEX =
+ private static final String PIXEL_VALUE_REGEX =
"(" // capture the pixel value
+ "[0-9]+" // the pixel argument
+ "(?:" // start of the subpixel part of the value
//@formatter:on
// also matches "-webkit-transform";
- private final static Pattern TRANSFORM_CSS_PATTERN = Pattern
+ private static final Pattern TRANSFORM_CSS_PATTERN = Pattern
.compile("transform: (.*?);");
- private final static Pattern TOP_CSS_PATTERN = Pattern.compile(
+ private static final Pattern TOP_CSS_PATTERN = Pattern.compile(
"top: ([0-9]+(?:\\.[0-9]+)?(?:px)?);?", Pattern.CASE_INSENSITIVE);
- private final static Pattern LEFT_CSS_PATTERN = Pattern.compile(
+ private static final Pattern LEFT_CSS_PATTERN = Pattern.compile(
"left: ([0-9]+(?:\\.[0-9]+)?(?:px)?);?", Pattern.CASE_INSENSITIVE);
- private final static Pattern TRANSLATE_VALUE_PATTERN = Pattern
+ private static final Pattern TRANSLATE_VALUE_PATTERN = Pattern
.compile(TRANSLATE_VALUE_REGEX);
- private final static Pattern PIXEL_VALUE_PATTERN = Pattern
+ private static final Pattern PIXEL_VALUE_PATTERN = Pattern
.compile(PIXEL_VALUE_REGEX, Pattern.CASE_INSENSITIVE);
@Before
/*
* Delay for PhantomJS.
*/
- private final static int DELAY = 10;
+ private static final int DELAY = 10;
private void assertSheet(int index) {
String labelCaption = "Tab " + index;
/*
* Delay for PhantomJS.
*/
- private final static int DELAY = 10;
+ private static final int DELAY = 10;
/*
* Provide the tab at specified index.
* @author Vaadin Ltd
*/
public class AbstractTextElementSetValueTest extends MultiBrowserTest {
- private final static String TYPED_STRING = "this is typed string";
+ private static final String TYPED_STRING = "this is typed string";
@Before
public void init() {
public class CompatibilityAbstractTextElementSetValueTest
extends MultiBrowserTest {
- private final static String TYPED_STRING = "this is typed string";
+ private static final String TYPED_STRING = "this is typed string";
@Before
public void init() {