diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-06-25 16:07:03 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-06-25 16:07:03 +0300 |
commit | 086a297997e82453eb3b3e0f2dddb856d0db5bcb (patch) | |
tree | db55a924d7283da990fb186a8977b64005350c37 /src | |
parent | 4a997b3d5334d07185011f62e5508a88abc370fc (diff) | |
download | vaadin-framework-086a297997e82453eb3b3e0f2dddb856d0db5bcb.tar.gz vaadin-framework-086a297997e82453eb3b3e0f2dddb856d0db5bcb.zip |
Rename setCurrentXyz() to setCurrent() (#9029)
Diffstat (limited to 'src')
12 files changed, 25 insertions, 25 deletions
diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 3da314a11e..84a8df5053 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -2119,11 +2119,11 @@ public class Application implements Terminal.ErrorListener, Serializable { * @return the current application instance if available, otherwise * <code>null</code> * - * @see #setCurrentApplication(Application) + * @see #setCurrent(Application) * * @since 7.0 */ - public static Application getCurrentApplication() { + public static Application getCurrent() { return currentApplication.get(); } @@ -2139,12 +2139,12 @@ public class Application implements Terminal.ErrorListener, Serializable { * * @param application * - * @see #getCurrentApplication() + * @see #getCurrent() * @see ThreadLocal * * @since 7.0 */ - public static void setCurrentApplication(Application application) { + public static void setCurrent(Application application) { currentApplication.set(application); } @@ -2188,7 +2188,7 @@ public class Application implements Terminal.ErrorListener, Serializable { */ public Root getRootForRequest(WrappedRequest request) throws RootRequiresMoreInformationException { - Root root = Root.getCurrentRoot(); + Root root = Root.getCurrent(); if (root != null) { return root; } @@ -2240,7 +2240,7 @@ public class Application implements Terminal.ErrorListener, Serializable { } // Set thread local here so it is available in init - Root.setCurrentRoot(root); + Root.setCurrent(root); if (!initedRoots.contains(rootId)) { boolean initRequiresBrowserDetails = isRootPreserved() diff --git a/src/com/vaadin/data/util/converter/ConverterUtil.java b/src/com/vaadin/data/util/converter/ConverterUtil.java index 206295b293..7011496ed7 100644 --- a/src/com/vaadin/data/util/converter/ConverterUtil.java +++ b/src/com/vaadin/data/util/converter/ConverterUtil.java @@ -14,7 +14,7 @@ public class ConverterUtil implements Serializable { * Finds a converter that can convert from the given presentation type to * the given model type and back. Uses the given application to find a * {@link ConverterFactory} or, if application is null, uses the - * {@link Application#getCurrentApplication()}. + * {@link Application#getCurrent()}. * * @param <PRESENTATIONTYPE> * The presentation type @@ -35,7 +35,7 @@ public class ConverterUtil implements Serializable { Class<MODELTYPE> modelType, Application application) { Converter<PRESENTATIONTYPE, MODELTYPE> converter = null; if (application == null) { - application = Application.getCurrentApplication(); + application = Application.getCurrent(); } if (application != null) { diff --git a/src/com/vaadin/terminal/CombinedRequest.java b/src/com/vaadin/terminal/CombinedRequest.java index ccef6d8963..abf5e0412a 100644 --- a/src/com/vaadin/terminal/CombinedRequest.java +++ b/src/com/vaadin/terminal/CombinedRequest.java @@ -129,7 +129,7 @@ public class CombinedRequest implements WrappedRequest { public WebBrowser getWebBrowser() { WebApplicationContext context = (WebApplicationContext) Application - .getCurrentApplication().getContext(); + .getCurrent().getContext(); return context.getBrowser(); } }; diff --git a/src/com/vaadin/terminal/Page.java b/src/com/vaadin/terminal/Page.java index 8506e17898..e6d06a837a 100644 --- a/src/com/vaadin/terminal/Page.java +++ b/src/com/vaadin/terminal/Page.java @@ -615,7 +615,7 @@ public class Page implements Serializable { } public static Page getCurrent() { - Root currentRoot = Root.getCurrentRoot(); + Root currentRoot = Root.getCurrent(); if (currentRoot == null) { return null; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index b7be6fd394..c2f887674a 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -540,7 +540,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet if (application == null) { return; } - Application.setCurrentApplication(application); + Application.setCurrent(application); /* * Get or create an application context and an application @@ -689,8 +689,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } } finally { - Root.setCurrentRoot(null); - Application.setCurrentApplication(null); + Root.setCurrent(null); + Application.setCurrent(null); PortletSession session = request .getPortletSession(false); diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 0e548f61c8..9750c0611b 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -385,7 +385,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements if (application == null) { return; } - Application.setCurrentApplication(application); + Application.setCurrent(application); /* * Get or create a WebApplicationContext and an ApplicationManager @@ -477,8 +477,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements .onRequestEnd(request, response); } } finally { - Root.setCurrentRoot(null); - Application.setCurrentApplication(null); + Root.setCurrent(null); + Application.setCurrent(null); HttpSession session = request.getSession(false); if (session != null) { diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 1ea713b4f6..e37dfc59af 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -2194,7 +2194,7 @@ public abstract class AbstractCommunicationManager implements Serializable { // if we do not yet have a currentRoot, it should be initialized // shortly, and we should send the initial UIDL - boolean sendUIDL = Root.getCurrentRoot() == null; + boolean sendUIDL = Root.getCurrent() == null; try { CombinedRequest combinedRequest = new CombinedRequest(request); diff --git a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java index ae1fadd91b..69f033c8cd 100644 --- a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java +++ b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java @@ -83,7 +83,7 @@ public abstract class BootstrapHandler implements RequestHandler { public Root getRoot() { if (!rootFetched) { - root = Root.getCurrentRoot(); + root = Root.getCurrent(); rootFetched = true; } return root; diff --git a/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java b/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java index b6f1a192cb..0774a79990 100644 --- a/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java +++ b/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java @@ -82,7 +82,7 @@ public class WrappedHttpServletRequest extends HttpServletRequestWrapper public WebBrowser getWebBrowser() { WebApplicationContext context = (WebApplicationContext) Application - .getCurrentApplication().getContext(); + .getCurrent().getContext(); return context.getBrowser(); } }; diff --git a/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java b/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java index 3838695aa3..85d8d5c69c 100644 --- a/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java +++ b/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java @@ -130,7 +130,7 @@ public class WrappedPortletRequest implements WrappedRequest { public WebBrowser getWebBrowser() { PortletApplicationContext2 context = (PortletApplicationContext2) Application - .getCurrentApplication().getContext(); + .getCurrent().getContext(); return context.getBrowser(); } }; diff --git a/src/com/vaadin/ui/Component.java b/src/com/vaadin/ui/Component.java index 2394d0f307..81e0319880 100644 --- a/src/com/vaadin/ui/Component.java +++ b/src/com/vaadin/ui/Component.java @@ -520,7 +520,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * <p> * Getting a null value is often a problem in constructors of regular * components and in the initializers of custom composite components. A - * standard workaround is to use {@link Application#getCurrentApplication()} + * standard workaround is to use {@link Application#getCurrent()} * to retrieve the application instance that the current request relates to. * Another way is to move the problematic initialization to * {@link #attach()}, as described in the documentation of the method. diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java index 37cd646d82..7ae687be79 100644 --- a/src/com/vaadin/ui/Root.java +++ b/src/com/vaadin/ui/Root.java @@ -923,10 +923,10 @@ public abstract class Root extends AbstractComponentContainer implements * @param root * the root to register as the current root * - * @see #getCurrentRoot() + * @see #getCurrent() * @see ThreadLocal */ - public static void setCurrentRoot(Root root) { + public static void setCurrent(Root root) { currentRoot.set(root); } @@ -938,9 +938,9 @@ public abstract class Root extends AbstractComponentContainer implements * @return the current root instance if available, otherwise * <code>null</code> * - * @see #setCurrentRoot(Root) + * @see #setCurrent(Root) */ - public static Root getCurrentRoot() { + public static Root getCurrent() { return currentRoot.get(); } |