+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui;
-
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-
-public interface ClickRPC extends ServerRpc {
- /**
- * Called when a click event has occurred and there are server side
- * listeners for the event.
- *
- * @param mouseDetails
- * Details about the mouse when the event took place
- */
- public void click(MouseEventDetails mouseDetails);
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui;
+
+import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+
+public interface ClickRpc extends ServerRpc {
+ /**
+ * Called when a click event has occurred and there are server side
+ * listeners for the event.
+ *
+ * @param mouseDetails
+ * Details about the mouse when the event took place
+ */
+ public void click(MouseEventDetails mouseDetails);
+}
\ No newline at end of file
getLayoutClickRPC().layoutClick(mouseDetails, getChildComponent(event));
}
- protected abstract LayoutClickRPC getLayoutClickRPC();
+ protected abstract LayoutClickRpc getLayoutClickRPC();
}
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui;
-
-import com.vaadin.terminal.gwt.client.Connector;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-
-public interface LayoutClickRPC extends ServerRpc {
- /**
- * Called when a layout click event has occurred and there are server side
- * listeners for the event.
- *
- * @param mouseDetails
- * Details about the mouse when the event took place
- * @param clickedConnector
- * The child component that was the target of the event
- */
- public void layoutClick(MouseEventDetails mouseDetails,
- Connector clickedConnector);
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui;
+
+import com.vaadin.terminal.gwt.client.Connector;
+import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+
+public interface LayoutClickRpc extends ServerRpc {
+ /**
+ * Called when a layout click event has occurred and there are server side
+ * listeners for the event.
+ *
+ * @param mouseDetails
+ * Details about the mouse when the event took place
+ * @param clickedConnector
+ * The child component that was the target of the event
+ */
+ public void layoutClick(MouseEventDetails mouseDetails,
+ Connector clickedConnector);
+}
\ No newline at end of file
import com.vaadin.terminal.gwt.client.ui.AbstractComponentContainerConnector;
import com.vaadin.terminal.gwt.client.ui.Connect;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
import com.vaadin.terminal.gwt.client.ui.absolutelayout.VAbsoluteLayout.AbsoluteWrapper;
import com.vaadin.ui.AbsoluteLayout;
}
@Override
- protected LayoutClickRPC getLayoutClickRPC() {
+ protected LayoutClickRpc getLayoutClickRPC() {
return rpc;
};
};
- private AbsoluteLayoutServerRPC rpc;
+ private AbsoluteLayoutServerRpc rpc;
private Map<String, AbsoluteWrapper> connectorIdToComponentWrapper = new HashMap<String, AbsoluteWrapper>();
@Override
protected void init() {
super.init();
- rpc = RpcProxy.create(AbsoluteLayoutServerRPC.class, this);
+ rpc = RpcProxy.create(AbsoluteLayoutServerRpc.class, this);
}
/**
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.absolutelayout;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
-
-public interface AbsoluteLayoutServerRPC extends LayoutClickRPC, ServerRpc {
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.absolutelayout;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
+
+public interface AbsoluteLayoutServerRpc extends LayoutClickRpc, ServerRpc {
+
+}
\ No newline at end of file
import com.vaadin.terminal.gwt.client.ui.AbstractLayoutConnector;
import com.vaadin.terminal.gwt.client.ui.Connect;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
import com.vaadin.terminal.gwt.client.ui.VMarginInfo;
import com.vaadin.terminal.gwt.client.ui.csslayout.VCssLayout.FlowPane;
import com.vaadin.ui.CssLayout;
}
@Override
- protected LayoutClickRPC getLayoutClickRPC() {
+ protected LayoutClickRpc getLayoutClickRPC() {
return rpc;
};
};
- private CssLayoutServerRPC rpc;
+ private CssLayoutServerRpc rpc;
private Map<ComponentConnector, VCaption> childToCaption = new HashMap<ComponentConnector, VCaption>();
@Override
protected void init() {
super.init();
- rpc = RpcProxy.create(CssLayoutServerRPC.class, this);
+ rpc = RpcProxy.create(CssLayoutServerRpc.class, this);
}
@Override
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.csslayout;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
-
-public interface CssLayoutServerRPC extends LayoutClickRPC, ServerRpc {
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.csslayout;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
+
+public interface CssLayoutServerRpc extends LayoutClickRpc, ServerRpc {
+
+}
\ No newline at end of file
public static final String ALTERNATE_TEXT = "alt";
- EmbeddedServerRPC rpc;
+ EmbeddedServerRpc rpc;
@Override
protected void init() {
super.init();
- rpc = RpcProxy.create(EmbeddedServerRPC.class, this);
+ rpc = RpcProxy.create(EmbeddedServerRpc.class, this);
}
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.embedded;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.ClickRPC;
-
-public interface EmbeddedServerRPC extends ClickRPC, ServerRpc {
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.embedded;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.ClickRpc;
+
+public interface EmbeddedServerRpc extends ClickRpc, ServerRpc {
+}
\ No newline at end of file
import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;
import com.vaadin.terminal.gwt.client.ui.Connect;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
import com.vaadin.terminal.gwt.client.ui.VMarginInfo;
import com.vaadin.terminal.gwt.client.ui.gridlayout.VGridLayout.Cell;
import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
}
@Override
- protected LayoutClickRPC getLayoutClickRPC() {
+ protected LayoutClickRpc getLayoutClickRPC() {
return rpc;
};
};
- private GridLayoutServerRPC rpc;
+ private GridLayoutServerRpc rpc;
private boolean needCaptionUpdate = false;
@Override
public void init() {
- rpc = RpcProxy.create(GridLayoutServerRPC.class, this);
+ rpc = RpcProxy.create(GridLayoutServerRpc.class, this);
getLayoutManager().registerDependency(this,
getWidget().spacingMeasureElement);
}
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.gridlayout;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
-
-public interface GridLayoutServerRPC extends LayoutClickRPC, ServerRpc {
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.gridlayout;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
+
+public interface GridLayoutServerRpc extends LayoutClickRpc, ServerRpc {
+
+}
\ No newline at end of file
import com.vaadin.terminal.gwt.client.ui.AbstractLayoutConnector;
import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
import com.vaadin.terminal.gwt.client.ui.VMarginInfo;
import com.vaadin.terminal.gwt.client.ui.layout.ComponentConnectorLayoutSlot;
import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
public abstract class AbstractOrderedLayoutConnector extends
AbstractLayoutConnector implements Paintable, DirectionalManagedLayout {
- AbstractOrderedLayoutServerRPC rpc;
+ AbstractOrderedLayoutServerRpc rpc;
private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
this) {
}
@Override
- protected LayoutClickRPC getLayoutClickRPC() {
+ protected LayoutClickRpc getLayoutClickRPC() {
return rpc;
};
@Override
public void init() {
- rpc = RpcProxy.create(AbstractOrderedLayoutServerRPC.class, this);
+ rpc = RpcProxy.create(AbstractOrderedLayoutServerRpc.class, this);
getLayoutManager().registerDependency(this,
getWidget().spacingMeasureElement);
}
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.orderedlayout;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.LayoutClickRPC;
-
-public interface AbstractOrderedLayoutServerRPC extends LayoutClickRPC,
- ServerRpc {
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.orderedlayout;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.LayoutClickRpc;
+
+public interface AbstractOrderedLayoutServerRpc extends LayoutClickRpc,
+ ServerRpc {
+
+}
\ No newline at end of file
private Integer uidlScrollLeft;
- private PanelServerRPC rpc;
+ private PanelServerRpc rpc;
@Override
public void init() {
- rpc = RpcProxy.create(PanelServerRPC.class, this);
+ rpc = RpcProxy.create(PanelServerRpc.class, this);
VPanel panel = getWidget();
LayoutManager layoutManager = getLayoutManager();
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.panel;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.ClickRPC;
-
-public interface PanelServerRPC extends ClickRPC, ServerRpc {
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.panel;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.ClickRpc;
+
+public interface PanelServerRpc extends ClickRpc, ServerRpc {
+
+}
\ No newline at end of file
public class RootConnector extends AbstractComponentContainerConnector
implements Paintable, MayScrollChildren {
- private RootServerRPC rpc = RpcProxy.create(RootServerRPC.class, this);
+ private RootServerRpc rpc = RpcProxy.create(RootServerRpc.class, this);
private HandlerRegistration childStateChangeHandlerRegistration;
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.root;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.ClickRPC;
-
-public interface RootServerRPC extends ClickRPC, ServerRpc {
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.root;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.ClickRpc;
+
+public interface RootServerRpc extends ClickRpc, ServerRpc {
+
+}
\ No newline at end of file
public abstract class AbstractSplitPanelConnector extends
AbstractComponentContainerConnector implements SimpleManagedLayout {
- private AbstractSplitPanelRPC rpc;
+ private AbstractSplitPanelRpc rpc;
@Override
protected void init() {
super.init();
- rpc = RpcProxy.create(AbstractSplitPanelRPC.class, this);
+ rpc = RpcProxy.create(AbstractSplitPanelRpc.class, this);
// TODO Remove
getWidget().client = getConnection();
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.splitpanel;
-
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-
-public interface AbstractSplitPanelRPC extends ServerRpc {
-
- /**
- * Called when the position has been updated by the user.
- *
- * @param position
- * The new position in % if the current unit is %, in px
- * otherwise
- */
- public void setSplitterPosition(float position);
-
- /**
- * Called when a click event has occurred on the splitter.
- *
- * @param mouseDetails
- * Details about the mouse when the event took place
- */
- public void splitterClick(MouseEventDetails mouseDetails);
-
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.splitpanel;
+
+import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+
+public interface AbstractSplitPanelRpc extends ServerRpc {
+
+ /**
+ * Called when the position has been updated by the user.
+ *
+ * @param position
+ * The new position in % if the current unit is %, in px
+ * otherwise
+ */
+ public void setSplitterPosition(float position);
+
+ /**
+ * Called when a click event has occurred on the splitter.
+ *
+ * @param mouseDetails
+ * Details about the mouse when the event took place
+ */
+ public void splitterClick(MouseEventDetails mouseDetails);
+
+}
\ No newline at end of file
}
};
- private WindowServerRPC rpc;
+ private WindowServerRpc rpc;
boolean minWidthChecked = false;
@Override
protected void init() {
super.init();
- rpc = RpcProxy.create(WindowServerRPC.class, this);
+ rpc = RpcProxy.create(WindowServerRpc.class, this);
getLayoutManager().registerDependency(this,
getWidget().contentPanel.getElement());
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.client.ui.window;
-
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-import com.vaadin.terminal.gwt.client.ui.ClickRPC;
-
-public interface WindowServerRPC extends ClickRPC, ServerRpc {
-}
\ No newline at end of file
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui.window;
+
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.ClickRpc;
+
+public interface WindowServerRpc extends ClickRpc, ServerRpc {
+}
\ No newline at end of file
continue;
}
- if (invocation instanceof ServerRPCMethodInvocation) {
+ if (invocation instanceof ServerRpcMethodInvocation) {
ServerRpcManager.applyInvocation(connector,
- (ServerRPCMethodInvocation) invocation);
+ (ServerRpcMethodInvocation) invocation);
} else {
// All code below is for legacy variable changes
}
}
- private ServerRPCMethodInvocation parseServerRpcInvocation(
+ private ServerRpcMethodInvocation parseServerRpcInvocation(
String connectorId, String interfaceName, String methodName,
JSONArray parametersJson) throws JSONException {
- ServerRPCMethodInvocation invocation = new ServerRPCMethodInvocation(
+ ServerRpcMethodInvocation invocation = new ServerRpcMethodInvocation(
connectorId, interfaceName, methodName, parametersJson.length());
Object[] parameters = new Object[parametersJson.length()];
* @since 7.0
*/
public interface RpcManager extends Serializable {
- public void applyInvocation(ServerRPCMethodInvocation invocation);
+ public void applyInvocation(ServerRpcMethodInvocation invocation);
}
+++ /dev/null
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-package com.vaadin.terminal.gwt.server;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import com.vaadin.terminal.gwt.client.communication.MethodInvocation;
-import com.vaadin.terminal.gwt.client.communication.ServerRpc;
-
-public class ServerRPCMethodInvocation extends MethodInvocation {
-
- private static final Map<String, Method> invocationMethodCache = new ConcurrentHashMap<String, Method>(
- 128, 0.75f, 1);
-
- private final Method method;
-
- private Class<? extends ServerRpc> interfaceClass;
-
- public ServerRPCMethodInvocation(String connectorId, String interfaceName,
- String methodName, int parameterCount) {
- super(connectorId, interfaceName, methodName);
-
- interfaceClass = findClass();
- method = findInvocationMethod(interfaceClass, methodName,
- parameterCount);
- }
-
- private Class<? extends ServerRpc> findClass() {
- try {
- Class<?> rpcInterface = Class.forName(getInterfaceName());
- if (!ServerRpc.class.isAssignableFrom(rpcInterface)) {
- throw new IllegalArgumentException("The interface "
- + getInterfaceName() + "is not a server RPC interface.");
- }
- return (Class<? extends ServerRpc>) rpcInterface;
- } catch (ClassNotFoundException e) {
- throw new IllegalArgumentException("The server RPC interface "
- + getInterfaceName() + " could not be found", e);
- } finally {
-
- }
- }
-
- public Class<? extends ServerRpc> getInterfaceClass() {
- return interfaceClass;
- }
-
- public Method getMethod() {
- return method;
- }
-
- /**
- * Tries to find the method from the cache or alternatively by invoking
- * {@link #doFindInvocationMethod(Class, String, int)} and updating the
- * cache.
- *
- * @param targetType
- * @param methodName
- * @param parameterCount
- * @return
- */
- private Method findInvocationMethod(Class<?> targetType, String methodName,
- int parameterCount) {
- // TODO currently only using method name and number of parameters as the
- // signature
- String signature = targetType.getName() + "." + methodName + "("
- + parameterCount;
- Method invocationMethod = invocationMethodCache.get(signature);
-
- if (invocationMethod == null) {
- invocationMethod = doFindInvocationMethod(targetType, methodName,
- parameterCount);
-
- if (invocationMethod != null) {
- invocationMethodCache.put(signature, invocationMethod);
- }
- }
-
- return invocationMethod;
- }
-
- /**
- * Tries to find the method from the class by looping through available
- * methods.
- *
- * @param targetType
- * @param methodName
- * @param parameterCount
- * @return
- */
- private Method doFindInvocationMethod(Class<?> targetType,
- String methodName, int parameterCount) {
- Method[] methods = targetType.getMethods();
- for (Method method : methods) {
- Class<?>[] parameterTypes = method.getParameterTypes();
- if (method.getName().equals(methodName)
- && parameterTypes.length == parameterCount) {
- return method;
- }
- }
- return null;
- }
-
-}
* method invocation to perform
*/
public static void applyInvocation(RpcTarget target,
- ServerRPCMethodInvocation invocation) {
+ ServerRpcMethodInvocation invocation) {
RpcManager manager = target.getRpcManager(invocation
.getInterfaceClass());
if (manager != null) {
* @param invocation
* method invocation to perform
*/
- public void applyInvocation(ServerRPCMethodInvocation invocation) {
+ public void applyInvocation(ServerRpcMethodInvocation invocation) {
Method method = invocation.getMethod();
Class<?>[] parameterTypes = method.getParameterTypes();
Object[] args = new Object[parameterTypes.length];
--- /dev/null
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.server;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import com.vaadin.terminal.gwt.client.communication.MethodInvocation;
+import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+
+public class ServerRpcMethodInvocation extends MethodInvocation {
+
+ private static final Map<String, Method> invocationMethodCache = new ConcurrentHashMap<String, Method>(
+ 128, 0.75f, 1);
+
+ private final Method method;
+
+ private Class<? extends ServerRpc> interfaceClass;
+
+ public ServerRpcMethodInvocation(String connectorId, String interfaceName,
+ String methodName, int parameterCount) {
+ super(connectorId, interfaceName, methodName);
+
+ interfaceClass = findClass();
+ method = findInvocationMethod(interfaceClass, methodName,
+ parameterCount);
+ }
+
+ private Class<? extends ServerRpc> findClass() {
+ try {
+ Class<?> rpcInterface = Class.forName(getInterfaceName());
+ if (!ServerRpc.class.isAssignableFrom(rpcInterface)) {
+ throw new IllegalArgumentException("The interface "
+ + getInterfaceName() + "is not a server RPC interface.");
+ }
+ return (Class<? extends ServerRpc>) rpcInterface;
+ } catch (ClassNotFoundException e) {
+ throw new IllegalArgumentException("The server RPC interface "
+ + getInterfaceName() + " could not be found", e);
+ } finally {
+
+ }
+ }
+
+ public Class<? extends ServerRpc> getInterfaceClass() {
+ return interfaceClass;
+ }
+
+ public Method getMethod() {
+ return method;
+ }
+
+ /**
+ * Tries to find the method from the cache or alternatively by invoking
+ * {@link #doFindInvocationMethod(Class, String, int)} and updating the
+ * cache.
+ *
+ * @param targetType
+ * @param methodName
+ * @param parameterCount
+ * @return
+ */
+ private Method findInvocationMethod(Class<?> targetType, String methodName,
+ int parameterCount) {
+ // TODO currently only using method name and number of parameters as the
+ // signature
+ String signature = targetType.getName() + "." + methodName + "("
+ + parameterCount;
+ Method invocationMethod = invocationMethodCache.get(signature);
+
+ if (invocationMethod == null) {
+ invocationMethod = doFindInvocationMethod(targetType, methodName,
+ parameterCount);
+
+ if (invocationMethod != null) {
+ invocationMethodCache.put(signature, invocationMethod);
+ }
+ }
+
+ return invocationMethod;
+ }
+
+ /**
+ * Tries to find the method from the class by looping through available
+ * methods.
+ *
+ * @param targetType
+ * @param methodName
+ * @param parameterCount
+ * @return
+ */
+ private Method doFindInvocationMethod(Class<?> targetType,
+ String methodName, int parameterCount) {
+ Method[] methods = targetType.getMethods();
+ for (Method method : methods) {
+ Class<?>[] parameterTypes = method.getParameterTypes();
+ if (method.getName().equals(methodName)
+ && parameterTypes.length == parameterCount) {
+ return method;
+ }
+ }
+ return null;
+ }
+
+}
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.absolutelayout.AbsoluteLayoutServerRPC;
+import com.vaadin.terminal.gwt.client.ui.absolutelayout.AbsoluteLayoutServerRpc;
import com.vaadin.terminal.gwt.client.ui.absolutelayout.AbsoluteLayoutState;
/**
public class AbsoluteLayout extends AbstractLayout implements
LayoutClickNotifier {
- private AbsoluteLayoutServerRPC rpc = new AbsoluteLayoutServerRPC() {
+ private AbsoluteLayoutServerRpc rpc = new AbsoluteLayoutServerRpc() {
public void layoutClick(MouseEventDetails mouseDetails,
Connector clickedConnector) {
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.orderedlayout.AbstractOrderedLayoutServerRPC;
+import com.vaadin.terminal.gwt.client.ui.orderedlayout.AbstractOrderedLayoutServerRpc;
import com.vaadin.terminal.gwt.client.ui.orderedlayout.AbstractOrderedLayoutState;
@SuppressWarnings("serial")
Layout.AlignmentHandler, Layout.SpacingHandler, LayoutClickNotifier,
Vaadin6Component {
- private AbstractOrderedLayoutServerRPC rpc = new AbstractOrderedLayoutServerRPC() {
+ private AbstractOrderedLayoutServerRpc rpc = new AbstractOrderedLayoutServerRpc() {
public void layoutClick(MouseEventDetails mouseDetails,
Connector clickedConnector) {
import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.ClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.splitpanel.AbstractSplitPanelRPC;
+import com.vaadin.terminal.gwt.client.ui.splitpanel.AbstractSplitPanelRpc;
import com.vaadin.terminal.gwt.client.ui.splitpanel.AbstractSplitPanelState;
import com.vaadin.terminal.gwt.client.ui.splitpanel.AbstractSplitPanelState.SplitterState;
import com.vaadin.tools.ReflectTools;
private Unit posUnit;
- private AbstractSplitPanelRPC rpc = new AbstractSplitPanelRPC() {
+ private AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() {
public void splitterClick(MouseEventDetails mouseDetails) {
fireEvent(new SplitterClickEvent(AbstractSplitPanel.this,
import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ui.csslayout.CssLayoutServerRPC;
+import com.vaadin.terminal.gwt.client.ui.csslayout.CssLayoutServerRpc;
import com.vaadin.terminal.gwt.client.ui.csslayout.CssLayoutState;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
*/
public class CssLayout extends AbstractLayout implements LayoutClickNotifier {
- private CssLayoutServerRPC rpc = new CssLayoutServerRPC() {
+ private CssLayoutServerRpc rpc = new CssLayoutServerRpc() {
public void layoutClick(MouseEventDetails mouseDetails,
Connector clickedConnector) {
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.ClickEventHandler;
import com.vaadin.terminal.gwt.client.ui.embedded.EmbeddedConnector;
-import com.vaadin.terminal.gwt.client.ui.embedded.EmbeddedServerRPC;
+import com.vaadin.terminal.gwt.client.ui.embedded.EmbeddedServerRpc;
/**
* Component for embedding external objects.
private String altText;
- private EmbeddedServerRPC rpc = new EmbeddedServerRPC() {
+ private EmbeddedServerRpc rpc = new EmbeddedServerRpc() {
public void click(MouseEventDetails mouseDetails) {
fireEvent(new ClickEvent(Embedded.this, mouseDetails));
}
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.gridlayout.GridLayoutServerRPC;
+import com.vaadin.terminal.gwt.client.ui.gridlayout.GridLayoutServerRpc;
import com.vaadin.terminal.gwt.client.ui.gridlayout.GridLayoutState;
/**
Layout.AlignmentHandler, Layout.SpacingHandler, LayoutClickNotifier,
Vaadin6Component {
- private GridLayoutServerRPC rpc = new GridLayoutServerRPC() {
+ private GridLayoutServerRpc rpc = new GridLayoutServerRpc() {
public void layoutClick(MouseEventDetails mouseDetails,
Connector clickedConnector) {
import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.ClickEventHandler;
-import com.vaadin.terminal.gwt.client.ui.panel.PanelServerRPC;
+import com.vaadin.terminal.gwt.client.ui.panel.PanelServerRpc;
import com.vaadin.terminal.gwt.client.ui.panel.PanelState;
import com.vaadin.ui.Component.Focusable;
*/
protected ActionManager actionManager;
- private PanelServerRPC rpc = new PanelServerRPC() {
+ private PanelServerRpc rpc = new PanelServerRpc() {
public void click(MouseEventDetails mouseDetails) {
fireEvent(new ClickEvent(Panel.this, mouseDetails));
}
import com.vaadin.terminal.gwt.client.ComponentState;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.notification.VNotification;
-import com.vaadin.terminal.gwt.client.ui.root.RootServerRPC;
+import com.vaadin.terminal.gwt.client.ui.root.RootServerRpc;
import com.vaadin.terminal.gwt.client.ui.root.RootState;
import com.vaadin.terminal.gwt.client.ui.root.VRoot;
import com.vaadin.tools.ReflectTools;
private DirtyConnectorTracker dirtyConnectorTracker = new DirtyConnectorTracker(
this);
- private RootServerRPC rpc = new RootServerRPC() {
+ private RootServerRpc rpc = new RootServerRpc() {
public void click(MouseEventDetails mouseDetails) {
fireEvent(new ClickEvent(Root.this, mouseDetails));
}
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ui.window.WindowServerRPC;
+import com.vaadin.terminal.gwt.client.ui.window.WindowServerRpc;
import com.vaadin.terminal.gwt.client.ui.window.WindowState;
/**
public class Window extends Panel implements FocusNotifier, BlurNotifier,
Vaadin6Component {
- private WindowServerRPC rpc = new WindowServerRPC() {
+ private WindowServerRpc rpc = new WindowServerRpc() {
public void click(MouseEventDetails mouseDetails) {
fireEvent(new ClickEvent(Window.this, mouseDetails));