super.configureField(field);
// Add Bean validators if there are annotations
if (isBeanValidationImplementationAvailable()) {
- BeanValidator validator = new BeanValidator(
- beanType, getPropertyId(field).toString());
+ BeanValidator validator = new BeanValidator(beanType,
+ getPropertyId(field).toString());
field.addValidator(validator);
if (field.getLocale() != null) {
validator.setLocale(field.getLocale());
* @param maxValue
* The maximum value to accept or null for no limit
*/
- public DoubleRangeValidator(String errorMessage, Double minValue, Double maxValue) {
+ public DoubleRangeValidator(String errorMessage, Double minValue,
+ Double maxValue) {
super(errorMessage, Double.class, minValue, maxValue);
}
this.complete = complete;
}
- /* (non-Javadoc)
- * @see com.vaadin.data.validator.AbstractValidator#isValidValue(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.data.validator.AbstractValidator#isValidValue(java.lang.Object
+ * )
*/
@Override
protected boolean isValidValue(String value) {
/**
* The JSONException is thrown by the JSON.org classes when things are amiss.
+ *
* @author JSON.org
* @version 2010-12-24
*/
public class JSONException extends Exception {
- private static final long serialVersionUID = 0;
- private Throwable cause;
+ private static final long serialVersionUID = 0;
+ private Throwable cause;
/**
* Constructs a JSONException with an explanatory message.
- * @param message Detail about the reason for the exception.
+ *
+ * @param message
+ * Detail about the reason for the exception.
*/
public JSONException(String message) {
super(message);
package com.vaadin.external.json;
/*
-Copyright (c) 2006 JSON.org
+ Copyright (c) 2006 JSON.org
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
-The Software shall be used for Good, not Evil.
+ The Software shall be used for Good, not Evil.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ */
import java.io.StringWriter;
/**
- * JSONStringer provides a quick and convenient way of producing JSON text.
- * The texts produced strictly conform to JSON syntax rules. No whitespace is
- * added, so the results are ready for transmission or storage. Each instance of
+ * JSONStringer provides a quick and convenient way of producing JSON text. The
+ * texts produced strictly conform to JSON syntax rules. No whitespace is added,
+ * so the results are ready for transmission or storage. Each instance of
* JSONStringer can produce one JSON text.
* <p>
* A JSONStringer instance provides a <code>value</code> method for appending
- * values to the
- * text, and a <code>key</code>
- * method for adding keys before values in objects. There are <code>array</code>
- * and <code>endArray</code> methods that make and bound array values, and
- * <code>object</code> and <code>endObject</code> methods which make and bound
- * object values. All of these methods return the JSONWriter instance,
- * permitting cascade style. For example, <pre>
- * myString = new JSONStringer()
- * .object()
- * .key("JSON")
- * .value("Hello, World!")
- * .endObject()
- * .toString();</pre> which produces the string <pre>
- * {"JSON":"Hello, World!"}</pre>
+ * values to the text, and a <code>key</code> method for adding keys before
+ * values in objects. There are <code>array</code> and <code>endArray</code>
+ * methods that make and bound array values, and <code>object</code> and
+ * <code>endObject</code> methods which make and bound object values. All of
+ * these methods return the JSONWriter instance, permitting cascade style. For
+ * example,
+ *
+ * <pre>
+ * myString = new JSONStringer().object().key("JSON").value("Hello, World!")
+ * .endObject().toString();
+ * </pre>
+ *
+ * which produces the string
+ *
+ * <pre>
+ * {"JSON":"Hello, World!"}
+ * </pre>
* <p>
* The first method called must be <code>array</code> or <code>object</code>.
* There are no methods for adding commas or colons. JSONStringer adds them for
* you. Objects and arrays can be nested up to 20 levels deep.
* <p>
* This can sometimes be easier than using a JSONObject to build a string.
+ *
* @author JSON.org
* @version 2008-09-18
*/
* problem in the construction of the JSON text (such as the calls to
* <code>array</code> were not properly balanced with calls to
* <code>endArray</code>).
+ *
* @return The JSON text.
*/
public String toString() {
browserDetails.setIEMode(documentMode);
}
}
-
+
if (browserDetails.isChrome()) {
- touchDevice = detectChromeTouchDevice();
+ touchDevice = detectChromeTouchDevice();
} else {
- touchDevice = detectTouchDevice();
+ touchDevice = detectTouchDevice();
}
}
/*-{
try { document.createEvent("TouchEvent");return true;} catch(e){return false;};
}-*/;
-
+
private native boolean detectChromeTouchDevice()
/*-{
return ("ontouchstart" in window);
// If we found a Paintable then we use that as reference. We should
// find the Paintable for all but very special cases (like
// overlays).
- w = ((ComponentConnector) ConnectorMap.get(client).getConnector(pid))
- .getWidget();
+ w = ((ComponentConnector) ConnectorMap.get(client)
+ .getConnector(pid)).getWidget();
/*
* Still if the Paintable contains a widget that implements
return "";
} else if (w instanceof VWindow) {
VWindow win = (VWindow) w;
- ArrayList<VWindow> subWindowList = client.getView()
- .getWidget().getSubWindowList();
+ ArrayList<VWindow> subWindowList = client.getView().getWidget()
+ .getSubWindowList();
int indexOfSubWindow = subWindowList.indexOf(win);
return PARENTCHILD_SEPARATOR + "VWindow[" + indexOfSubWindow + "]";
} else if (w instanceof RootPanel) {
w = client.getView().getWidget();
} else if (w == null) {
// Must be static pid (PID_S*)
- w = ((ComponentConnector) ConnectorMap.get(client).getConnector(
- part)).getWidget();
+ w = ((ComponentConnector) ConnectorMap.get(client)
+ .getConnector(part)).getWidget();
} else if (part.startsWith("domChild[")) {
// The target widget has been found and the rest identifies the
// element
* compatibility
*/
if (widgetClassName.equals("VWindow")) {
- iterator = client.getView().getWidget()
- .getSubWindowList().iterator();
+ iterator = client.getView().getWidget().getSubWindowList()
+ .iterator();
} else if (widgetClassName.equals("VContextMenu")) {
return client.getContextMenu();
} else {
*/
public class EventHelper {
- public static HandlerRegistration updateFocusHandler(ComponentConnector paintable,
- ApplicationConnection client,
+ public static HandlerRegistration updateFocusHandler(
+ ComponentConnector paintable, ApplicationConnection client,
HandlerRegistration handlerRegistration) {
if (client.hasEventListeners(paintable, FOCUS)) {
if (handlerRegistration == null) {
return null;
}
- public static HandlerRegistration updateBlurHandler(ComponentConnector paintable,
- ApplicationConnection client,
+ public static HandlerRegistration updateBlurHandler(
+ ComponentConnector paintable, ApplicationConnection client,
HandlerRegistration handlerRegistration) {
if (client.hasEventListeners(paintable, BLUR)) {
if (handlerRegistration == null) {
List<ApplicationConnection> runningApplications = ApplicationConfiguration
.getRunningApplications();
for (ApplicationConnection applicationConnection : runningApplications) {
- ConnectorMap paintableMap = applicationConnection
- .getConnectorMap();
+ ConnectorMap paintableMap = applicationConnection.getConnectorMap();
ComponentConnector paintable = paintableMap.getConnector(widget);
if (paintable == null) {
continue;
* @param element
* the element to start from
*/
- public static ComponentConnector findPaintable(ApplicationConnection client,
- Element element) {
+ public static ComponentConnector findPaintable(
+ ApplicationConnection client, Element element) {
Widget widget = Util.findWidget(element, null);
ConnectorMap vPaintableMap = ConnectorMap.get(client);
while (widget != null && !vPaintableMap.isConnector(widget)) {
// TODO paintables inside lists/maps get rendered as
// components in the debug console
String formattedValue = value instanceof Connector ? c
- .getConnectorMap().getConnectorId((Connector) value)
- : String.valueOf(value);
+ .getConnectorMap()
+ .getConnectorId((Connector) value) : String
+ .valueOf(value);
formattedParams = parameters[0] + " : " + formattedValue;
}
if (null == formattedParams) {
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.HTML;
-import com.vaadin.terminal.gwt.client.ui.Icon;
import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.Icon;
import com.vaadin.terminal.gwt.client.ui.TabsheetBaseConnector;
public class VCaption extends HTML {
owner = component;
if (client != null && owner != null) {
- setOwnerPid(getElement(), ConnectorMap.get(client).getConnectorId(owner));
+ setOwnerPid(getElement(),
+ ConnectorMap.get(client).getConnectorId(owner));
}
setStyleName(CLASSNAME);
for (ApplicationConnection a : ApplicationConfiguration
.getRunningApplications()) {
- ComponentConnector paintable = Util.getPaintableForElement(a,
- a.getView().getWidget(), eventTarget);
+ ComponentConnector paintable = Util.getPaintableForElement(
+ a, a.getView().getWidget(), eventTarget);
if (paintable == null) {
paintable = Util.getPaintableForElement(a,
RootPanel.get(), eventTarget);
}
if (paintable != null) {
- String pid = ConnectorMap.get(a).getConnectorId(paintable);
+ String pid = ConnectorMap.get(a).getConnectorId(
+ paintable);
VUIDLBrowser.highlight(paintable);
label.setText("Currently focused :"
+ paintable.getClass() + " ID:" + pid);
.getClientY());
for (ApplicationConnection a : ApplicationConfiguration
.getRunningApplications()) {
- ComponentConnector paintable = Util.getPaintableForElement(a,
- a.getView().getWidget(), eventTarget);
+ ComponentConnector paintable = Util.getPaintableForElement(
+ a, a.getView().getWidget(), eventTarget);
if (paintable == null) {
paintable = Util.getPaintableForElement(a,
RootPanel.get(), eventTarget);
}
private void printClientSideDetectedIssues(
- Set<ComponentConnector> zeroHeightComponents, ApplicationConnection ac) {
+ Set<ComponentConnector> zeroHeightComponents,
+ ApplicationConnection ac) {
for (final ComponentConnector paintable : zeroHeightComponents) {
final Widget layout = paintable.getParent().getWidget();
emphasisInUi.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (paintable != null) {
- Element element2 = paintable.getWidget()
- .getElement();
+ Element element2 = paintable.getWidget().getElement();
Widget.setStyleName(element2, "invalidlayout",
emphasisInUi.getValue());
}
}
- public void handleTooltipEvent(Event event, ComponentConnector owner, Object key) {
+ public void handleTooltipEvent(Event event, ComponentConnector owner,
+ Object key) {
final int type = DOM.eventGetType(event);
if ((VTooltip.TOOLTIP_EVENTS & type) == type) {
if (type == Event.ONMOUSEOVER) {
* mapper between connector ID and {@link Connector} objects
* @return converted value (does not contain JSON types)
*/
- public static Object convertValue(JSONArray jsonArray,
- ConnectorMap idMapper) {
+ public static Object convertValue(JSONArray jsonArray, ConnectorMap idMapper) {
String type = ((JSONString) jsonArray.get(0)).stringValue();
return convertValue(type, jsonArray.get(1), idMapper);
}
/**
* Initialization support for client to server RPC interfaces.
*
- * This is in a separate interface instead of {@link ServerRpc}
- * because otherwise also server side proxies would have to implement the
+ * This is in a separate interface instead of {@link ServerRpc} because
+ * otherwise also server side proxies would have to implement the
* initialization method.
*
* @since 7.0
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.VAbsoluteLayout.AbsoluteWrapper;
-public class AbsoluteLayoutConnector extends AbstractComponentContainerConnector
- implements DirectionalManagedLayout {
+public class AbsoluteLayoutConnector extends
+ AbstractComponentContainerConnector implements DirectionalManagedLayout {
private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
this, EventId.LAYOUT_CLICK) {
}
public void updateCaption(ComponentConnector component, UIDL uidl) {
- AbsoluteWrapper parent2 = (AbsoluteWrapper) (component
- .getWidget()).getParent();
+ AbsoluteWrapper parent2 = (AbsoluteWrapper) (component.getWidget())
+ .getParent();
parent2.updateCaption(uidl);
}
import com.google.gwt.user.client.ui.HasOneWidget;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ComponentContainerConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
public abstract class AbstractComponentContainerConnector extends
AbstractComponentConnector implements ComponentContainerConnector {
getWidget().dts.setLocale(locale);
getWidget().currentLocale = locale;
} catch (final LocaleNotLoadedException e) {
- getWidget().currentLocale = getWidget().dts
- .getLocale();
+ getWidget().currentLocale = getWidget().dts.getLocale();
VConsole.error("Tried to use an unloaded locale \"" + locale
+ "\". Using default locale ("
+ getWidget().currentLocale + ").");
// Construct new date for this datefield (only if not null)
if (year > -1) {
getWidget().setCurrentDate(
- new Date((long) getWidget().getTime(year,
- month, day, hour, min, sec, 0)));
+ new Date((long) getWidget().getTime(year, month, day, hour,
+ min, sec, 0)));
} else {
getWidget().setCurrentDate(null);
}
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.ValueMap;
-import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
import com.vaadin.terminal.gwt.client.ui.layout.ComponentConnectorLayoutSlot;
+import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
public abstract class AbstractOrderedLayoutConnector extends
AbstractComponentContainerConnector implements DirectionalManagedLayout {
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VAccordion.StackItem;
public class AccordionConnector extends TabsheetBaseConnector implements
getWidget().selectedUIDLItemIndex);
UIDL selectedTabUIDL = getWidget().lazyUpdateMap
.remove(selectedItem);
- getWidget().open(
- getWidget().selectedUIDLItemIndex);
+ getWidget().open(getWidget().selectedUIDLItemIndex);
selectedItem.setContent(selectedTabUIDL);
- } else if (isRealUpdate(uidl)
- && getWidget().openTab != null) {
+ } else if (isRealUpdate(uidl) && getWidget().openTab != null) {
getWidget().close(getWidget().openTab);
}
getWidget().iLayout();
// finally render possible hidden tabs
if (getWidget().lazyUpdateMap.size() > 0) {
- for (Iterator iterator = getWidget().lazyUpdateMap
- .keySet().iterator(); iterator.hasNext();) {
+ for (Iterator iterator = getWidget().lazyUpdateMap.keySet()
+ .iterator(); iterator.hasNext();) {
StackItem item = (StackItem) iterator.next();
item.setContent(getWidget().lazyUpdateMap.get(item));
}
getWidget().lazyUpdateMap.clear();
}
- getWidget().renderInformation
- .updateSize(getWidget().getElement());
+ getWidget().renderInformation.updateSize(getWidget().getElement());
}
@Override
return;
}
- getWidget().focusHandlerRegistration = EventHelper
- .updateFocusHandler(this, client,
- getWidget().focusHandlerRegistration);
- getWidget().blurHandlerRegistration = EventHelper
- .updateBlurHandler(this, client,
- getWidget().blurHandlerRegistration);
+ getWidget().focusHandlerRegistration = EventHelper.updateFocusHandler(
+ this, client, getWidget().focusHandlerRegistration);
+ getWidget().blurHandlerRegistration = EventHelper.updateBlurHandler(
+ this, client, getWidget().blurHandlerRegistration);
// Save details
getWidget().client = client;
// handle error
if (uidl.hasAttribute("error")) {
if (getWidget().errorIndicatorElement == null) {
- getWidget().errorIndicatorElement = DOM
- .createSpan();
+ getWidget().errorIndicatorElement = DOM.createSpan();
getWidget().errorIndicatorElement
.setClassName("v-errorindicator");
}
- getWidget().wrapper.insertBefore(
- getWidget().errorIndicatorElement,
+ getWidget().wrapper.insertBefore(getWidget().errorIndicatorElement,
getWidget().captionElement);
} else if (getWidget().errorIndicatorElement != null) {
- getWidget().wrapper
- .removeChild(getWidget().errorIndicatorElement);
+ getWidget().wrapper.removeChild(getWidget().errorIndicatorElement);
getWidget().errorIndicatorElement = null;
}
if (uidl.hasAttribute(ATTRIBUTE_ICON)) {
if (getWidget().icon == null) {
getWidget().icon = new Icon(client);
- getWidget().wrapper.insertBefore(
- getWidget().icon.getElement(),
+ getWidget().wrapper.insertBefore(getWidget().icon.getElement(),
getWidget().captionElement);
}
- getWidget().icon.setUri(uidl
- .getStringAttribute(ATTRIBUTE_ICON));
+ getWidget().icon.setUri(uidl.getStringAttribute(ATTRIBUTE_ICON));
} else {
if (getWidget().icon != null) {
- getWidget().wrapper
- .removeChild(getWidget().icon.getElement());
+ getWidget().wrapper.removeChild(getWidget().icon.getElement());
getWidget().icon = null;
}
}
- getWidget().clickShortcut = getState()
- .getClickShortcutKeyCode();
+ getWidget().clickShortcut = getState().getClickShortcutKeyCode();
}
@Override
return;
}
- getWidget().focusHandlerRegistration = EventHelper
- .updateFocusHandler(this, client,
- getWidget().focusHandlerRegistration);
- getWidget().blurHandlerRegistration = EventHelper
- .updateBlurHandler(this, client,
- getWidget().blurHandlerRegistration);
+ getWidget().focusHandlerRegistration = EventHelper.updateFocusHandler(
+ this, client, getWidget().focusHandlerRegistration);
+ getWidget().blurHandlerRegistration = EventHelper.updateBlurHandler(
+ this, client, getWidget().blurHandlerRegistration);
if (uidl.hasAttribute("error")) {
if (getWidget().errorIndicatorElement == null) {
- getWidget().errorIndicatorElement = DOM
- .createSpan();
- getWidget().errorIndicatorElement
- .setInnerHTML(" ");
- DOM.setElementProperty(
- getWidget().errorIndicatorElement,
+ getWidget().errorIndicatorElement = DOM.createSpan();
+ getWidget().errorIndicatorElement.setInnerHTML(" ");
+ DOM.setElementProperty(getWidget().errorIndicatorElement,
"className", "v-errorindicator");
DOM.appendChild(getWidget().getElement(),
getWidget().errorIndicatorElement);
DOM.sinkEvents(getWidget().errorIndicatorElement,
VTooltip.TOOLTIP_EVENTS | Event.ONCLICK);
} else {
- DOM.setStyleAttribute(
- getWidget().errorIndicatorElement,
+ DOM.setStyleAttribute(getWidget().errorIndicatorElement,
"display", "");
}
} else if (getWidget().errorIndicatorElement != null) {
- DOM.setStyleAttribute(
- getWidget().errorIndicatorElement, "display",
+ DOM.setStyleAttribute(getWidget().errorIndicatorElement, "display",
"none");
}
getWidget().icon = new Icon(client);
DOM.insertChild(getWidget().getElement(),
getWidget().icon.getElement(), 1);
- getWidget().icon
- .sinkEvents(VTooltip.TOOLTIP_EVENTS);
+ getWidget().icon.sinkEvents(VTooltip.TOOLTIP_EVENTS);
getWidget().icon.sinkEvents(Event.ONCLICK);
}
- getWidget().icon.setUri(uidl
- .getStringAttribute(ATTRIBUTE_ICON));
+ getWidget().icon.setUri(uidl.getStringAttribute(ATTRIBUTE_ICON));
} else if (getWidget().icon != null) {
// detach icon
DOM.removeChild(getWidget().getElement(),
// Set text
getWidget().setText(getState().getCaption());
- getWidget()
- .setValue(
- uidl.getBooleanVariable(getWidget().VARIABLE_STATE));
+ getWidget().setValue(
+ uidl.getBooleanVariable(getWidget().VARIABLE_STATE));
getWidget().immediate = getState().isImmediate();
}
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.Element;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.MouseEventDetails;
public abstract class ClickEventHandler implements DoubleClickHandler,
ContextMenuHandler, MouseUpHandler {
protected void fireClick(NativeEvent event) {
ApplicationConnection client = getApplicationConnection();
- String pid = ConnectorMap.get(getApplicationConnection()).getConnectorId(
- paintable);
+ String pid = ConnectorMap.get(getApplicationConnection())
+ .getConnectorId(paintable);
MouseEventDetails mouseDetails = new MouseEventDetails(event,
getRelativeToElement());
// not a FocusWidget -> needs own tabindex handling
if (uidl.hasAttribute("tabindex")) {
- getWidget().tb.setTabIndex(uidl
- .getIntAttribute("tabindex"));
+ getWidget().tb.setTabIndex(uidl.getIntAttribute("tabindex"));
}
if (uidl.hasAttribute("filteringmode")) {
- getWidget().filteringmode = uidl
- .getIntAttribute("filteringmode");
+ getWidget().filteringmode = uidl.getIntAttribute("filteringmode");
}
getWidget().immediate = getState().isImmediate();
- getWidget().nullSelectionAllowed = uidl
- .hasAttribute("nullselect");
+ getWidget().nullSelectionAllowed = uidl.hasAttribute("nullselect");
- getWidget().nullSelectItem = uidl
- .hasAttribute("nullselectitem")
+ getWidget().nullSelectItem = uidl.hasAttribute("nullselectitem")
&& uidl.getBooleanAttribute("nullselectitem");
getWidget().currentPage = uidl.getIntVariable("page");
if (uidl.hasAttribute("pagelength")) {
- getWidget().pageLength = uidl
- .getIntAttribute("pagelength");
+ getWidget().pageLength = uidl.getIntAttribute("pagelength");
}
if (uidl.hasAttribute(VFilterSelect.ATTR_INPUTPROMPT)) {
getWidget().inputPrompt = "";
}
- getWidget().suggestionPopup.updateStyleNames(uidl,
- getState());
+ getWidget().suggestionPopup.updateStyleNames(uidl, getState());
- getWidget().allowNewItem = uidl
- .hasAttribute("allownewitem");
+ getWidget().allowNewItem = uidl.hasAttribute("allownewitem");
getWidget().lastNewItemString = null;
getWidget().currentSuggestions.clear();
final UIDL options = uidl.getChildUIDL(0);
if (uidl.hasAttribute("totalMatches")) {
- getWidget().totalMatches = uidl
- .getIntAttribute("totalMatches");
+ getWidget().totalMatches = uidl.getIntAttribute("totalMatches");
} else {
getWidget().totalMatches = 0;
}
}
}
getWidget().currentSuggestion = suggestion;
- getWidget().setSelectedItemIcon(
- suggestion.getIconUri());
+ getWidget().setSelectedItemIcon(suggestion.getIconUri());
}
// Collect captions so we can calculate minimum width for textarea
&& getWidget().lastFilter.toLowerCase().equals(
uidl.getStringVariable("filter"))) {
getWidget().suggestionPopup.showSuggestions(
- getWidget().currentSuggestions,
- getWidget().currentPage,
+ getWidget().currentSuggestions, getWidget().currentPage,
getWidget().totalMatches);
getWidget().waitingForFilteringResponse = false;
if (!getWidget().popupOpenerClicked
&& getWidget().selectPopupItemWhenResponseIsReceived != VFilterSelect.Select.NONE) {
// we're paging w/ arrows
if (getWidget().selectPopupItemWhenResponseIsReceived == VFilterSelect.Select.LAST) {
- getWidget().suggestionPopup.menu
- .selectLastItem();
+ getWidget().suggestionPopup.menu.selectLastItem();
} else {
- getWidget().suggestionPopup.menu
- .selectFirstItem();
+ getWidget().suggestionPopup.menu.selectFirstItem();
}
// This is used for paging so we update the keyboard selection
.setKeyboardSelectedItem(activeMenuItem);
// Update text field to contain the correct text
- getWidget()
- .setTextboxText(activeMenuItem.getText());
+ getWidget().setTextboxText(activeMenuItem.getText());
getWidget().tb.setSelectionRange(
getWidget().lastFilter.length(),
activeMenuItem.getText().length()
}
// Calculate minumum textarea width
- getWidget().suggestionPopupMinWidth = getWidget()
- .minWidth(captions);
+ getWidget().suggestionPopupMinWidth = getWidget().minWidth(captions);
getWidget().popupOpenerClicked = false;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class CssLayoutConnector extends AbstractComponentContainerConnector {
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.UIDL;
public class CustomComponentConnector extends
AbstractComponentContainerConnector {
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.UIDL;
public class CustomLayoutConnector extends AbstractComponentContainerConnector
implements SimpleManagedLayout {
}
public void layout() {
- getWidget().iLayoutJS(
- DOM.getFirstChild(getWidget().getElement()));
+ getWidget().iLayoutJS(DOM.getFirstChild(getWidget().getElement()));
}
}
if (uidl.hasAttribute("type")) {
getWidget().type = uidl.getStringAttribute("type");
if (getWidget().type.equals("image")) {
- getWidget().addStyleName(
- VEmbedded.CLASSNAME + "-image");
+ getWidget().addStyleName(VEmbedded.CLASSNAME + "-image");
Element el = null;
boolean created = false;
- NodeList<Node> nodes = getWidget().getElement()
- .getChildNodes();
+ NodeList<Node> nodes = getWidget().getElement().getChildNodes();
if (nodes != null && nodes.getLength() == 1) {
Node n = nodes.getItem(0);
if (n.getNodeType() == Node.ELEMENT_NODE) {
style.setProperty("width", getState().getWidth());
style.setProperty("height", getState().getHeight());
- DOM.setElementProperty(el, "src", getWidget()
- .getSrc(uidl, client));
+ DOM.setElementProperty(el, "src",
+ getWidget().getSrc(uidl, client));
if (created) {
// insert in dom late
getWidget().sinkEvents(VTooltip.TOOLTIP_EVENTS);
} else if (getWidget().type.equals("browser")) {
- getWidget().addStyleName(
- VEmbedded.CLASSNAME + "-browser");
+ getWidget().addStyleName(VEmbedded.CLASSNAME + "-browser");
if (getWidget().browserElement == null) {
getWidget().setHTML(
"<iframe width=\"100%\" height=\"100%\" frameborder=\"0\""
+ " allowTransparency=\"true\" src=\"\""
+ " name=\"" + uidl.getId()
+ "\"></iframe>");
- getWidget().browserElement = DOM
- .getFirstChild(getWidget().getElement());
+ getWidget().browserElement = DOM.getFirstChild(getWidget()
+ .getElement());
}
- DOM.setElementAttribute(getWidget().browserElement,
- "src", getWidget().getSrc(uidl, client));
+ DOM.setElementAttribute(getWidget().browserElement, "src",
+ getWidget().getSrc(uidl, client));
clearBrowserElement = false;
} else {
- VConsole.log("Unknown Embedded type '"
- + getWidget().type + "'");
+ VConsole.log("Unknown Embedded type '" + getWidget().type + "'");
}
} else if (uidl.hasAttribute("mimetype")) {
final String mime = uidl.getStringAttribute("mimetype");
if (mime.equals("application/x-shockwave-flash")) {
// Handle embedding of Flash
- getWidget().addStyleName(
- VEmbedded.CLASSNAME + "-flash");
- getWidget().setHTML(
- getWidget().createFlashEmbed(uidl));
+ getWidget().addStyleName(VEmbedded.CLASSNAME + "-flash");
+ getWidget().setHTML(getWidget().createFlashEmbed(uidl));
} else if (mime.equals("image/svg+xml")) {
- getWidget().addStyleName(
- VEmbedded.CLASSNAME + "-svg");
+ getWidget().addStyleName(VEmbedded.CLASSNAME + "-svg");
String data;
Map<String, String> parameters = VEmbedded.getParameters(uidl);
if (parameters.get("data") == null) {
import com.google.gwt.event.dom.client.KeyDownEvent;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.UIDL;
-public class FormConnector extends AbstractComponentContainerConnector implements
- SimpleManagedLayout {
+public class FormConnector extends AbstractComponentContainerConnector
+ implements SimpleManagedLayout {
@Override
public void init() {
boolean legendEmpty = true;
if (getState().getCaption() != null) {
- getWidget().caption.setInnerText(getState()
- .getCaption());
+ getWidget().caption.setInnerText(getState().getCaption());
legendEmpty = false;
} else {
getWidget().caption.setInnerText("");
if (uidl.hasAttribute(ATTRIBUTE_ICON)) {
if (getWidget().icon == null) {
getWidget().icon = new Icon(client);
- getWidget().legend
- .insertFirst(getWidget().icon.getElement());
+ getWidget().legend.insertFirst(getWidget().icon.getElement());
}
- getWidget().icon.setUri(uidl
- .getStringAttribute(ATTRIBUTE_ICON));
+ getWidget().icon.setUri(uidl.getStringAttribute(ATTRIBUTE_ICON));
legendEmpty = false;
} else {
if (getWidget().icon != null) {
- getWidget().legend
- .removeChild(getWidget().icon.getElement());
+ getWidget().legend.removeChild(getWidget().icon.getElement());
}
}
if (legendEmpty) {
}
if (getState().hasDescription()) {
- getWidget().desc.setInnerHTML(getState()
- .getDescription());
+ getWidget().desc.setInnerHTML(getState().getDescription());
if (getWidget().desc.getParentElement() == null) {
- getWidget().fieldSet.insertAfter(
- getWidget().desc,
+ getWidget().fieldSet.insertAfter(getWidget().desc,
getWidget().legend);
}
} else {
getWidget().desc.setInnerHTML("");
if (getWidget().desc.getParentElement() != null) {
- getWidget().fieldSet
- .removeChild(getWidget().desc);
+ getWidget().fieldSet.removeChild(getWidget().desc);
}
}
if (getWidget().lo == null) {
// Layout not rendered before
getWidget().lo = newLayoutWidget;
- getWidget().add(newLayoutWidget,
- getWidget().fieldContainer);
+ getWidget().add(newLayoutWidget, getWidget().fieldContainer);
} else if (getWidget().lo != newLayoutWidget) {
// Layout has changed
client.unregisterPaintable(ConnectorMap.get(getConnection())
.getConnector(getWidget().lo));
getWidget().remove(getWidget().lo);
getWidget().lo = newLayoutWidget;
- getWidget().add(newLayoutWidget,
- getWidget().fieldContainer);
+ getWidget().add(newLayoutWidget, getWidget().fieldContainer);
}
newLayout.updateFromUIDL(layoutUidl, client);
getWidget().shortcutHandler = new ShortcutActionHandler(
getId(), client);
getWidget().keyDownRegistration = getWidget()
- .addDomHandler(getWidget(),
- KeyDownEvent.getType());
+ .addDomHandler(getWidget(), KeyDownEvent.getType());
}
- getWidget().shortcutHandler
- .updateActionMap(childUidl);
+ getWidget().shortcutHandler.updateActionMap(childUidl);
}
} else if (getWidget().shortcutHandler != null) {
getWidget().keyDownRegistration.removeHandler();
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.UIDL;
public class FormLayoutConnector extends AbstractComponentContainerConnector {
@Override
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.VGridLayout.Cell;
import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
public void updateCaption(ComponentConnector paintable, UIDL uidl) {
VGridLayout layout = getWidget();
if (VCaption.isNeeded(uidl, paintable.getState())) {
- Cell cell = layout.widgetToCell.get(paintable
- .getWidget());
+ Cell cell = layout.widgetToCell.get(paintable.getWidget());
VLayoutSlot layoutSlot = cell.slot;
VCaption caption = layoutSlot.getCaption();
if (caption == null) {
@SuppressWarnings("deprecation")
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
super.updateFromUIDL(uidl, client);
- getWidget().calendarPanel
- .setShowISOWeekNumbers(getWidget()
- .isShowISOWeekNumbers());
- getWidget().calendarPanel
- .setDateTimeService(getWidget()
- .getDateTimeService());
- getWidget().calendarPanel
- .setResolution(getWidget().getCurrentResolution());
+ getWidget().calendarPanel.setShowISOWeekNumbers(getWidget()
+ .isShowISOWeekNumbers());
+ getWidget().calendarPanel.setDateTimeService(getWidget()
+ .getDateTimeService());
+ getWidget().calendarPanel.setResolution(getWidget()
+ .getCurrentResolution());
Date currentDate = getWidget().getCurrentDate();
if (currentDate != null) {
- getWidget().calendarPanel.setDate(new Date(currentDate
- .getTime()));
+ getWidget().calendarPanel.setDate(new Date(currentDate.getTime()));
} else {
getWidget().calendarPanel.setDate(null);
}
// date currently null, use the value from
// calendarPanel
// (~ client time at the init of the widget)
- d = (Date) getWidget().calendarPanel
- .getDate().clone();
+ d = (Date) getWidget().calendarPanel.getDate()
+ .clone();
}
d.setHours(hour);
d.setMinutes(min);
*/
date2.setYear(date.getYear());
date2.setMonth(date.getMonth());
- getWidget().calendarPanel
- .setDate(date2);
+ getWidget().calendarPanel.setDate(date2);
/*
* Then update the value from panel to server
*/
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.user.client.Element;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.MouseEventDetails;
public abstract class LayoutClickEventHandler extends ClickEventHandler {
@Override
protected void fireClick(NativeEvent event) {
ApplicationConnection client = getApplicationConnection();
- String pid = ConnectorMap.get(getApplicationConnection()).getConnectorId(
- paintable);
+ String pid = ConnectorMap.get(getApplicationConnection())
+ .getConnectorId(paintable);
MouseEventDetails mouseDetails = new MouseEventDetails(event,
getRelativeToElement());
if (uidl.hasAttribute("name")) {
getWidget().target = uidl.getStringAttribute("name");
- getWidget().anchor.setAttribute("target",
- getWidget().target);
+ getWidget().anchor.setAttribute("target", getWidget().target);
}
if (uidl.hasAttribute("src")) {
getWidget().src = client.translateVaadinUri(uidl
.getStringAttribute("src"));
- getWidget().anchor.setAttribute("href",
- getWidget().src);
+ getWidget().anchor.setAttribute("href", getWidget().src);
}
if (uidl.hasAttribute("border")) {
getWidget().borderStyle = VLink.BORDER_STYLE_DEFAULT;
}
- getWidget().targetHeight = uidl
- .hasAttribute("targetHeight") ? uidl
+ getWidget().targetHeight = uidl.hasAttribute("targetHeight") ? uidl
.getIntAttribute("targetHeight") : -1;
getWidget().targetWidth = uidl.hasAttribute("targetWidth") ? uidl
.getIntAttribute("targetWidth") : -1;
// Set link caption
- getWidget().captionElement.setInnerText(getState()
- .getCaption());
+ getWidget().captionElement.setInnerText(getState().getCaption());
// handle error
if (uidl.hasAttribute("error")) {
if (getWidget().errorIndicatorElement == null) {
getWidget().errorIndicatorElement = DOM.createDiv();
- DOM.setElementProperty(
- getWidget().errorIndicatorElement,
+ DOM.setElementProperty(getWidget().errorIndicatorElement,
"className", "v-errorindicator");
}
DOM.insertChild(getWidget().getElement(),
getWidget().errorIndicatorElement, 0);
} else if (getWidget().errorIndicatorElement != null) {
- DOM.setStyleAttribute(
- getWidget().errorIndicatorElement, "display",
+ DOM.setStyleAttribute(getWidget().errorIndicatorElement, "display",
"none");
}
if (uidl.hasAttribute(ATTRIBUTE_ICON)) {
if (getWidget().icon == null) {
getWidget().icon = new Icon(client);
- getWidget().anchor.insertBefore(
- getWidget().icon.getElement(),
+ getWidget().anchor.insertBefore(getWidget().icon.getElement(),
getWidget().captionElement);
}
- getWidget().icon.setUri(uidl
- .getStringAttribute(ATTRIBUTE_ICON));
+ getWidget().icon.setUri(uidl.getStringAttribute(ATTRIBUTE_ICON));
}
}
getWidget().moreItem.setHTML(itemHTML.toString());
getWidget().moreItem.setCommand(VMenuBar.emptyCommand);
- getWidget().collapsedRootItems = new VMenuBar(true,
- getWidget());
- getWidget().moreItem
- .setSubMenu(getWidget().collapsedRootItems);
+ getWidget().collapsedRootItems = new VMenuBar(true, getWidget());
+ getWidget().moreItem.setSubMenu(getWidget().collapsedRootItems);
getWidget().moreItem.addStyleName(VMenuBar.CLASSNAME
+ "-more-menuitem");
}
// item's id-number
cmd = new Command() {
public void execute() {
- getWidget().hostReference
- .onMenuClick(itemId);
+ getWidget().hostReference.onMenuClick(itemId);
}
};
}
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.LayoutManager;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class PanelConnector extends AbstractComponentContainerConnector
implements SimpleManagedLayout, PostLayoutListener {
// Affects size calculations
// Restore default stylenames
- getWidget().contentNode.setClassName(VPanel.CLASSNAME
- + "-content");
- getWidget().bottomDecoration
- .setClassName(VPanel.CLASSNAME + "-deco");
- getWidget().captionNode.setClassName(VPanel.CLASSNAME
- + "-caption");
+ getWidget().contentNode.setClassName(VPanel.CLASSNAME + "-content");
+ getWidget().bottomDecoration.setClassName(VPanel.CLASSNAME
+ + "-deco");
+ getWidget().captionNode.setClassName(VPanel.CLASSNAME + "-caption");
boolean hasCaption = false;
if (getState().getCaption() != null
&& !"".equals(getState().getCaption())) {
hasCaption = true;
} else {
getWidget().setCaption("");
- getWidget().captionNode
- .setClassName(VPanel.CLASSNAME + "-nocaption");
+ getWidget().captionNode.setClassName(VPanel.CLASSNAME
+ + "-nocaption");
}
// Add proper stylenames for all elements. This way we can prevent
if (getWidget().layout != null) {
client.unregisterPaintable(getWidget().layout);
}
- getWidget()
- .setWidget(newLayout.getWidget());
+ getWidget().setWidget(newLayout.getWidget());
getWidget().layout = newLayout;
}
getWidget().layout.updateFromUIDL(layoutUidl, client);
getWidget().shortcutHandler = new ShortcutActionHandler(
getId(), client);
}
- getWidget().shortcutHandler
- .updateActionMap(childUidl);
+ getWidget().shortcutHandler.updateActionMap(childUidl);
}
}
}
// And apply tab index
if (uidl.hasVariable("tabindex")) {
- getWidget().contentNode.setTabIndex(uidl
- .getIntVariable("tabindex"));
+ getWidget().contentNode
+ .setTabIndex(uidl.getIntVariable("tabindex"));
}
}
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.VCaptionWrapper;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class PopupViewConnector extends AbstractComponentContainerConnector {
}
getWidget().popup.setStyleName(styleBuf.toString());
} else {
- getWidget().popup
- .setStyleName(getWidget().popup
- .getStylePrimaryName());
+ getWidget().popup.setStyleName(getWidget().popup
+ .getStylePrimaryName());
}
getWidget().showPopup(getWidget().popup);
public void updateCaption(ComponentConnector component, UIDL uidl) {
if (VCaption.isNeeded(uidl, component.getState())) {
if (getWidget().popup.captionWrapper != null) {
- getWidget().popup.captionWrapper
- .updateCaption(uidl);
+ getWidget().popup.captionWrapper.updateCaption(uidl);
} else {
getWidget().popup.captionWrapper = new VCaptionWrapper(
component, getConnection());
- getWidget().popup
- .setWidget(getWidget().popup.captionWrapper);
- getWidget().popup.captionWrapper
- .updateCaption(uidl);
+ getWidget().popup.setWidget(getWidget().popup.captionWrapper);
+ getWidget().popup.captionWrapper.updateCaption(uidl);
}
} else {
if (getWidget().popup.captionWrapper != null) {
// Save details
getWidget().client = client;
- getWidget().indeterminate = uidl
- .getBooleanAttribute("indeterminate");
+ getWidget().indeterminate = uidl.getBooleanAttribute("indeterminate");
if (getWidget().indeterminate) {
String basename = VProgressIndicator.CLASSNAME + "-indeterminate";
final float f = Float.parseFloat(uidl
.getStringAttribute("state"));
final int size = Math.round(100 * f);
- DOM.setStyleAttribute(getWidget().indicator,
- "width", size + "%");
+ DOM.setStyleAttribute(getWidget().indicator, "width", size
+ + "%");
} catch (final Exception e) {
}
}
if (!getState().isDisabled()) {
- getWidget().interval = uidl
- .getIntAttribute("pollinginterval");
- getWidget().poller
- .scheduleRepeating(getWidget().interval);
+ getWidget().interval = uidl.getIntAttribute("pollinginterval");
+ getWidget().poller.scheduleRepeating(getWidget().interval);
}
}
import com.google.gwt.user.client.ui.KeyboardListenerCollection;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;
/**
}
/**
- * A focusable {@link ComponentConnector} implementing this interface will be
- * notified before shortcut actions are handled if it will be the target of
- * the action (most commonly means it is the focused component during the
+ * A focusable {@link ComponentConnector} implementing this interface will
+ * be notified before shortcut actions are handled if it will be the target
+ * of the action (most commonly means it is the focused component during the
* keyboard combination is triggered by the user).
*/
public interface BeforeShortcutActionListener extends ComponentConnector {
*/
package com.vaadin.terminal.gwt.client.ui;
-
public interface SimpleManagedLayout extends ManagedLayout {
public void layout();
}
String style = getState().getStyle();
if (getWidget().vertical) {
- getWidget().addStyleName(
- VSlider.CLASSNAME + "-vertical");
+ getWidget().addStyleName(VSlider.CLASSNAME + "-vertical");
} else {
- getWidget().removeStyleName(
- VSlider.CLASSNAME + "-vertical");
+ getWidget().removeStyleName(VSlider.CLASSNAME + "-vertical");
}
getWidget().min = uidl.getDoubleAttribute("min");
getWidget().max = uidl.getDoubleAttribute("max");
getWidget().resolution = uidl.getIntAttribute("resolution");
- getWidget().value = new Double(
- uidl.getDoubleVariable("value"));
+ getWidget().value = new Double(uidl.getDoubleVariable("value"));
getWidget().setFeedbackValue(getWidget().value);
Scheduler.get().scheduleDeferred(new Command() {
public void execute() {
getWidget().buildHandle();
- getWidget().setValue(
- getWidget().value, false);
+ getWidget().setValue(getWidget().value, false);
}
});
} else {
getWidget().buildHandle();
- getWidget().setValue(getWidget().value,
- false);
+ getWidget().setValue(getWidget().value, false);
}
}
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class TableConnector extends AbstractComponentContainerConnector
implements DirectionalManagedLayout {
* the space available.
*/
if (uidl.hasAttribute("colfooters")) {
- getWidget().showColFooters = uidl
- .getBooleanAttribute("colfooters");
+ getWidget().showColFooters = uidl.getBooleanAttribute("colfooters");
}
- getWidget().tFoot
- .setVisible(getWidget().showColFooters);
+ getWidget().tFoot.setVisible(getWidget().showColFooters);
super.updateFromUIDL(uidl, client);
if (!isRealUpdate(uidl)) {
getWidget().updateSelectionProperties(uidl, getState());
if (uidl.hasAttribute("alb")) {
- getWidget().bodyActionKeys = uidl
- .getStringArrayAttribute("alb");
+ getWidget().bodyActionKeys = uidl.getStringArrayAttribute("alb");
} else {
// Need to clear the actions if the action handlers have been
// removed
getWidget().setCacheRateFromUIDL(uidl);
- getWidget().recalcWidths = uidl
- .hasAttribute("recalcWidths");
+ getWidget().recalcWidths = uidl.hasAttribute("recalcWidths");
if (getWidget().recalcWidths) {
getWidget().tHead.clear();
getWidget().tFoot.clear();
getWidget().updateFirstVisibleAndScrollIfNeeded(uidl);
- getWidget().showRowHeaders = uidl
- .getBooleanAttribute("rowheaders");
- getWidget().showColHeaders = uidl
- .getBooleanAttribute("colheaders");
+ getWidget().showRowHeaders = uidl.getBooleanAttribute("rowheaders");
+ getWidget().showColHeaders = uidl.getBooleanAttribute("colheaders");
getWidget().updateSortingProperties(uidl);
uidl.getIntAttribute("firstrow"),
uidl.getIntAttribute("rows"));
if (getWidget().headerChangedDuringUpdate) {
- getWidget().triggerLazyColumnAdjustment(
- true);
- } else if (!getWidget()
- .isScrollPositionVisible()
+ getWidget().triggerLazyColumnAdjustment(true);
+ } else if (!getWidget().isScrollPositionVisible()
|| totalRowsChanged
|| getWidget().lastRenderedHeight != getWidget().scrollBody
.getOffsetHeight()) {
}
if (!getWidget().isSelectable()) {
- getWidget().scrollBody
- .addStyleName(VScrollTable.CLASSNAME + "-body-noselection");
+ getWidget().scrollBody.addStyleName(VScrollTable.CLASSNAME
+ + "-body-noselection");
} else {
- getWidget().scrollBody
- .removeStyleName(VScrollTable.CLASSNAME
- + "-body-noselection");
+ getWidget().scrollBody.removeStyleName(VScrollTable.CLASSNAME
+ + "-body-noselection");
}
getWidget().hideScrollPositionAnnotation();
getWidget().immediate = getState().isImmediate();
- getWidget().listenTextChangeEvents = client
- .hasEventListeners(this, "ie");
+ getWidget().listenTextChangeEvents = client.hasEventListeners(this,
+ "ie");
if (getWidget().listenTextChangeEvents) {
getWidget().textChangeEventMode = uidl
.getStringAttribute(VTextField.ATTR_TEXTCHANGE_EVENTMODE);
}
}
getWidget().sinkEvents(VTextField.TEXTCHANGE_EVENTS);
- getWidget().attachCutEventListener(
- getWidget().getElement());
+ getWidget().attachCutEventListener(getWidget().getElement());
}
if (uidl.hasAttribute("cols")) {
getWidget().formatStr = null;
}
if (uidl.hasAttribute("format")) {
- getWidget().formatStr = uidl
- .getStringAttribute("format");
+ getWidget().formatStr = uidl.getStringAttribute("format");
}
getWidget().inputPrompt = uidl
getWidget().buildDate();
// not a FocusWidget -> needs own tabindex handling
if (uidl.hasAttribute("tabindex")) {
- getWidget().text.setTabIndex(uidl
- .getIntAttribute("tabindex"));
+ getWidget().text.setTabIndex(uidl.getIntAttribute("tabindex"));
}
if (getWidget().readonly) {
.getBooleanAttribute("nullselect");
if (uidl.hasAttribute("alb")) {
- getWidget().bodyActionKeys = uidl
- .getStringArrayAttribute("alb");
+ getWidget().bodyActionKeys = uidl.getStringArrayAttribute("alb");
}
getWidget().body.clear();
.getIntAttribute("multiselectmode");
}
- getWidget().selectedIds = uidl
- .getStringArrayVariableAsSet("selected");
+ getWidget().selectedIds = uidl.getStringArrayVariableAsSet("selected");
// Update lastSelection and focusedNode to point to *actual* nodes again
// after the old ones have been cleared from the body. This fixes focus
// and keyboard navigation issues as described in #7057 and other
// tickets.
if (getWidget().lastSelection != null) {
- getWidget().lastSelection = getWidget()
- .getNodeByKey(getWidget().lastSelection.key);
+ getWidget().lastSelection = getWidget().getNodeByKey(
+ getWidget().lastSelection.key);
}
if (getWidget().focusedNode != null) {
getWidget().setFocusedNode(
- getWidget().getNodeByKey(
- getWidget().focusedNode.key));
+ getWidget().getNodeByKey(getWidget().focusedNode.key));
}
if (getWidget().lastSelection == null
&& !getWidget().selectedIds.isEmpty()) {
getWidget().setFocusedNode(
getWidget().getNodeByKey(
- getWidget().selectedIds.iterator()
- .next()));
+ getWidget().selectedIds.iterator().next()));
getWidget().focusedNode.setFocused(false);
}
getWidget().uidlTree.removeFromParent();
}
- getWidget().uidlTree = new VUIDLBrowser(uidl,
- client.getConfiguration());
+ getWidget().uidlTree = new VUIDLBrowser(uidl, client.getConfiguration());
getWidget().uidlTree.open(true);
getWidget().uidlTree.setText("Unrendered UIDL");
getWidget().panel.add(getWidget().uidlTree);
} else {
getWidget().submitButton.setVisible(false);
}
- getWidget().fu.setName(getWidget().paintableId
- + "_file");
+ getWidget().fu.setName(getWidget().paintableId + "_file");
if (getState().isDisabled() || getState().isReadOnly()) {
getWidget().disableUpload();
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class VAbsoluteLayout extends ComplexPanel {
// child may need relative size adjustment if wrapper details
// have changed this could be optimized (check if wrapper size
// has changed)
- client.handleComponentRelativeSize(paintable
- .getWidget());
+ client.handleComponentRelativeSize(paintable.getWidget());
}
}
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.RenderInformation;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class VAccordion extends VTabsheetBase {
}
public void setContent(UIDL contentUidl) {
- final ComponentConnector newPntbl = client.getPaintable(contentUidl);
+ final ComponentConnector newPntbl = client
+ .getPaintable(contentUidl);
Widget newWidget = newPntbl.getWidget();
if (getChildWidget() == null) {
add(newWidget, content);
* The size of a cached, relative sized component must be
* updated to report correct size.
*/
- client.handleComponentRelativeSize(newPntbl
- .getWidget());
+ client.handleComponentRelativeSize(newPntbl.getWidget());
}
if (isOpen() && isDynamicHeight()) {
setHeightFromWidget();
private int top;
- private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor(
- 100, new ScheduledCommand() {
+ private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor(100,
+ new ScheduledCommand() {
public void execute() {
imagesLoaded();
}
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.StyleConstants;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ValueMap;
public class VCssLayout extends SimplePanel {
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.VCaptionWrapper;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
/**
* Custom Layout implements complex layout defined with HTML template.
import com.google.gwt.xhr.client.ReadyStateChangeHandler;
import com.google.gwt.xhr.client.XMLHttpRequest;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.Connector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.RenderInformation;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.Connector;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.VTooltip;
import com.vaadin.terminal.gwt.client.ValueMap;
import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
import com.google.gwt.user.client.ui.HTML;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
public class VEmbedded extends HTML {
public static String CLASSNAME = "v-embedded";
import com.google.gwt.user.client.ui.TextBox;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ComponentState;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.VTooltip;
/**
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ComponentState;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.StyleConstants;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.VTooltip;
/**
}
public void updateCaption(ComponentConnector paintable, UIDL uidl) {
- final Caption c = widgetToCaption.get(paintable
- .getWidget());
+ final Caption c = widgetToCaption.get(paintable.getWidget());
if (c != null) {
c.updateCaption(uidl, paintable.getState());
}
- final ErrorFlag e = widgetToError.get(paintable
- .getWidget());
+ final ErrorFlag e = widgetToError.get(paintable.getWidget());
if (e != null) {
e.updateFromUIDL(uidl, paintable);
}
* return null
* @param client
*/
- public Caption(ComponentConnector component, ApplicationConnection client) {
+ public Caption(ComponentConnector component,
+ ApplicationConnection client) {
super();
this.client = client;
owner = component;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.LayoutManager;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
-import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
import com.vaadin.terminal.gwt.client.ui.layout.ComponentConnectorLayoutSlot;
+import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
public class VGridLayout extends ComplexPanel {
ComponentConnector paintable = client.getPaintable(childUidl);
if (slot == null || slot.getPaintable() != paintable) {
- slot = new ComponentConnectorLayoutSlot(CLASSNAME, paintable);
+ slot = new ComponentConnectorLayoutSlot(CLASSNAME,
+ paintable);
Element slotWrapper = slot.getWrapperElement();
getElement().appendChild(slotWrapper);
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.SimplePanel;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner,
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.Container;
import com.vaadin.terminal.gwt.client.RenderInformation.Size;
import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaptionWrapper;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.VTooltip;
import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ComponentState;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.TooltipInfo;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.VTooltip;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
void purgeUnregistryBag() {
for (Iterator<Panel> iterator = lazyUnregistryBag.iterator(); iterator
.hasNext();) {
- ConnectorMap.get(client)
- .unregisterChildConnectors(iterator.next());
+ ConnectorMap.get(client).unregisterChildConnectors(iterator.next());
}
lazyUnregistryBag.clear();
}
handleCaptionEvent(event);
boolean stopPropagation = true;
if (event.getTypeInt() == Event.ONCONTEXTMENU
- && !client.hasEventListeners(
- VScrollTable.this, HEADER_CLICK_EVENT_ID)) {
+ && !client.hasEventListeners(VScrollTable.this,
+ HEADER_CLICK_EVENT_ID)) {
// Prevent showing the browser's context menu only when
// there is a header click listener.
stopPropagation = false;
final VScrollTableRow toBeRemoved = (VScrollTableRow) renderedRows
.get(index);
// Unregister row tooltip
- client.registerTooltip(VScrollTable.this,
- toBeRemoved.getElement(), null);
+ client.registerTooltip(VScrollTable.this, toBeRemoved.getElement(),
+ null);
for (int i = 0; i < toBeRemoved.getElement().getChildCount(); i++) {
// Unregister cell tooltips
Element td = toBeRemoved.getElement().getChild(i).cast();
String rowDescription = uidl.getStringAttribute("rowdescr");
if (rowDescription != null && !rowDescription.equals("")) {
TooltipInfo info = new TooltipInfo(rowDescription);
- client.registerTooltip(VScrollTable.this, rowElement,
- info);
+ client.registerTooltip(VScrollTable.this, rowElement, info);
} else {
// Remove possibly previously set tooltip
- client.registerTooltip(VScrollTable.this, rowElement,
- null);
+ client.registerTooltip(VScrollTable.this, rowElement, null);
}
tHead.getColumnAlignments();
final ComponentConnector cellContent = client
.getPaintable((UIDL) cell);
- addCell(uidl, cellContent.getWidget(),
- aligns[col++], style, sorted);
+ addCell(uidl, cellContent.getWidget(), aligns[col++],
+ style, sorted);
paintComponent(cellContent, (UIDL) cell);
}
}
if (ConnectorMap.get(client).getWidgetTooltipInfo(
VScrollTable.this, target) != null) {
// Cell has description, use it
- client.handleTooltipEvent(event,
- VScrollTable.this, target);
+ client.handleTooltipEvent(event, VScrollTable.this,
+ target);
} else {
// Cell might have row description, use row
// description
- client.handleTooltipEvent(event,
- VScrollTable.this,
+ client.handleTooltipEvent(event, VScrollTable.this,
target.getParentElement());
}
}
} else {
// Table row (tr)
- client.handleTooltipEvent(event, VScrollTable.this,
- target);
+ client.handleTooltipEvent(event, VScrollTable.this, target);
}
}
showContextMenu(event);
if (enabled
&& (actionKeys != null || client
- .hasEventListeners(
- VScrollTable.this,
+ .hasEventListeners(VScrollTable.this,
ITEM_CLICK_EVENT_ID))) {
/*
* Prevent browser context menu only if there are
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.ContainerResizedListener;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ComponentState;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.TooltipInfo;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.label.VLabel;
public class VTabsheet extends VTabsheetBase {
if (uidl.hasAttribute(AbstractComponentConnector.ATTRIBUTE_ERROR)) {
tooltipInfo.setErrorUidl(uidl.getErrors());
}
- client.registerTooltip(getTabsheet(), getElement(),
- tooltipInfo);
+ client.registerTooltip(getTabsheet(), getElement(), tooltipInfo);
} else {
client.registerTooltip(getTabsheet(), getElement(), null);
}
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.UIDL;
abstract class VTabsheetBase extends ComplexPanel {
setPrompting(false);
}
if (getClient() != null
- && getClient().hasEventListeners(
- VTextualDate.this, EventId.FOCUS)) {
+ && getClient().hasEventListeners(VTextualDate.this,
+ EventId.FOCUS)) {
getClient()
.updateVariable(getId(), EventId.FOCUS, "", true);
}
text.setText(readonly ? "" : inputPrompt);
}
if (getClient() != null
- && getClient().hasEventListeners(
- VTextualDate.this, EventId.BLUR)) {
+ && getClient().hasEventListeners(VTextualDate.this,
+ EventId.BLUR)) {
getClient().updateVariable(getId(), EventId.BLUR, "", true);
}
}
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ConnectorMap;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.VTooltip;
import com.vaadin.terminal.gwt.client.ui.dd.DDUtil;
import com.vaadin.terminal.gwt.client.ui.dd.VAbstractDropHandler;
final boolean inCaption = target == nodeCaptionSpan
|| (icon != null && target == icon.getElement());
if (inCaption
- && client.hasEventListeners(VTree.this,
- ITEM_CLICK_EVENT_ID)
+ && client
+ .hasEventListeners(VTree.this, ITEM_CLICK_EVENT_ID)
&& (type == Event.ONDBLCLICK || type == Event.ONMOUSEUP)) {
fireClick(event);
import com.google.gwt.user.client.ui.SimplePanel;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.VConsole;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
/**
public void execute() {
final ComponentConnector paintable = (ComponentConnector) uidl
.getPaintableAttribute("scrollTo", connection);
- paintable.getWidget().getElement()
- .scrollIntoView();
+ paintable.getWidget().getElement().scrollIntoView();
}
});
}
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.Console;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.Focusable;
import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
/**
// Update child widget dimensions
if (client != null) {
client.handleComponentRelativeSize(layout.getWidget());
- client.runDescendentsLayout((HasWidgets) layout
- .getWidget());
+ client.runDescendentsLayout((HasWidgets) layout.getWidget());
}
Util.runWebkitOverflowAutoFix(contentPanel.getElement());
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
public class WindowConnector extends AbstractComponentContainerConnector
// Workaround needed for Testing Tools (GWT generates window DOM
// slightly different in different browsers).
- DOM.setElementProperty(getWidget().closeBox, "id",
- getWidget().id + "_window_close");
+ DOM.setElementProperty(getWidget().closeBox, "id", getWidget().id
+ + "_window_close");
if (uidl.hasAttribute("invisible")) {
getWidget().hide();
if (isRealUpdate(uidl)) {
if (uidl.getBooleanAttribute("modal") != getWidget().vaadinModality) {
- getWidget().setVaadinModality(
- !getWidget().vaadinModality);
+ getWidget().setVaadinModality(!getWidget().vaadinModality);
}
if (!getWidget().isAttached()) {
getWidget().setVisible(false); // hide until
- // possible centering
+ // possible centering
getWidget().show();
}
if (uidl.getBooleanAttribute("resizable") != getWidget().resizable) {
- getWidget().setResizable(
- !getWidget().resizable);
+ getWidget().setResizable(!getWidget().resizable);
}
- getWidget().resizeLazy = uidl
- .hasAttribute(VView.RESIZE_LAZY);
+ getWidget().resizeLazy = uidl.hasAttribute(VView.RESIZE_LAZY);
- getWidget().setDraggable(
- !uidl.hasAttribute("fixedposition"));
+ getWidget().setDraggable(!uidl.hasAttribute("fixedposition"));
// Caption must be set before required header size is measured. If
// the caption attribute is missing the caption should be cleared.
if (getWidget().layout != lo) {
// remove old
client.unregisterPaintable(getWidget().layout);
- getWidget().contentPanel
- .remove(getWidget().layout
- .getWidget());
+ getWidget().contentPanel.remove(getWidget().layout.getWidget());
// add new
if (!showingUrl) {
- getWidget().contentPanel.setWidget(lo
- .getWidget());
+ getWidget().contentPanel.setWidget(lo.getWidget());
}
getWidget().layout = lo;
}
} else if (!showingUrl) {
- getWidget().contentPanel.setWidget(lo
- .getWidget());
+ getWidget().contentPanel.setWidget(lo.getWidget());
getWidget().layout = lo;
}
getWidget().layoutRelativeHeight = uidl
.hasAttribute("layoutRelativeHeight");
- if (getWidget().dynamicWidth
- && getWidget().layoutRelativeWidth) {
+ if (getWidget().dynamicWidth && getWidget().layoutRelativeWidth) {
/*
* Relative layout width, fix window width before rendering (width
* according to caption)
}
getWidget().layout.updateFromUIDL(childUidl, client);
- if (!getWidget().dynamicHeight
- && getWidget().layoutRelativeWidth) {
+ if (!getWidget().dynamicHeight && getWidget().layoutRelativeWidth) {
/*
* Relative layout width, and fixed height. Must update the size to
* be able to take scrollbars into account (layout gets narrower
* No explicit width is set and the layout does not have relative width
* so fix the size according to the layout.
*/
- if (getWidget().dynamicWidth
- && !getWidget().layoutRelativeWidth) {
+ if (getWidget().dynamicWidth && !getWidget().layoutRelativeWidth) {
getWidget().setNaturalWidth();
}
- if (getWidget().dynamicHeight
- && getWidget().layoutRelativeHeight) {
+ if (getWidget().dynamicHeight && getWidget().layoutRelativeHeight) {
// Prevent resizing until height has been fixed
getWidget().resizable = false;
}
getWidget().shortcutHandler = new ShortcutActionHandler(
getId(), client);
}
- getWidget().shortcutHandler
- .updateActionMap(childUidl);
+ getWidget().shortcutHandler.updateActionMap(childUidl);
}
}
getWidget().setWidth(Window.getClientWidth() + "px");
sizeReduced = true;
}
- if (getWidget().getOffsetHeight() > Window
- .getClientHeight()) {
+ if (getWidget().getOffsetHeight() > Window.getClientHeight()) {
getWidget().setHeight(Window.getClientHeight() + "px");
sizeReduced = true;
}
- if (getWidget().dynamicHeight
- && getWidget().layoutRelativeHeight) {
+ if (getWidget().dynamicHeight && getWidget().layoutRelativeHeight) {
/*
* Window height is undefined, layout is 100% high so the layout
* should define the initial window height but on resize the layout
client.runDescendentsLayout(getWidget());
}
- Util.runWebkitOverflowAutoFix(getWidget().contentPanel
- .getElement());
+ Util.runWebkitOverflowAutoFix(getWidget().contentPanel.getElement());
client.getView().getWidget().scrollIntoView(uidl);
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ValueMap;
/**
}
private void removeActiveDragSourceStyleName(ComponentConnector dragSource) {
- dragSource.getWidget().removeStyleName(
- ACTIVE_DRAG_SOURCE_STYLENAME);
+ dragSource.getWidget().removeStyleName(ACTIVE_DRAG_SOURCE_STYLENAME);
}
private void clearDragElement() {
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
/**
* TODO Javadoc!
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
try {
- ComponentConnector component = drag.getTransferable().getDragSource();
+ ComponentConnector component = drag.getTransferable()
+ .getDragSource();
int c = configuration.getIntAttribute("c");
for (int i = 0; i < c; i++) {
String requiredPid = configuration
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
final public class VIsOverId extends VAcceptCriterion {
*/
package com.vaadin.terminal.gwt.client.ui.dd;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.UIDL;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
final public class VItemIdIs extends VAcceptCriterion {
VDropHandler currentDropHandler = VDragAndDropManager.get()
.getCurrentDropHandler();
String pid2 = ConnectorMap.get(
- currentDropHandler.getApplicationConnection()).getConnectorId(
- dragSource);
+ currentDropHandler.getApplicationConnection())
+ .getConnectorId(dragSource);
if (pid2.equals(pid)) {
Object searchedId = drag.getTransferable().getData("itemId");
String[] stringArrayAttribute = configuration
@Override
protected boolean accept(VDragEvent drag, UIDL configuration) {
ComponentConnector dragSource = drag.getTransferable().getDragSource();
- ComponentConnector paintable = VDragAndDropManager.get().getCurrentDropHandler()
- .getPaintable();
+ ComponentConnector paintable = VDragAndDropManager.get()
+ .getCurrentDropHandler().getPaintable();
return paintable == dragSource;
}
public static final String CLASSNAME = "v-label";
private static final String CLASSNAME_UNDEFINED_WIDTH = "v-label-undef-w";
-
+
private ApplicationConnection connection;
public VLabel() {
*/
package com.vaadin.terminal.gwt.client.ui.layout;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.LayoutManager;
import com.vaadin.terminal.gwt.client.VCaption;
-import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.ManagedLayout;
public class ComponentConnectorLayoutSlot extends VLayoutSlot {
final ComponentConnector paintable;
private LayoutManager layoutManager;
- public ComponentConnectorLayoutSlot(String baseClassName, ComponentConnector paintable) {
+ public ComponentConnectorLayoutSlot(String baseClassName,
+ ComponentConnector paintable) {
super(baseClassName, paintable.getWidget());
this.paintable = paintable;
layoutManager = paintable.getLayoutManager();
@Override
public int getWidgetHeight() {
- return layoutManager.getOuterHeight(paintable.getWidget()
- .getElement());
+ return layoutManager.getOuterHeight(paintable.getWidget().getElement());
}
@Override
public int getWidgetWidth() {
- return layoutManager.getOuterWidth(paintable.getWidget()
- .getElement());
+ return layoutManager.getOuterWidth(paintable.getWidget().getElement());
}
@Override
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
-import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ConnectorMap;
+import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.Field;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner;
* A server side component sends its state to the client in a paint request (see
* {@link Paintable} and {@link PaintTarget} on the server side). The client
* widget receives these paint requests as calls to
- * {@link com.vaadin.terminal.gwt.client.ComponentConnector#updateFromUIDL()}. The
- * client component communicates back to the server by sending a list of
+ * {@link com.vaadin.terminal.gwt.client.ComponentConnector#updateFromUIDL()}.
+ * The client component communicates back to the server by sending a list of
* variable changes (see {@link ApplicationConnection#updateVariable()} and
* {@link VariableOwner#changeVariables(Object, Map)}).
*
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
import com.google.gwt.user.rebind.SourceWriter;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.communication.MethodInvocation;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
import com.vaadin.terminal.gwt.client.communication.ServerRpc.InitializableClientToServerRpc;
-import com.vaadin.terminal.gwt.client.communication.MethodInvocation;
/**
* GWT generator that creates client side proxy classes for making RPC calls
* from the client to the server.
*
- * GWT.create() calls for interfaces extending {@link ServerRpc} are
- * affected, and a proxy implementation is created. Note that the init(...)
- * method of the proxy must be called before the proxy is used.
+ * GWT.create() calls for interfaces extending {@link ServerRpc} are affected,
+ * and a proxy implementation is created. Note that the init(...) method of the
+ * proxy must be called before the proxy is used.
*
* @since 7.0
*/
// Hide the error indicator if needed
if (shouldHideErrors()) {
- target.addAttribute(AbstractComponentConnector.ATTRIBUTE_HIDEERRORS,
- true);
+ target.addAttribute(
+ AbstractComponentConnector.ATTRIBUTE_HIDEERRORS, true);
}
}
@Override
public void addComponent(Component c) {
// Add to components before calling super.addComponent
- // so that it is available to AttachListeners
+ // so that it is available to AttachListeners
components.add(c);
try {
super.addComponent(c);
public void addComponentAsFirst(Component c) {
// If c is already in this, we must remove it before proceeding
// see ticket #7668
- if(c.getParent() == this) {
+ if (c.getParent() == this) {
removeComponent(c);
}
components.addFirst(c);
public void addComponent(Component c, int index) {
// If c is already in this, we must remove it before proceeding
// see ticket #7668
- if(c.getParent() == this) {
+ if (c.getParent() == this) {
// When c is removed, all components after it are shifted down
- if(index > getComponentIndex(c)) {
+ if (index > getComponentIndex(c)) {
index--;
}
removeComponent(c);
import com.vaadin.terminal.gwt.client.ui.dd.VIsOverId;
import com.vaadin.terminal.gwt.client.ui.dd.VItemIdIs;
import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
-import com.vaadin.ui.AbstractSelect.ItemCaptionMode;
/**
* <p>
* Notifies the component that it is detached from the application.
*
* <p>
- * The {@link #getApplication()} and {@link #getRoot()} methods might
- * return <code>null</code> after this method is called.
+ * The {@link #getApplication()} and {@link #getRoot()} methods might return
+ * <code>null</code> after this method is called.
* </p>
*
* <p>
/**
* TODO document
+ *
* @author Vaadin Ltd.
*
* @param T