[kune-commits] r766 - in sandbox4/src/main/java/org/op/client: . chat

vjrj vjrj at ourproject.org
Wed May 14 02:35:24 CEST 2008


Author: vjrj
Date: 2008-05-14 02:35:16 +0200 (Wed, 14 May 2008)
New Revision: 766

Added:
   sandbox4/src/main/java/org/op/client/Sandbox.java
   sandbox4/src/main/java/org/op/client/Sandbox2.java
   sandbox4/src/main/java/org/op/client/SandboxCollapse.java
   sandbox4/src/main/java/org/op/client/SandboxTooltip.java
   sandbox4/src/main/java/org/op/client/chat/
   sandbox4/src/main/java/org/op/client/chat/DragGridConfiguration.java
   sandbox4/src/main/java/org/op/client/chat/DropGridConfiguration.java
   sandbox4/src/main/java/org/op/client/chat/UserGridDropListener.java
   sandbox4/src/main/java/org/op/client/chat/UserGridListener.java
   sandbox4/src/main/java/org/op/client/chat/XmppURI.java
Removed:
   sandbox4/src/main/java/org/op/client/Sandbox.java
   sandbox4/src/main/java/org/op/client/Sandbox3.java
Log:


Deleted: sandbox4/src/main/java/org/op/client/Sandbox.java
===================================================================
--- sandbox4/src/main/java/org/op/client/Sandbox.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/Sandbox.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -1,179 +0,0 @@
-package org.op.client;
-
-import org.op.client.DefaultBorderLayout.Position;
-
-import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
-import com.extjs.gxt.ui.client.Style.Scroll;
-import com.extjs.gxt.ui.client.widget.Button;
-import com.extjs.gxt.ui.client.widget.TabItem;
-import com.extjs.gxt.ui.client.widget.TabPanel;
-import com.extjs.gxt.ui.client.widget.Viewport;
-import com.extjs.gxt.ui.client.widget.form.TextField;
-import com.extjs.gxt.ui.client.widget.layout.FillLayout;
-import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.RootPanel;
-
-/**
- * Entry point classes define <code>onModuleLoad()</code>.
- */
-public class Sandbox implements EntryPoint {
-
-    class LabelWrapper extends Label implements View {
-        public LabelWrapper(final String text) {
-            super(text);
-        }
-    }
-
-    class MenuBarWrapper extends Composite implements View {
-        public MenuBarWrapper() {
-
-            // Make a command that we will execute from all leaves.
-            Command cmd = new Command() {
-                public void execute() {
-                    Window.alert("You selected a menu item!");
-                }
-            };
-
-            // Make some sub-menus that we will cascade from the top menu.
-            MenuBar fooMenu = new MenuBar(true);
-            fooMenu.addItem("the", cmd);
-            fooMenu.addItem("foo", cmd);
-            fooMenu.addItem("menu", cmd);
-
-            MenuBar barMenu = new MenuBar(true);
-            barMenu.addItem("the", cmd);
-            barMenu.addItem("bar", cmd);
-            barMenu.addItem("menu", cmd);
-
-            MenuBar bazMenu = new MenuBar(true);
-            bazMenu.addItem("the", cmd);
-            bazMenu.addItem("baz", cmd);
-            bazMenu.addItem("menu", cmd);
-
-            // Make a new menu bar, adding a few cascading menus to it.
-            MenuBar menu = new MenuBar();
-            menu.addItem("foo", fooMenu);
-            menu.addItem("bar", barMenu);
-            menu.addItem("baz", bazMenu);
-            initWidget(menu);
-        }
-    }
-
-    private BasicDialogForm dialog;
-    private BasicDialogExtended dialog3;
-
-    /**
-     * This is the entry point method.
-     */
-    public void onModuleLoad() {
-        Viewport vp = new Viewport();
-        // Test fit vs fill layout
-        vp.setLayout(new FillLayout(4));
-        Workspace wk = new Workspace();
-        vp.add(wk.getPanel());
-        vp.layout();
-        RootPanel.get().add(vp);
-        wk.getEntityWorkspace().addItemToContentTopBar(new MenuBarWrapper());
-        wk.getEntityWorkspace().setContainer(new LabelWrapper("Container"));
-        wk.getEntityWorkspace().setContent(new LabelWrapper("Content"));
-        wk.getEntityWorkspace().setBottom(new LabelWrapper("Bottom"));
-        wk.getEntityWorkspace().setTitle(new LabelWrapper("Title 2"));
-        wk.getEntityWorkspace().setSubtitle(new LabelWrapper("Subtitle"));
-        wk.getSiteBar().addView(new LabelWrapper("sitebar-right"));
-
-        dialog = new BasicDialogForm("Test dialog", false, Scroll.AUTO, 380, 200, null, "Join", "Cancel",
-                new BasicDialogListener() {
-                    public void onCancelButtonClick() {
-                        dialog.hide();
-                    }
-
-                    public void onFirstButtonClick() {
-                        dialog.hide();
-                    }
-                });
-
-        TextField jid = new TextField();
-        jid.setToolTip(new ToolTipConfig("Information", "Prints the current document"));
-        jid.setFieldLabel("Jabber id");
-        dialog.addField(jid);
-        dialog.show();
-
-        BasicDialog dialog2 = new BasicDialog("Hellooooo", false);
-        dialog2.add(new Label("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
-                + "Donec vitae eros. Nunc sit amet neque. Ut id dui. Integer viverra feugiat sem."));
-        dialog2.show();
-
-        dialog3 = new BasicDialogExtended("Dialog extended", false, Scroll.NONE, 300, 200, "", "Yes", "No",
-                new BasicDialogListener() {
-
-                    public void onCancelButtonClick() {
-                        dialog3.hide();
-                    }
-
-                    public void onFirstButtonClick() {
-                        dialog3.hide();
-                    }
-                });
-        dialog3.add(new Label("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
-                + "Donec vitae eros. Nunc sit amet neque. Ut id dui. Integer viverra feugiat sem."));
-        dialog3.show();
-
-        BasicDialog chatDialog = new BasicDialog("Emite chat", false, Scroll.NONE, 600, 415, 300, 300);
-        chatDialog.setMaximizable(true);
-        chatDialog.setBodyBorder(false);
-        chatDialog.setBorder(false);
-        chatDialog.setBorders(false);
-        chatDialog.setLayout(new FitLayout());
-        chatDialog.addButton(new Button("Send"));
-        chatDialog.setButtonAlign(HorizontalAlignment.LEFT);
-        DefaultBorderLayout chatPanel = new DefaultBorderLayout();
-        DefaultPanel east = new DefaultPanel("Users");
-        DefaultPanel south = new DefaultPanel();
-        DefaultPanel north = new DefaultPanel();
-        chatPanel.createTopBar(south);
-        chatPanel.createTopBar(north);
-        chatPanel.createBottomBar(east);
-        chatPanel.createTopBar(north);
-        chatPanel.add(north, Position.NORTH, false, false, 22);
-        TabPanel centerPanel = new TabPanel();
-        TabItem item1 = new TabItem("Chat1");
-        item1.setIconStyle("icon1");
-        item1.setLayout(new FitLayout());
-        item1.setToolTip("fulano at kk.com");
-        TabItem item2 = new TabItem("Chat1");
-        item2.setIconStyle("icon1");
-        item2.setLayout(new FitLayout());
-        centerPanel.add(item1);
-        centerPanel.add(item2);
-        chatPanel.add(centerPanel, Position.CENTER);
-        chatPanel.add(east, Position.EAST, false, true, 150);
-        chatPanel.add(south, Position.SOUTH, true, false, 75);
-        chatDialog.add(chatPanel.getPanel());
-        chatDialog.show();
-        chatDialog.layout();
-        item1.setIconStyle("icon2");
-        item1.layout();
-        // chatDialog.renderIfNeeded();
-
-        // BasicDialog chatDialog2 = new BasicDialog("Layout sample", false,
-        // Scroll.NONE, 600, 415, 300, 300);
-        // chatDialog2.setLayout(new FitLayout());
-        // TestBorderLayout testBL = new TestBorderLayout();
-        // chatDialog2.add(testBL);
-        // chatDialog2.show();
-        // chatDialog2.layout();
-        //
-        // vp.add(chatPanel.getPanel());
-        // vp.layout();
-        // RootPanel.get().add(vp);
-
-        // wk.getEntityWorkspace().setContent(chatPanel.getPanel());//
-    }
-}

Copied: sandbox4/src/main/java/org/op/client/Sandbox.java (from rev 763, sandbox4/src/main/java/org/op/client/Sandbox3.java)
===================================================================
--- sandbox4/src/main/java/org/op/client/Sandbox3.java	2008-05-13 11:37:42 UTC (rev 763)
+++ sandbox4/src/main/java/org/op/client/Sandbox.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,33 @@
+package org.op.client;
+
+import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
+import com.extjs.gxt.ui.client.widget.Button;
+import com.extjs.gxt.ui.client.widget.Viewport;
+import com.extjs.gxt.ui.client.widget.form.FormPanel;
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.extjs.gxt.ui.client.widget.layout.FillLayout;
+import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public class Sandbox implements EntryPoint {
+    public void onModuleLoad() {
+        Viewport viewport = new Viewport();
+        viewport.setLayout(new FillLayout(5));
+
+        FormPanel form = new FormPanel();
+        form.setHeading("Form title");
+        form.setToolTip(new ToolTipConfig("form title tip", "form text tip"));
+        form.setButtonAlign(HorizontalAlignment.LEFT);
+        TextField field = new TextField();
+        field.setFieldLabel("Some label");
+        field.setToolTip(new ToolTipConfig("field title", "field text tip"));
+        form.add(field);
+        Button button = new Button("Ok");
+        button.setToolTip(new ToolTipConfig("button title", "button text tip"));
+        form.addButton(button);
+        viewport.add(form);
+
+        RootPanel.get().add(viewport);
+    }
+}

Copied: sandbox4/src/main/java/org/op/client/Sandbox2.java (from rev 765, sandbox4/src/main/java/org/op/client/Sandbox.java)
===================================================================
--- sandbox4/src/main/java/org/op/client/Sandbox.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/Sandbox2.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,184 @@
+package org.op.client;
+
+import org.op.client.DefaultBorderLayout.Position;
+
+import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
+import com.extjs.gxt.ui.client.Style.Scroll;
+import com.extjs.gxt.ui.client.widget.Button;
+import com.extjs.gxt.ui.client.widget.TabItem;
+import com.extjs.gxt.ui.client.widget.TabPanel;
+import com.extjs.gxt.ui.client.widget.Viewport;
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.extjs.gxt.ui.client.widget.layout.FillLayout;
+import com.extjs.gxt.ui.client.widget.layout.FitLayout;
+import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.MenuBar;
+import com.google.gwt.user.client.ui.RootPanel;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class Sandbox2 implements EntryPoint {
+
+    class LabelWrapper extends Label implements View {
+        public LabelWrapper(final String text) {
+            super(text);
+        }
+    }
+
+    class MenuBarWrapper extends Composite implements View {
+        public MenuBarWrapper() {
+
+            // Make a command that we will execute from all leaves.
+            Command cmd = new Command() {
+                public void execute() {
+                    Window.alert("You selected a menu item!");
+                }
+            };
+
+            // Make some sub-menus that we will cascade from the top menu.
+            MenuBar fooMenu = new MenuBar(true);
+            fooMenu.addItem("the", cmd);
+            fooMenu.addItem("foo", cmd);
+            fooMenu.addItem("menu", cmd);
+
+            MenuBar barMenu = new MenuBar(true);
+            barMenu.addItem("the", cmd);
+            barMenu.addItem("bar", cmd);
+            barMenu.addItem("menu", cmd);
+
+            MenuBar bazMenu = new MenuBar(true);
+            bazMenu.addItem("the", cmd);
+            bazMenu.addItem("baz", cmd);
+            bazMenu.addItem("menu", cmd);
+
+            // Make a new menu bar, adding a few cascading menus to it.
+            MenuBar menu = new MenuBar();
+            menu.addItem("foo", fooMenu);
+            menu.addItem("bar", barMenu);
+            menu.addItem("baz", bazMenu);
+            initWidget(menu);
+        }
+    }
+
+    private BasicDialogForm dialog;
+    private BasicDialogExtended dialog3;
+
+    /**
+     * This is the entry point method.
+     */
+    public void onModuleLoad() {
+        Viewport vp = new Viewport();
+        // Test fit vs fill layout
+        vp.setLayout(new FillLayout(4));
+        Workspace wk = new Workspace();
+        vp.add(wk.getPanel());
+        vp.layout();
+        RootPanel.get().add(vp);
+        wk.getEntityWorkspace().addItemToContentTopBar(new MenuBarWrapper());
+        wk.getEntityWorkspace().setContainer(new LabelWrapper("Container"));
+        wk.getEntityWorkspace().setContent(new LabelWrapper("Content"));
+        wk.getEntityWorkspace().setBottom(new LabelWrapper("Bottom"));
+        wk.getEntityWorkspace().setTitle(new LabelWrapper("Title 2"));
+        wk.getEntityWorkspace().setSubtitle(new LabelWrapper("Subtitle"));
+        wk.getSiteBar().addView(new LabelWrapper("sitebar-right"));
+
+        dialog = new BasicDialogForm("Test dialog", false, Scroll.AUTO, 380, 200, null, "Join", "Cancel",
+                new BasicDialogListener() {
+                    public void onCancelButtonClick() {
+                        dialog.hide();
+                    }
+
+                    public void onFirstButtonClick() {
+                        dialog.hide();
+                    }
+                });
+
+        TextField jid = new TextField();
+        jid.setMessageTarget("tooltip");
+        jid.setToolTip(new ToolTipConfig("Information", "Prints the current document"));
+        jid.setFieldLabel("Jabber id");
+        dialog.addField(jid);
+        dialog.show();
+
+        BasicDialog dialog2 = new BasicDialog("Hellooooo", false);
+        dialog2.add(new Label("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
+                + "Donec vitae eros. Nunc sit amet neque. Ut id dui. Integer viverra feugiat sem."));
+        dialog2.show();
+
+        dialog3 = new BasicDialogExtended("Dialog extended", false, Scroll.NONE, 300, 200, "", "Yes", "No",
+                new BasicDialogListener() {
+
+                    public void onCancelButtonClick() {
+                        dialog3.hide();
+                    }
+
+                    public void onFirstButtonClick() {
+                        dialog3.hide();
+                    }
+                });
+        dialog3.add(new Label("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "
+                + "Donec vitae eros. Nunc sit amet neque. Ut id dui. Integer viverra feugiat sem."));
+        dialog3.show();
+
+        BasicDialog chatDialog = new BasicDialog("Emite chat", false, Scroll.NONE, 600, 415, 300, 300);
+        chatDialog.setMaximizable(true);
+        // chatDialog.setBodyBorder(false);
+        chatDialog.setBorder(false);
+        // chatDialog.setBorders(false);
+        chatDialog.setLayout(new FitLayout());
+        Button sendBtn = new Button("Send");
+        sendBtn.setToolTip("send");
+        chatDialog.addButton(sendBtn);
+        chatDialog.setButtonAlign(HorizontalAlignment.LEFT);
+        DefaultBorderLayout chatPanel = new DefaultBorderLayout();
+        DefaultPanel east = new DefaultPanel("Users");
+        DefaultPanel south = new DefaultPanel();
+        DefaultPanel north = new DefaultPanel();
+        chatPanel.createTopBar(south);
+        chatPanel.createTopBar(north);
+        chatPanel.createBottomBar(east);
+        chatPanel.createTopBar(north);
+        chatPanel.add(north, Position.NORTH, false, false, 22);
+        TabPanel centerPanel = new TabPanel();
+        TabItem item1 = new TabItem("Chat1");
+        item1.setIconStyle("icon1");
+        item1.setLayout(new FitLayout());
+        ToolTipConfig tipConfig = new ToolTipConfig("fulano at kk.com");
+        item1.setToolTip(tipConfig);
+        TabItem item2 = new TabItem("Chat1");
+        item2.setIconStyle("icon1");
+        item2.setLayout(new FitLayout());
+        centerPanel.add(item1);
+        centerPanel.add(item2);
+        chatPanel.add(centerPanel, Position.CENTER);
+        chatPanel.add(east, Position.EAST, false, true, 150);
+        chatPanel.add(south, Position.SOUTH, true, false, 75);
+        chatDialog.add(chatPanel.getPanel());
+        chatDialog.show();
+        chatDialog.layout();
+        item1.setIconStyle("icon2");
+        item1.setText("<span ext:qtip=\"kk\" style=\"icon2\">chat1</span>");
+        item1.layout(true);
+        // chatDialog.renderIfNeeded();
+
+        // BasicDialog chatDialog2 = new BasicDialog("Layout sample", false,
+        // Scroll.NONE, 600, 415, 300, 300);
+        // chatDialog2.setLayout(new FitLayout());
+        // TestBorderLayout testBL = new TestBorderLayout();
+        // chatDialog2.add(testBL);
+        // chatDialog2.show();
+        // chatDialog2.layout();
+        //
+        // vp.add(chatPanel.getPanel());
+        // vp.layout();
+        // RootPanel.get().add(vp);
+
+        // wk.getEntityWorkspace().setContent(chatPanel.getPanel());//
+    }
+}

Deleted: sandbox4/src/main/java/org/op/client/Sandbox3.java
===================================================================
--- sandbox4/src/main/java/org/op/client/Sandbox3.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/Sandbox3.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -1,45 +0,0 @@
-package org.op.client;
-
-import com.extjs.gxt.ui.client.Style.LayoutRegion;
-import com.extjs.gxt.ui.client.widget.Button;
-import com.extjs.gxt.ui.client.widget.ContentPanel;
-import com.extjs.gxt.ui.client.widget.Viewport;
-import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
-import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.user.client.ui.RootPanel;
-
-public class Sandbox3 implements EntryPoint {
-    public void onModuleLoad() { // here
-        // we
-        // create
-        // our
-        // viewport
-        // and
-        // assign
-        // the
-        // border
-        // layout
-
-        Viewport viewport = new Viewport();
-        viewport.setLayout(new BorderLayout());
-
-        // west region // we create a new layout data for the west region and
-        // give it a
-        // width, min width, and max width
-        BorderLayoutData data = new BorderLayoutData(LayoutRegion.WEST, 125, 0, 200);
-        BorderLayoutData datac = new BorderLayoutData(LayoutRegion.CENTER);
-
-        // create the child widget and add it to the container with the layout
-        // data
-        ContentPanel west = new ContentPanel();
-        ContentPanel center = new ContentPanel();
-        west.setTitle("Testing");
-        west.add(new Button("Hello!"));
-
-        viewport.add(west, data);
-        viewport.add(center, datac);
-        viewport.layout();
-        RootPanel.get().add(viewport);
-    }
-}

Added: sandbox4/src/main/java/org/op/client/SandboxCollapse.java
===================================================================
--- sandbox4/src/main/java/org/op/client/SandboxCollapse.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/SandboxCollapse.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,37 @@
+package org.op.client;
+
+import com.extjs.gxt.ui.client.Style.LayoutRegion;
+import com.extjs.gxt.ui.client.util.Margins;
+import com.extjs.gxt.ui.client.widget.Button;
+import com.extjs.gxt.ui.client.widget.ContentPanel;
+import com.extjs.gxt.ui.client.widget.Viewport;
+import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
+import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public class SandboxCollapse implements EntryPoint {
+    public void onModuleLoad() {
+        Viewport viewport = new Viewport();
+        viewport.setLayout(new BorderLayout());
+
+        BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 125, 0, 200);
+        westData.split = true;
+        westData.collapsible = true;
+        westData.collapseMode = "mini";
+        westData.margins = new Margins(5, 5, 5, 5);
+        BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
+
+        ContentPanel west = new ContentPanel();
+        west.setHeaderVisible(false);
+        ContentPanel center = new ContentPanel();
+        west.setTitle("Testing");
+        center.add(new Button("button1"));
+        west.add(new Button("button2"));
+
+        viewport.add(west, westData);
+        viewport.add(center, centerData);
+        viewport.layout();
+        RootPanel.get().add(viewport);
+    }
+}
\ No newline at end of file

Added: sandbox4/src/main/java/org/op/client/SandboxTooltip.java
===================================================================
--- sandbox4/src/main/java/org/op/client/SandboxTooltip.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/SandboxTooltip.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,33 @@
+package org.op.client;
+
+import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
+import com.extjs.gxt.ui.client.widget.Button;
+import com.extjs.gxt.ui.client.widget.Viewport;
+import com.extjs.gxt.ui.client.widget.form.FormPanel;
+import com.extjs.gxt.ui.client.widget.form.TextField;
+import com.extjs.gxt.ui.client.widget.layout.FillLayout;
+import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public class SandboxTooltip implements EntryPoint {
+    public void onModuleLoad() {
+        Viewport viewport = new Viewport();
+        viewport.setLayout(new FillLayout(5));
+
+        FormPanel form = new FormPanel();
+        form.setHeading("Form title");
+        form.setToolTip(new ToolTipConfig("form title tip", "form text tip"));
+        form.setButtonAlign(HorizontalAlignment.LEFT);
+        TextField field = new TextField();
+        field.setFieldLabel("Some label");
+        field.setToolTip(new ToolTipConfig("field title", "field text tip"));
+        form.add(field);
+        Button button = new Button("Ok");
+        button.setToolTip(new ToolTipConfig("button title", "button text tip"));
+        form.addButton(button);
+        viewport.add(form);
+
+        RootPanel.get().add(viewport);
+    }
+}

Added: sandbox4/src/main/java/org/op/client/chat/DragGridConfiguration.java
===================================================================
--- sandbox4/src/main/java/org/op/client/chat/DragGridConfiguration.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/chat/DragGridConfiguration.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,21 @@
+package org.op.client.chat;
+
+public class DragGridConfiguration {
+
+    private final String ddGroupId;
+    private final String dragMessage;
+
+    public DragGridConfiguration(final String ddGroupId, final String dragMessage) {
+	this.ddGroupId = ddGroupId;
+	this.dragMessage = dragMessage;
+    }
+
+    public String getDdGroupId() {
+	return ddGroupId;
+    }
+
+    public String getDragMessage() {
+	return dragMessage;
+    }
+
+}

Added: sandbox4/src/main/java/org/op/client/chat/DropGridConfiguration.java
===================================================================
--- sandbox4/src/main/java/org/op/client/chat/DropGridConfiguration.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/chat/DropGridConfiguration.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,21 @@
+package org.op.client.chat;
+
+public class DropGridConfiguration {
+
+    private final String ddGroupId;
+    private final UserGridDropListener listener;
+
+    public DropGridConfiguration(final String ddGroupId, final UserGridDropListener listener) {
+	this.ddGroupId = ddGroupId;
+	this.listener = listener;
+    }
+
+    public String getDdGroupId() {
+	return ddGroupId;
+    }
+
+    public UserGridDropListener getListener() {
+	return listener;
+    }
+
+}

Added: sandbox4/src/main/java/org/op/client/chat/UserGridDropListener.java
===================================================================
--- sandbox4/src/main/java/org/op/client/chat/UserGridDropListener.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/chat/UserGridDropListener.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,5 @@
+package org.op.client.chat;
+
+public interface UserGridDropListener {
+    void onDrop(XmppURI userURI);
+}

Added: sandbox4/src/main/java/org/op/client/chat/UserGridListener.java
===================================================================
--- sandbox4/src/main/java/org/op/client/chat/UserGridListener.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/chat/UserGridListener.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,5 @@
+package org.op.client.chat;
+
+public interface UserGridListener {
+    void onDoubleClick(XmppURI userJid);
+}

Added: sandbox4/src/main/java/org/op/client/chat/XmppURI.java
===================================================================
--- sandbox4/src/main/java/org/op/client/chat/XmppURI.java	2008-05-13 21:49:48 UTC (rev 765)
+++ sandbox4/src/main/java/org/op/client/chat/XmppURI.java	2008-05-14 00:35:16 UTC (rev 766)
@@ -0,0 +1,147 @@
+/*
+ *
+ * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
+ *
+ * (c) 2008 The emite development team (see CREDITS for details)
+ * This file is part of emite.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.op.client.chat;
+
+/**
+ * 
+ * http://www.xmpp.org/drafts/attic/draft-saintandre-xmpp-uri-00.html
+ * 
+ * <code>XMPP- = ["xmpp:"] node "@" host[ "/" resource]</code>
+ * 
+ */
+public class XmppURI {
+    private static final String PREFIX = "xmpp:";
+    private static final int PREFIX_LENGTH = PREFIX.length();
+
+    public static XmppURI jid(final String jid) {
+	return uri(jid).getJID();
+    }
+
+    public static XmppURI uri(final String xmppUri) {
+	if (xmppUri == null)
+	    return null;
+
+	String node = null;
+	String domain = null;
+	String resource = null;
+
+	final String uri = xmppUri.startsWith(PREFIX) ? xmppUri.substring(PREFIX_LENGTH) : xmppUri;
+
+	final int atIndex = uri.indexOf('@') + 1;
+	if (atIndex > 0) {
+	    node = uri.substring(0, atIndex - 1);
+	    if (node.length() == 0) {
+		throw new RuntimeException("a uri with @ should have node");
+	    }
+	}
+
+	final int barIndex = uri.indexOf('/', atIndex);
+	if (atIndex == barIndex) {
+	    throw new RuntimeException("bad syntax!");
+	}
+	if (barIndex > 0) {
+	    domain = uri.substring(atIndex, barIndex);
+	    resource = uri.substring(barIndex + 1);
+	} else {
+	    domain = uri.substring(atIndex);
+	}
+	if (domain.length() == 0) {
+	    throw new RuntimeException("The domain is required");
+	}
+
+	return new XmppURI(node, domain, resource);
+    }
+    private final String host;
+    private final String node;
+    private final String representation;
+
+    private final String resource;
+
+    /**
+     * 
+     * @param jid
+     * @param resource
+     *                <code> resource      = *( unreserved / escaped )
+                reserved      = ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+" /
+                "$" / "," / "[" / "]" </code>
+     * 
+     */
+    public XmppURI(final String node, final String host, final String resource) {
+	this.node = node;
+	this.host = host;
+	this.resource = resource;
+	this.representation = (node != null ? node + "@" : "") + host + (resource != null ? "/" + resource : "");
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+	if (obj == null) {
+	    return false;
+	}
+	if (obj == this) {
+	    return true;
+	}
+	return representation.equals(((XmppURI) obj).representation);
+    }
+
+    public boolean equalsNoResource(final XmppURI other) {
+	return host.equals(other.host) && node.equals(other.node);
+    }
+
+    public String getHost() {
+	return host;
+    }
+
+    public XmppURI getHostURI() {
+	return new XmppURI(null, host, null);
+    }
+
+    public XmppURI getJID() {
+	return new XmppURI(node, host, null);
+    }
+
+    public String getNode() {
+	return node;
+    }
+
+    public String getResource() {
+	return resource;
+    }
+
+    @Override
+    public int hashCode() {
+	return representation.hashCode();
+    }
+
+    public boolean hasNode() {
+	return node != null;
+    }
+
+    public boolean hasResource() {
+	return resource != null;
+    }
+
+    @Override
+    public String toString() {
+	return representation;
+    }
+}




More information about the kune-commits mailing list