[galaxy-dev] [2061] trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java: Add base class for popups.

View: New views
1 Messages — Rating Filter:   Alert me  

[galaxy-dev] [2061] trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java: Add base class for popups.

by dandiep-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
[2061] trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java: Add base class for popups.
Revision
2061
Author
dandiep
Date
2009-11-05 10:33:30 -0600 (Thu, 05 Nov 2009)

Log Message

Add base class for popups.

Added Paths

Diff

Added: trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java (0 => 2061)

--- trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java	                        (rev 0)
+++ trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java	2009-11-05 16:33:30 UTC (rev 2061)
@@ -0,0 +1,67 @@
+package org.mule.galaxy.web.client.util;
+
+import com.extjs.gxt.ui.client.Style;
+import com.extjs.gxt.ui.client.widget.form.FormPanel;
+import com.google.gwt.dom.client.FormElement;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.Widget;
+import org.mule.galaxy.web.client.ErrorPanel;
+
+public abstract class AbstractErrorHandlingPopup extends PopupPanel implements ErrorPanel {
+
+    protected FlowPanel errorPanel;
+    protected FormPanel fpanel;
+
+    public AbstractErrorHandlingPopup() {
+        errorPanel = new FlowPanel();
+        errorPanel.setStyleName("error-panel");
+        
+        fpanel = new FormPanel();
+        fpanel.setFrame(true);
+        fpanel.setEncoding(FormPanel.Encoding.MULTIPART);
+        fpanel.setMethod(FormPanel.Method.POST);
+        fpanel.setButtonAlign(Style.HorizontalAlignment.CENTER);
+        fpanel.setWidth(350);
+        fpanel.getElement().<FormElement>cast().setTarget("_blank");
+
+        setWidget(fpanel);
+    }
+
+    public void clearErrorMessage() {
+        //errorPanel.clearState();
+        errorPanel.clear();
+        fpanel.remove(errorPanel);
+    }
+
+    public void setMessage(Widget label) {
+        //errorPanel.clearState();
+        errorPanel.clear();
+        addMessage(label);
+    }
+
+    public void setMessage(String string) {
+        setMessage(new Label(string));
+    }
+
+    public void addMessage(String message) {
+        addMessage(new Label(message));
+    }
+
+    public void addMessage(Widget message) {
+        errorPanel.add(message);
+        fpanel.insert(errorPanel, getErrorPanelPosition());
+        fpanel.layout();
+    }
+
+    protected int getErrorPanelPosition() {
+        return 0;
+    }
+
+    protected FlowPanel getErrorPanel() {
+        return errorPanel;
+    }
+
+
+}
\ No newline at end of file
Property changes on: trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/AbstractErrorHandlingPopup.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MuleForge Dev" group.
To post to this group, send email to muleforgedev@...
To unsubscribe from this group, send email to muleforgedev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/muleforgedev?hl=en
-~----------~----~----~----~------~----~------~--~---
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://admin.muleforge.org/manage_email