01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.sample.showcase2.client.dd;
09:
10: import com.google.gwt.user.client.ui.HorizontalPanel;
11: import com.gwtext.client.dd.DD;
12: import com.gwtext.client.dd.DDProxy;
13: import com.gwtext.client.widgets.Panel;
14: import com.gwtext.sample.showcase2.client.SampleData;
15: import com.gwtext.sample.showcase2.client.ShowcasePanel;
16:
17: /**
18: * Example that illustrates basic Drag Drop functionality.
19: */
20: public class BasicDDSample extends ShowcasePanel {
21:
22: public String getSourceUrl() {
23: return "source/dd/BasicDDSample.java.html";
24: }
25:
26: public Panel getViewPanel() {
27: if (panel == null) {
28: panel = new Panel();
29:
30: HorizontalPanel horizontalPanel = new HorizontalPanel();
31: horizontalPanel.setSpacing(15);
32:
33: Panel draggable = new Panel();
34: draggable.setTitle("Draggable");
35: draggable.setBorder(true);
36: draggable.setWidth(200);
37: draggable.setCollapsible(true);
38: draggable.setHtml(SampleData.getShortBogusMarkup());
39:
40: Panel proxy = new Panel();
41: proxy.setTitle("Draggable with Proxy");
42: proxy.setBorder(true);
43: proxy.setWidth(200);
44: proxy.setCollapsible(true);
45: proxy.setHtml(SampleData.getShortBogusMarkup());
46:
47: DD dd = new DD(draggable);
48: DD ddProxy = new DDProxy(proxy);
49:
50: horizontalPanel.add(draggable);
51: horizontalPanel.add(proxy);
52:
53: panel.add(horizontalPanel);
54: }
55:
56: return panel;
57: }
58:
59: public String getIntro() {
60: return "<p>This is a simple example illustrating basic Drag Drop functionality. The second Panel is configred to have a Proxy when dragging.</p>";
61: }
62: }
|