Snippet Preview
Snippet HTML Code
1
/*
2
* Copyright 2012 Google Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
* use this file except in compliance with the License. You may obtain a copy of
6
* the License at
7
8
* http://www.apache.org/licenses/LICENSE-2.0
9
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
* License for the specific language governing permissions and limitations under
14
* the License.
15
*/
16
package elemental.js.html;
17
import elemental.html.Storage;
18
19
import com.google.gwt.core.client.GWT;
20
import com.google.gwt.core.client.JavaScriptObject;
21
22
import elemental.events.*;
23
import elemental.util.*;
24
import elemental.dom.*;
25
import elemental.html.*;
26
import elemental.css.*;
27
import elemental.js.stylesheets.*;
28
import elemental.js.events.*;
29
import elemental.js.util.*;
30
import elemental.js.dom.*;
31
import elemental.js.html.*;
32
import elemental.js.css.*;
33
34
35
import java.util.Date;
36
37
public class JsStorage extends JsElementalMixinBase implements Storage {
38
protected JsStorage() {}
39
40
public final native int getLength() /*-{
41
return this.length;
42
}-*/;
43
44
public final native void clear() /*-{
45
this.clear();
46
47
48
public final native String getItem(String key) /*-{
49
return this.getItem(key);
50
51
52
public final native String key(int index) /*-{
53
return this.key(index);
54
55
56
public final native void removeItem(String key) /*-{
57
this.removeItem(key);
58
59
60
public final native void setItem(String key, String data) /*-{
61
this.setItem(key, data);
62
63
}