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 package org.utgenome.gwt.utgb.client.track.lib.debug;
26
27 import java.util.HashMap;
28
29 import org.utgenome.gwt.utgb.client.track.Track;
30 import org.utgenome.gwt.utgb.client.track.TrackBase;
31 import org.utgenome.gwt.utgb.client.util.BrowserInfo;
32
33 import com.google.gwt.user.client.ui.HorizontalPanel;
34 import com.google.gwt.user.client.ui.Label;
35 import com.google.gwt.user.client.ui.Widget;
36
37 public class URLQueryArgumentTrack extends TrackBase {
38 private final HorizontalPanel _panel = new HorizontalPanel();
39
40 public static TrackFactory factory() {
41 return new TrackFactory() {
42 public Track newInstance() {
43 return new URLQueryArgumentTrack();
44 }
45 };
46 }
47
48 public URLQueryArgumentTrack() {
49 super("Query Argument");
50
51 _panel.setStyleName("selector");
52 }
53
54 public Widget getWidget() {
55 return _panel;
56 }
57
58 public void draw() {
59 _panel.clear();
60
61 HashMap<String, String> requestParam = BrowserInfo.getURLQueryRequestParameters();
62 for (String key : requestParam.keySet()) {
63 String value = (String) requestParam.get(key);
64
65 Label l = new Label(key + "=" + value);
66 l.setStyleName("selector-item");
67 _panel.add(l);
68 }
69 }
70
71 }