summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SetStringAction.java
blob: 3a6d4167e9a736e621aa8243b03704429dcb027f (plain) (blame)
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
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SetStringAction
/*    */   extends SetPropertyAction
/*    */ {
/*    */   private String _value;
/*    */   
/*    */   public Persister trigger(Event e, Persister seqID)
/*    */   {
/* 21 */     if (useParam())
/* 22 */       this._value = param();
/* 23 */     set(this._value);
/* 24 */     return null;
/*    */   }
/*    */   
/*    */   public Object properties(int index, int offset, int mode, Object value)
/*    */     throws NoSuchPropertyException
/*    */   {
/* 30 */     Object ret = null;
/* 31 */     switch (index - offset) {
/*    */     case 0: 
/* 33 */       if (mode == 0) {
/* 34 */         ret = StringPropertyEditor.make(new Property(this, index, 
/* 35 */           "Set To"));
/* 36 */       } else if (mode == 1) {
/* 37 */         ret = this._value;
/* 38 */       } else if (mode == 2)
/* 39 */         this._value = ((String)value);
/* 40 */       break;
/*    */     default: 
/* 42 */       ret = super.properties(index, offset + 1, mode, value);
/*    */     }
/* 44 */     return ret;
/*    */   }
/*    */   
/* 47 */   private static Object classCookie = new Object();
/*    */   
/*    */   public void saveState(Saver s) throws IOException
/*    */   {
/* 51 */     s.saveVersion(1, classCookie);
/* 52 */     super.saveState(s);
/* 53 */     s.saveString(this._value);
/*    */   }
/*    */   
/*    */   public void restoreState(Restorer r) throws IOException, TooNewException
/*    */   {
/* 58 */     switch (r.restoreVersion(classCookie)) {
/*    */     case 1: 
/* 60 */       super.restoreState(r);
/* 61 */       this._value = r.restoreString();
/* 62 */       break;
/*    */     
/*    */     default: 
/* 65 */       throw new TooNewException();
/*    */     }
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetStringAction.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */