forked from wocommunity/wonder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ERDDefaultCancelCreationMessageAssignment.java
75 lines (66 loc) · 3.18 KB
/
ERDDefaultCancelCreationMessageAssignment.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright (C) NetStruxr, Inc. All rights reserved.
*
* This software is published under the terms of the NetStruxr
* Public Software License version 0.5, a copy of which has been
* included with this distribution in the LICENSE.NPL file. */
package er.directtoweb.assignments.defaults;
import com.webobjects.directtoweb.D2WContext;
import com.webobjects.eocontrol.EOKeyValueUnarchiver;
import com.webobjects.foundation.NSArray;
import er.directtoweb.assignments.ERDAssignment;
import er.directtoweb.assignments.ERDLocalizableAssignmentInterface;
import er.directtoweb.assignments.ERDLocalizedAssignment;
// FIXME: Should be renamed ERDDefaultLocalizedMessageAssignment.
/**
* Message assignment used when hitting a cancel button, just a little "Are you sure?" kind of thing.<br />
* @deprecated use {@link er.directtoweb.assignments.ERDLocalizedAssignment}
*/
@Deprecated
public class ERDDefaultCancelCreationMessageAssignment extends ERDAssignment implements ERDLocalizableAssignmentInterface {
/**
* Do I need to update serialVersionUID?
* See section 5.6 <cite>Type Changes Affecting Serialization</cite> on page 51 of the
* <a href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf">Java Object Serialization Spec</a>
*/
private static final long serialVersionUID = 1L;
/** holds the array of keys this assignment depends upon */
public static final NSArray _DEPENDENT_KEYS=new NSArray("entity.name");
/**
* Static constructor required by the EOKeyValueUnarchiver
* interface. If this isn't implemented then the default
* behavior is to construct the first super class that does
* implement this method. Very lame.
* @param eokeyvalueunarchiver to be unarchived
* @return decoded assignment of this class
*/
public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver eokeyvalueunarchiver) {
ERDAssignment.logDeprecatedMessage(ERDDefaultCancelCreationMessageAssignment.class, ERDLocalizedAssignment.class);
return new ERDDefaultCancelCreationMessageAssignment(eokeyvalueunarchiver);
}
/**
* Public constructor
* @param u key-value unarchiver used when unarchiving
* from rule files.
*/
public ERDDefaultCancelCreationMessageAssignment (EOKeyValueUnarchiver u) { super(u); }
/**
* Public constructor
* @param key context key
* @param value of the assignment
*/
public ERDDefaultCancelCreationMessageAssignment (String key, Object value) { super(key,value); }
/**
* Implementation of the {@link er.directtoweb.assignments.ERDComputingAssignmentInterface}. This
* assignment depends upon the context key: "entity.name". This array
* of keys is used when constructing the
* significant keys for the passed in keyPath.
* @param keyPath to compute significant keys for.
* @return array of context keys this assignment depends upon.
*/
public NSArray dependentKeys(String keyPath) { return _DEPENDENT_KEYS; }
public Object cancelMessage(D2WContext c) {
Object value = localizedTemplateStringForKeyInContext("ERDDefaultCancelCreationMessageAssignment.cancelCreationMessage", c);
return value;
}
}