Author: scabanovich
Date: 2008-05-30 11:25:55 -0400 (Fri, 30 May 2008)
New Revision: 8483
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java
Log:
JBIDE-1189
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java 2008-05-30
15:24:41 UTC (rev 8482)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/dnd/PagesTemplateTransferDropTargetListener.java 2008-05-30
15:25:55 UTC (rev 8483)
@@ -13,6 +13,9 @@
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.seam.ui.pages.editor.ExceptionTemplate;
+import org.jboss.tools.seam.ui.pages.editor.PageTemplate;
+import org.jboss.tools.seam.ui.pages.editor.TemplateConstants;
public class PagesTemplateTransferDropTargetListener extends
TemplateTransferDropTargetListener {
@@ -21,16 +24,26 @@
}
protected CreationFactory getFactory(Object template) {
- return new JSFTemplateFactory();
+ return new JSFTemplateFactory((String)template);
}
class JSFTemplateFactory implements CreationFactory {
+ String template;
+
+ JSFTemplateFactory(String template) {
+ this.template = template;
+ }
+
public Object getNewObject() {
return "view";
}
public Object getObjectType() {
- return String.class;
+ if(TemplateConstants.TEMPLATE_EXCEPTION.equals(template))
+ return ExceptionTemplate.class;
+ else if(TemplateConstants.TEMPLATE_PAGE.equals(template))
+ return PageTemplate.class;
+ else return String.class;
}
}
Show replies by date