Skip to content
Browse files

Fixed the inherited case class workaround bug. Made added more descri…

…ptive deprecation warnings
  • Loading branch information...
1 parent 9275a92 commit 5b217a8c8e6592f4bd0994089b356359455d799f @dpp dpp committed Mar 3, 2011
View
9 web/webkit/src/main/scala/net/liftweb/http/LiftResponse.scala
@@ -396,9 +396,16 @@ object DoRedirectResponse {
object RedirectWithState {
def apply(uri: String, state: RedirectState, cookies: HTTPCookie*): RedirectWithState =
new RedirectWithState(uri, state, cookies :_*)
+
+ def unapply(in: Any): Option[(String, RedirectState, Seq[HTTPCookie])] =
+ in match {
+ case rdws: RedirectWithState => Some((rdws.uri, rdws.state,
+ rdws.cookies))
+ case _ => None
+ }
}
-class RedirectWithState(override val uri: String, state: RedirectState, override val cookies: HTTPCookie*) extends RedirectResponse(uri, cookies: _*)
+class RedirectWithState(override val uri: String,val state: RedirectState, override val cookies: HTTPCookie*) extends RedirectResponse(uri, cookies: _*)
object RedirectState {
def apply(f: () => Unit, msgs: (String, NoticeType.Value)*): RedirectState = new RedirectState(Full(f), msgs: _*)
View
9 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
@@ -403,6 +403,7 @@ trait LiftRules extends Factory with FormVendor with LazyLoggable {
*
* @deprecated
*/
+ @deprecated("Use the HtmlProperties")
val docType: FactoryMaker[Req => Box[String]] = new FactoryMaker( (r: Req) => r match {
case _ if S.skipDocType => Empty
case _ if S.getDocType._1 => S.getDocType._2
@@ -1088,7 +1089,7 @@ trait LiftRules extends Factory with FormVendor with LazyLoggable {
/**
* Use statelessRewrite or statefuleRewrite
*/
- @deprecated
+ @deprecated("Use statelessRewrite or statefuleRewrite")
val rewrite = statelessRewrite
/**
@@ -1525,13 +1526,15 @@ trait LiftRules extends Factory with FormVendor with LazyLoggable {
* A function to format a Date... can be replaced by a function that is user-specific
Replaced by dateTimeConverter
*/
- @deprecated @volatile var formatDate: Date => String = date => date match {case null => LiftRules.formatDate(new Date(0L)) case s => toInternetDate(s)}
+ @deprecated("Replaced by dateTimeConverter")
+ @volatile var formatDate: Date => String = date => date match {case null => LiftRules.formatDate(new Date(0L)) case s => toInternetDate(s)}
/**
* A function that parses a String into a Date... can be replaced by something that's user-specific
Replaced by dateTimeConverter
*/
- @deprecated @volatile var parseDate: String => Box[Date] = str => str match {
+ @deprecated("Replaced by dateTimeConverter")
+ @volatile var parseDate: String => Box[Date] = str => str match {
case null => Empty
case s => Helpers.toDate(s)
}
View
2 web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -1173,7 +1173,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
}
private[http] def checkRedirect(resp: LiftResponse): LiftResponse = resp match {
- case RedirectWithState(uri, state, cookies@_*) =>
+ case RedirectWithState(uri, state, cookies) =>
state.msgs.foreach(m => S.message(m._1, m._2))
notices = S.getNotices
RedirectResponse(attachRedirectFunc(uri, state.func), cookies: _*)
View
4 web/webkit/src/main/scala/net/liftweb/http/S.scala
@@ -2629,7 +2629,7 @@ for {
*
* Use fmapFunc(AFuncHolder)(String => T)
*/
- @deprecated
+ @deprecated("Use fmapFunc(AFuncHolder)(String => T)")
def mapFunc(in: AFuncHolder): String = {
mapFunc(formFuncName, in)
}
@@ -2639,7 +2639,7 @@ for {
*
* Use fmapFunc(AFuncHolder)(String => T)
*/
- @deprecated
+ @deprecated("Use fmapFunc(AFuncHolder)(String => T)")
def mapFunc(name: String, inf: AFuncHolder): String = {
addFunctionMap(name, inf)
name
View
8 web/webkit/src/main/scala/net/liftweb/http/jquery/JqSHtml.scala
@@ -32,19 +32,16 @@ import scala.xml._
/**
* This contains Html artifacts that are heavily relying on JQuery
*/
-@deprecated
+@deprecated("This contains Html artifacts that are heavily relying on JQuery")
object JqSHtml {
- @deprecated
def fadeOutErrors(duration: TimeSpan, fadeTime: TimeSpan): JsCmd = {
FadeOut(LiftRules.noticesContainerId + "_error", duration, fadeTime)
}
- @deprecated
def fadeOutWarnings(duration: TimeSpan, fadeTime: TimeSpan): JsCmd = {
FadeOut(LiftRules.noticesContainerId + "_warn", duration, fadeTime)
}
- @deprecated
def fadeOutNotices(duration: TimeSpan, fadeTime: TimeSpan): JsCmd = {
FadeOut(LiftRules.noticesContainerId + "_notice", duration, fadeTime)
}
@@ -53,7 +50,6 @@ object JqSHtml {
* Generate a JavaScript FadeOut command for the Errors screen real estate using
* the default prefade duration and fade time from JsRules
*/
- @deprecated
def fadeOutErrors(): JsCmd = {
FadeOut(LiftRules.noticesContainerId + "_error", JsRules.prefadeDuration, JsRules.fadeTime)
}
@@ -62,7 +58,6 @@ object JqSHtml {
* Generate a JavaScript FadeOut command for the Warnings screen real estate using
* the default prefade duration and fade time from JsRules
*/
- @deprecated
def fadeOutWarnings(): JsCmd = {
FadeOut(LiftRules.noticesContainerId + "_warn", JsRules.prefadeDuration, JsRules.fadeTime)
}
@@ -71,7 +66,6 @@ object JqSHtml {
* Generate a JavaScript FadeOut command for the Notices screen real estate using
* the default prefade duration and fade time from JsRules
*/
- @deprecated
def fadeOutNotices(): JsCmd = {
FadeOut(LiftRules.noticesContainerId + "_notice", JsRules.prefadeDuration, JsRules.fadeTime)
}
View
8 web/webkit/src/main/scala/net/liftweb/http/js/jquery/JqJsCmds.scala
@@ -34,15 +34,17 @@ import JsCmds._
* is deprecated clases mixing this trait with stop doing so soon and they
* will mixin JsMember instead.
*/
-@deprecated
+@deprecated(""" As JQueryRight
+is deprecated clases mixing this trait with stop doing so soon and they
+will mixin JsMember instead.""")
trait JQueryRight {
this: JsExp =>
def toJsCmd: String
}
/**
* Classes mixing JQuryLeft will soon stop doing so. Extending/Mixing JsExp will be enough
*/
-@deprecated
+@deprecated("Classes mixing JQuryLeft will soon stop doing so. Extending/Mixing JsExp will be enough")
trait JQueryLeft {
this: JsExp =>
}
@@ -453,7 +455,7 @@ object JqJsCmds {
/**
* Use SetValueAndFocus from JsCmds
*/
- @deprecated
+ @deprecated("Use SetValueAndFocus from JsCmds")
case class SetValueAndFocus(id: String, value: String) extends JsCmd {
def toJsCmd = "document.getElementById(" + id.encJs + ").value = " +
value.encJs +

0 comments on commit 5b217a8

Please sign in to comment.
Something went wrong with that request. Please try again.