Author: yradtsevich
Date: 2010-03-18 13:32:16 -0400 (Thu, 18 Mar 2010)
New Revision: 20911
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
VPE Refactoring in progress.
- All methods of VpeDnD.DndVpeController have been moved to VpeDnD.
- VpeController now uses VpeDnD via MozillaDndListener interface.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-03-18
17:24:42 UTC (rev 20910)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-03-18
17:32:16 UTC (rev 20911)
@@ -13,13 +13,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
-import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.common.model.ui.editors.dnd.DropCommandFactory;
import org.jboss.tools.common.model.ui.editors.dnd.DropData;
import org.jboss.tools.common.model.ui.editors.dnd.DropUtils;
@@ -70,42 +68,75 @@
* @author Max Areshkau
* @author Yahor Radtsevich (yradtsevich)
*
- *Class which response for drag and drop functionality
+ * Class responsible for Drag&Drop functionality
*/
-public class VpeDnD {
- /*
- * Default transfer data
- */
+public class VpeDnD implements MozillaDndListener {
+ /*
+ * Default transfer data
+ */
private static final String VPE_ELEMENT = ""; //$NON-NLS-1$
/**
* service manager */
private nsIServiceManager serviceManager;
-
+
/**
* component manager
*/
private nsIComponentManager componentManager;
-
+
/**
* drag service
*/
private nsIDragService dragService;
private VpeController vpeController;
- private DndVpeController dndController;
+ private VpeVisualInnerDragInfo innerDragInfo = null;
- // XXX temp method
- public DndVpeController getDndController() {
- return dndController;
- }
-
public VpeDnD(VpeController vpeController) {
this.vpeController = vpeController;
- this.dndController = new DndVpeController();
}
-
+
+ public void dragGesture(nsIDOMEvent domEvent) {
+ nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) domEvent
+ .queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
+ boolean canDragFlag = canInnerDrag(mouseEvent);
+ // start drag sessionvpe-element
+ if (canDragFlag) {
+ startDragSession(domEvent);
+ }
+ }
+
/**
+ * Calls when drag over event ocure
+ * @param event
+ */
+ public void dragOver(nsIDOMEvent event) {
+ final nsIDOMMouseEvent mouseEvent =
+ (nsIDOMMouseEvent) event.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
+ final XulRunnerEditor editor = vpeController.getXulRunnerEditor();
+ new ScrollingSupport(editor).scroll(mouseEvent);
+ refreshCanDrop(event);
+ vpeController.onRefresh();
+ }
+
+ /**
+ * Drop Event handler
+ * @param domEvent
+ * @param vpeController
+ */
+ public void dragDrop(nsIDOMEvent domEvent) {
+ if(getDragService().getCurrentSession().getSourceDocument()==null) {
+ //in this case it's is external drag
+ externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID),
VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
+ } else {
+ // in this case it's is an internal drag
+ innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
+ }
+ vpeController.onRefresh();
+ }
+
+ /**
* Starts drag session
* @param dragetElement
*/
@@ -123,7 +154,7 @@
domEvent.preventDefault();
}
-
+
/**
* Creates transferable object to start drag session
*
@@ -151,6 +182,7 @@
return iTransferable;
}
+
/**
* @return the componentManager
*/
@@ -188,17 +220,6 @@
}
return dragService;
}
- /**
- * Calls when drag over event ocure
- * @param event
- */
- public void dragOver(nsIDOMEvent event) {
- final nsIDOMMouseEvent mouseEvent =
- (nsIDOMMouseEvent) event.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
- final XulRunnerEditor editor = vpeController.getXulRunnerEditor();
- new ScrollingSupport(editor).scroll(mouseEvent);
- refreshCanDrop(event);
- }
private void refreshCanDrop(nsIDOMEvent event) {
boolean canDrop = true;
@@ -210,10 +231,10 @@
if(getDragService().getCurrentSession().getSourceNode()==null){
//external drag
- info = dndController.canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR,
""); //$NON-NLS-1$
+ info = canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, "");
//$NON-NLS-1$
} else {
//internal drag
- info = dndController.canInnerDrop(mouseEvent);
+ info = canInnerDrop(mouseEvent);
}
if (info != null) {
canDrop = info.canDrop();
@@ -244,203 +265,366 @@
mouseEvent.preventDefault();
mouseEvent.stopPropagation();
}
- /**
- * Drop Event handler
- * @param domEvent
- * @param vpeController
- */
- public void dragDrop(nsIDOMEvent domEvent) {
- if(getDragService().getCurrentSession().getSourceDocument()==null) {
- //in this case it's is external drag
- dndController.externalDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID),
VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
- } else {
- // in this case it's is an internal drag
- dndController.innerDrop((nsIDOMMouseEvent)domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID));
+
+ public void externalDropAny(final String flavor, final String data, final Point range,
+ Node container) {
+ if (flavor == null || flavor.length() == 0)
+ return;
+ IDropCommand dropCommand = DropCommandFactory.getInstance()
+ .getDropCommand(flavor, JSPTagProposalFactory.getInstance());
+
+ boolean promptAttributes = JspEditorPlugin.getDefault()
+ .getPreferenceStore().getBoolean(
+ IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT);
+ dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
+ promptAttributes);
+ DropData dropData = new DropData(flavor, data,
+ vpeController.getSourceEditor().getEditorInput(),
+ (ISourceViewer) vpeController.getSourceEditor().getAdapter(ISourceViewer.class),
+ vpeController.new VpeSelectionProvider(range.x, range.y),
+ container);
+
+ /*
+ *
https://jira.jboss.org/jira/browse/JBIDE-4982 Setting the value
+ * provider to create tag insert dialog.
+ */
+ if (vpeController.getSourceEditor() instanceof JSPTextEditor) {
+ dropData.setValueProvider(((JSPTextEditor) vpeController.getSourceEditor())
+ .createAttributeDescriptorValueProvider());
}
+
+ dropCommand.execute(dropData);
}
- /**
- *
- * @author Yahor Radtsevich (yradtsevich): moved methods from the
- * {@link VpeController} here
- */
- public class DndVpeController implements MozillaDndListener {
- private VpeVisualInnerDragInfo innerDragInfo = null;
-
- public void dragGesture(nsIDOMEvent domEvent) {
- nsIDOMMouseEvent mouseEvent = (nsIDOMMouseEvent) domEvent
- .queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
- boolean canDragFlag = canInnerDrag(mouseEvent);
- // start drag sessionvpe-element
- if (canDragFlag) {
-
- startDragSession(domEvent);
+ public boolean canInnerDrag(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
+ }
+ if (innerDragInfo != null) {
+ innerDragInfo.release();
+ innerDragInfo = null;
+ }
+ boolean canDrag = false;
+ VpeVisualInnerDragInfo dragInfo = vpeController.getSelectionBuilder()
+ .getInnerDragInfo(event);
+ if (dragInfo != null) {
+ nsIDOMNode dragNode = dragInfo.getNode();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode
+ ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ switch (dragNode.getNodeType()) {
+ case nsIDOMNode.ELEMENT_NODE: {
+ canDrag = vpeController.getVisualBuilder().canInnerDrag((nsIDOMElement) dragNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+ break;
+ }
+ case nsIDOMNode.TEXT_NODE: {
+ canDrag = vpeController.getVisualBuilder().isTextEditable(dragNode);
+ break;
+ }
+ }
+ if (canDrag) {
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(dragInfo);
+ if (sourceInnerDragInfo.getNode() != null) {
+ innerDragInfo = dragInfo;
+ InnerDragBuffer.object = sourceInnerDragInfo.getNode();
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ InnerDragBuffer.object = null;
+ }
+ });
+ } else {
+ canDrag = false;
+ }
+ }
+ if (!canDrag) {
+ dragInfo.release();
+ }
}
-
- public void dragOver(nsIDOMEvent event) {
- VpeDnD.this.dragOver(event);
- vpeController.onRefresh();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
}
-
- public void _dragOver(nsIDOMEvent event) {
- if (!vpeController.getSwitcher()
- .startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
- return;
+ return canDrag;
+ }
+
+ public MozillaDropInfo canInnerDrop(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (vpeController.getDropWindow().isActive()) {
+ if (!event.getAltKey()) {
+ vpeController.getDropWindow().close();
+ } else {
+ return null;
}
- try {
- if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
- System.out.println("<<<<<<<<<<<<<<<<<<<<
dragOver"); //$NON-NLS-1$
+ }
+ if (event.getAltKey()) {
+ nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
+ Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
+ if (sourceNode != null) {
+ vpeController.getDropWindow().setActive(true);
+ vpeController.getDropWindow().setEventPosition(event.getScreenX(), event
+ .getScreenY());
+ vpeController.getDropWindow().setInitialTargetNode(sourceNode);
+ vpeController.getDropWindow().open();
+ event.stopPropagation();
+ event.preventDefault();
+ return null;
+ }
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
+ }
+ boolean canDrop = false;
+
+ nsIDOMNode caretParent = null;
+ long caretOffset = 0;
+ if (innerDragInfo != null) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(event);
+ if (visualDropInfo.getDropContainer() != null) {
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print(" x: " //$NON-NLS-1$
+ + visualDropInfo.getMouseX()
+ + " y: " //$NON-NLS-1$
+ + visualDropInfo.getMouseY()
+ + " container: " //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getNodeName()
+ + "(" //$NON-NLS-1$
+ + visualDropInfo.getDropContainer()
+ + ") parent: " //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getParentNode()
+ .getNodeName()
+ + "(" //$NON-NLS-1$
+ + visualDropInfo.getDropContainer().getParentNode()
+ + ") offset: " //$NON-NLS-1$
+ + visualDropInfo.getDropOffset());
}
- // browser.computeDropPosition(event);
- boolean canDrop = !vpeController.getXulRunnerEditor().isMozillaDragFlavor();
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ visualDropInfo, true);
+ canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
- }
- if (canDrop) {
- canDrop = VpeDndUtil.isDropEnabled((IModelObjectEditorInput)
- vpeController.getSourceEditor().getEditorInput());
- }
- if (canDrop) {
- VpeVisualCaretInfo caretInfo = vpeController.getSelectionBuilder()
- .getVisualCaretInfo(event);
- canDrop = caretInfo.exist();
- if (canDrop) {
- caretInfo.showCaret();
- } else {
- caretInfo.hideCaret();
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ caretParent = newVisualDropInfo.getDropContainer();
+ caretOffset = newVisualDropInfo.getDropOffset();
}
}
- if (!canDrop) {
- event.stopPropagation();
- event.preventDefault();
- }
- } finally {
- vpeController.getSwitcher().stopActiveEditor();
}
+ visualDropInfo.release();
}
-
- public boolean canInnerDrag(nsIDOMMouseEvent event) {
- vpeController.onHideTooltip();
-
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< canInnerDrag"); //$NON-NLS-1$
- }
- if (innerDragInfo != null) {
- innerDragInfo.release();
- innerDragInfo = null;
- }
- boolean canDrag = false;
- VpeVisualInnerDragInfo dragInfo = vpeController.getSelectionBuilder()
- .getInnerDragInfo(event);
- if (dragInfo != null) {
- nsIDOMNode dragNode = dragInfo.getNode();
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
+ }
+ return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+ }
+
+ public void innerDrop(nsIDOMMouseEvent event) {
+ vpeController.onHideTooltip();
+
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
+ }
+ if (innerDragInfo != null) {
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(event);
+ if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out
- .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode
+ ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ .print(" container: " + visualDropInfo.getDropContainer().getNodeName()
+ //$NON-NLS-1$
+ "(" + visualDropInfo.getDropContainer() //$NON-NLS-1$
+ + ")" + //$NON-NLS-1$
+ " offset: " //$NON-NLS-1$
+ + visualDropInfo.getDropOffset());
}
- switch (dragNode.getNodeType()) {
- case nsIDOMNode.ELEMENT_NODE: {
- canDrag = vpeController.getVisualBuilder().canInnerDrag((nsIDOMElement) dragNode
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
- break;
- }
- case nsIDOMNode.TEXT_NODE: {
- canDrag = vpeController.getVisualBuilder().isTextEditable(dragNode);
- break;
- }
- }
- if (canDrag) {
- VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
- .getSourceInnerDragInfo(dragInfo);
- if (sourceInnerDragInfo.getNode() != null) {
- innerDragInfo = dragInfo;
- InnerDragBuffer.object = sourceInnerDragInfo.getNode();
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- InnerDragBuffer.object = null;
- }
- });
- } else {
- canDrag = false;
+
+ VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
+ .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ visualDropInfo, true);
+ if (sourceDropInfo.canDrop()) {
+ VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
+ .getInnerDropInfo(sourceDropInfo.getContainer(),
+ sourceDropInfo.getOffset());
+ if (newVisualDropInfo != null) {
+ vpeController.getVisualBuilder().correctVisualDropPosition(
+ newVisualDropInfo, visualDropInfo);
+ sourceDropInfo.setTop(visualDropInfo.getMouseY());
+ sourceDropInfo.setLeft(visualDropInfo.getMouseX());
+ vpeController.getVisualBuilder().innerDrop(sourceInnerDragInfo,
+ sourceDropInfo);
+ if (innerDragInfo != null) {
+ innerDragInfo.release();
+ innerDragInfo = null;
+ }
}
}
- if (!canDrag) {
- dragInfo.release();
- }
}
+ }
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out.println();
+ }
+ }
+
+ public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
+ vpeController.onHideTooltip();
+
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
+ Point range = vpeController.getSelectionBuilder().getSourceSelectionRangeAtVisualNode(
+ visualDropInfo.getDropContainer(), (int) visualDropInfo
+ .getDropOffset());
+
+ // if (MODEL_FLAVOR.equals(flavor)) {
+ // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ // .getModelBuffer().source();
+ // if(object == null)
+
+ final DragTransferData dragTransferData = DndUtil.getDragTransferData();
+ final nsISupports aValue = dragTransferData.getValue();
+
+ String aFlavor = ""; //$NON-NLS-1$
+ if (VpeDndUtil.isNsIFileInstance(aValue)) {
+ nsIFile aFile = (nsIFile) aValue
+ .queryInterface(nsIFile.NS_IFILE_IID);
+
+ // because it is external, convert the path to URL
+ final String path = aFile.getPath();
+ data = path != null ? DropUtils.convertPathToUrl(path) : null;
+ aFlavor = DndUtil.kFileMime;
+
+ } else if (VpeDndUtil.isNsICStringInstance(aValue)) {
+ nsISupportsCString aString = (nsISupportsCString) aValue
+ .queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
+ data = aString.getData();
+ aFlavor = DndUtil.kHTMLMime;
+ } else if (VpeDndUtil.isNsIStringInstance(aValue)) {
+ nsISupportsString aString = (nsISupportsString) aValue
+ .queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
+ data = aString.getData();
+ if (VpeController.MODEL_FLAVOR.equals(dragTransferData.getFlavor())) {
+ aFlavor = dragTransferData.getFlavor();
+ } else {
+ aFlavor = DndUtil.kURLMime;
+ }
+ }
+
+ // if (object.getFileType() == XModelObject.FILE
+ // && !TLDUtil.isTaglib(object)) {
+ // flavor = "application/x-moz-file"; //$NON-NLS-1$
+ // IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ // try {
+ // data = f.getLocation().toFile().toURL().toString();
+ // } catch (Exception e) {
+ // VpePlugin.getPluginLog().logError(e);
+ // }
+ // } else {
+ // String tagname = getTagName(object);
+ // if (tagname.indexOf("taglib") >= 0)tagname =
"taglib"; //$NON-NLS-1$ //$NON-NLS-2$
+ // Node sourceDragNode = ((Document) getModel().getAdapter(
+ // Document.class)).createElement(tagname);
+ // if (visualDropInfo.getDropContainer() != null) {
+ // sourceDropInfo = vpeController.getVisualBuilder().getSourceInnerDropInfo(
+ // sourceDragNode, visualDropInfo, true);
+ // range = vpeController.getSelectionBuilder().getSourceSelectionRange(
+ // sourceDropInfo.getContainer(), sourceDropInfo
+ // .getOffset());
+ // }
+ // }
+
+ if (visualDropInfo.getDropContainer() != null && data != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrag: " + canDrag); //$NON-NLS-1$
+ System.out
+ .println(" drop! container: " +
visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
- return canDrag;
+ externalDropAny(aFlavor, data, range, null);
+
+ // TypedEvent tEvent = new TypedEvent(mouseEvent);
+ // tEvent.data = data;
+ // dropContext.setFlavor(aFlavor);
+ // dropContext.setMimeData(data);
+ // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
}
-
- public DndVpeController() {
- super();
+ }
+
+ public MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent, String flavor,
String data) {
+ InnerDragBuffer.object = null;
+ vpeController.onHideTooltip();
+
+ if (vpeController.getDropWindow().isActive()) {
+ if (!mouseEvent.getAltKey()) {
+ vpeController.getDropWindow().close();
+ } else {
+ return new MozillaDropInfo(false, null, 0);
+ }
}
-
- public MozillaDropInfo canInnerDrop(nsIDOMMouseEvent event) {
- vpeController.onHideTooltip();
-
- if (vpeController.getDropWindow().isActive()) {
- if (!event.getAltKey()) {
- vpeController.getDropWindow().close();
+ if (mouseEvent.getAltKey()) {
+ nsIDOMEvent event = (nsIDOMEvent) mouseEvent
+ .queryInterface(nsIDOMEvent.NS_IDOMEVENT_IID);
+ nsIDOMNode visualNode = (nsIDOMNode) event.getTarget()
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+ Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
+ if (sourceNode != null) {
+ if (ModelTransfer.MODEL.equals(flavor)) {
+ // XModelObject object =
+ // PreferenceModelUtilities.getPreferenceModel().
+ // getModelBuffer().source();
+ // InnerDragBuffer.object = object;
} else {
- return null;
+ vpeController.getDropWindow().setFlavor(flavor);
}
+ vpeController.getDropWindow().setActive(true);
+ vpeController.getDropWindow().setEventPosition(mouseEvent.getScreenX(), mouseEvent
+ .getScreenY());
+ vpeController.getDropWindow().setInitialTargetNode(sourceNode);
+ vpeController.getDropWindow().open();
+ mouseEvent.stopPropagation();
+ mouseEvent.preventDefault();
+ return new MozillaDropInfo(false, null, 0);
}
- if (event.getAltKey()) {
- nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
- Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
- if (sourceNode != null) {
- vpeController.getDropWindow().setActive(true);
- vpeController.getDropWindow().setEventPosition(event.getScreenX(), event
- .getScreenY());
- vpeController.getDropWindow().setInitialTargetNode(sourceNode);
- vpeController.getDropWindow().open();
- event.stopPropagation();
- event.preventDefault();
- return null;
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< canInnerDrop"); //$NON-NLS-1$
- }
- boolean canDrop = false;
- ;
- nsIDOMNode caretParent = null;
- long caretOffset = 0;
- if (innerDragInfo != null) {
+ }
+ boolean canDrop = false;
+ nsIDOMNode caretParent = null;
+ long caretOffset = 0;
+
+ if (VpeController.MODEL_FLAVOR.equals(flavor)) {
+ XModelObject object = PreferenceModelUtilities.getPreferenceModel()
+ .getModelBuffer().source();
+ if (object.getFileType() == XModelObject.FILE
+ && !TLDUtil.isTaglib(object)) {
+ IFile f = (IFile) EclipseResourceUtil.getResource(object);
+ canDrop = f != null;
VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(event);
+ .getInnerDropInfo(mouseEvent);
+ caretParent = visualDropInfo.getDropContainer();
+ caretOffset = visualDropInfo.getDropOffset();
+ } else {
+ String tagname = vpeController.getTagName(object);
+ if (tagname.indexOf("taglib") >= 0)tagname = "taglib";
//$NON-NLS-1$ //$NON-NLS-2$
+ Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(
+ Document.class)).createElement(tagname);
+ VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
+ .getInnerDropInfo(mouseEvent);
if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print(" x: " //$NON-NLS-1$
- + visualDropInfo.getMouseX()
- + " y: " //$NON-NLS-1$
- + visualDropInfo.getMouseY()
- + " container: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer()
- + ") parent: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- .getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- + ") offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
- }
- VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
- .getSourceInnerDragInfo(innerDragInfo);
VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ .getSourceInnerDropInfo(sourceDragNode,
visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(sourceDropInfo.getContainer(),
+ .getInnerDropInfo(
+ sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
vpeController.getVisualBuilder().correctVisualDropPosition(
@@ -452,284 +636,68 @@
}
visualDropInfo.release();
}
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrop: " + canDrop); //$NON-NLS-1$
- }
- return new MozillaDropInfo(canDrop, caretParent, caretOffset);
- }
-
- public void innerDrop(nsIDOMMouseEvent event) {
- vpeController.onHideTooltip();
-
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print("<<<<<< innerDrop"); //$NON-NLS-1$
- }
- if (innerDragInfo != null) {
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(event);
- if (visualDropInfo.getDropContainer() != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .print(" container: " +
visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
- "(" + visualDropInfo.getDropContainer() //$NON-NLS-1$
- + ")" + //$NON-NLS-1$
- " offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
- }
-
- VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
- .getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
- visualDropInfo, true);
- if (sourceDropInfo.canDrop()) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- sourceDropInfo.setTop(visualDropInfo.getMouseY());
- sourceDropInfo.setLeft(visualDropInfo.getMouseX());
- vpeController.getVisualBuilder().innerDrop(sourceInnerDragInfo,
- sourceDropInfo);
- if (innerDragInfo != null) {
- innerDragInfo.release();
- innerDragInfo = null;
- }
- }
- }
- }
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println();
- }
- }
-
- public MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent, String flavor,
String data) {
- InnerDragBuffer.object = null;
- vpeController.onHideTooltip();
-
- if (vpeController.getDropWindow().isActive()) {
- if (!mouseEvent.getAltKey()) {
- vpeController.getDropWindow().close();
- } else {
- return new MozillaDropInfo(false, null, 0);
- }
- }
- if (mouseEvent.getAltKey()) {
- nsIDOMEvent event = (nsIDOMEvent) mouseEvent
- .queryInterface(nsIDOMEvent.NS_IDOMEVENT_IID);
- nsIDOMNode visualNode = (nsIDOMNode) event.getTarget()
- .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
- Node sourceNode = vpeController.getDomMapping().getNearSourceNode(visualNode);
- if (sourceNode != null) {
- if (ModelTransfer.MODEL.equals(flavor)) {
- // XModelObject object =
- // PreferenceModelUtilities.getPreferenceModel().
- // getModelBuffer().source();
- // InnerDragBuffer.object = object;
- } else {
- vpeController.getDropWindow().setFlavor(flavor);
- }
- vpeController.getDropWindow().setActive(true);
- vpeController.getDropWindow().setEventPosition(mouseEvent.getScreenX(), mouseEvent
- .getScreenY());
- vpeController.getDropWindow().setInitialTargetNode(sourceNode);
- vpeController.getDropWindow().open();
- mouseEvent.stopPropagation();
- mouseEvent.preventDefault();
- return new MozillaDropInfo(false, null, 0);
- }
- }
- boolean canDrop = false;
- nsIDOMNode caretParent = null;
- long caretOffset = 0;
-
- if (VpeController.MODEL_FLAVOR.equals(flavor)) {
- XModelObject object = PreferenceModelUtilities.getPreferenceModel()
- .getModelBuffer().source();
- if (object.getFileType() == XModelObject.FILE
- && !TLDUtil.isTaglib(object)) {
- IFile f = (IFile) EclipseResourceUtil.getResource(object);
- canDrop = f != null;
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(mouseEvent);
- caretParent = visualDropInfo.getDropContainer();
- caretOffset = visualDropInfo.getDropOffset();
- } else {
- String tagname = vpeController.getTagName(object);
- if (tagname.indexOf("taglib") >= 0)tagname = "taglib";
//$NON-NLS-1$ //$NON-NLS-2$
- Node sourceDragNode = ((Document) vpeController.getModel().getAdapter(
- Document.class)).createElement(tagname);
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(mouseEvent);
- if (visualDropInfo.getDropContainer() != null) {
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceDragNode,
- visualDropInfo, true);
- canDrop = sourceDropInfo.canDrop();
- if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
- .getInnerDropInfo(
- sourceDropInfo.getContainer(),
- sourceDropInfo.getOffset());
- if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
- newVisualDropInfo, visualDropInfo);
- caretParent = newVisualDropInfo.getDropContainer();
- caretOffset = newVisualDropInfo.getDropOffset();
- }
- }
- }
- visualDropInfo.release();
- }
- } else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
- || XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
- VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
- .getInnerDropInfo(mouseEvent);
- caretParent = visualDropInfo.getDropContainer();
- caretOffset = visualDropInfo.getDropOffset();
- canDrop = true;
-
- }
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" canDrop: " + canDrop + (canDrop ? " container: " +
caretParent.getNodeName() + " offset: " + caretOffset : ""));
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- return new MozillaDropInfo(canDrop, caretParent, caretOffset);
-
- }
-
- public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object, Node
parentNode, int offset) {
- String tagname = vpeController.getTagName(object);
- Node sourceDragNode = ((Document)
vpeController.getModel().getAdapter(Document.class))
- .createElement(tagname);
- return vpeController.getVisualBuilder().getSourceInnerDropInfo(sourceDragNode,
parentNode,
- offset, false);
- }
-
- public void externalDropAny(final String flavor, final String data, final Point range,
- Node container) {
- if (flavor == null || flavor.length() == 0)
- return;
- IDropCommand dropCommand = DropCommandFactory.getInstance()
- .getDropCommand(flavor, JSPTagProposalFactory.getInstance());
-
- boolean promptAttributes = JspEditorPlugin.getDefault()
- .getPreferenceStore().getBoolean(
- IVpePreferencesPage.ASK_TAG_ATTRIBUTES_ON_TAG_INSERT);
- dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
- promptAttributes);
- DropData dropData = new DropData(flavor, data,
- vpeController.getSourceEditor().getEditorInput(),
- (ISourceViewer) vpeController.getSourceEditor().getAdapter(ISourceViewer.class),
- vpeController.new VpeSelectionProvider(range.x, range.y),
- container);
-
- /*
- *
https://jira.jboss.org/jira/browse/JBIDE-4982 Setting the value
- * provider to create tag insert dialog.
- */
- if (vpeController.getSourceEditor() instanceof JSPTextEditor) {
- dropData.setValueProvider(((JSPTextEditor) vpeController.getSourceEditor())
- .createAttributeDescriptorValueProvider());
- }
-
- dropCommand.execute(dropData);
- }
-
- public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
- vpeController.onHideTooltip();
-
+ } else if (XulRunnerEditor.TRANS_FLAVOR_kFileMime.equals(flavor)
+ || XulRunnerEditor.TRANS_FLAVOR_kURLMime.equals(flavor)) {
VpeVisualInnerDropInfo visualDropInfo = vpeController.getSelectionBuilder()
.getInnerDropInfo(mouseEvent);
- Point range =
vpeController.getSelectionBuilder().getSourceSelectionRangeAtVisualNode(
- visualDropInfo.getDropContainer(), (int) visualDropInfo
- .getDropOffset());
-
- // if (MODEL_FLAVOR.equals(flavor)) {
- // XModelObject object = PreferenceModelUtilities.getPreferenceModel()
- // .getModelBuffer().source();
- // if(object == null)
-
- final DragTransferData dragTransferData = DndUtil.getDragTransferData();
- final nsISupports aValue = dragTransferData.getValue();
-
- String aFlavor = ""; //$NON-NLS-1$
- if (VpeDndUtil.isNsIFileInstance(aValue)) {
- nsIFile aFile = (nsIFile) aValue
- .queryInterface(nsIFile.NS_IFILE_IID);
-
- // because it is external, convert the path to URL
- final String path = aFile.getPath();
- data = path != null ? DropUtils.convertPathToUrl(path) : null;
- aFlavor = DndUtil.kFileMime;
-
- } else if (VpeDndUtil.isNsICStringInstance(aValue)) {
- nsISupportsCString aString = (nsISupportsCString) aValue
- .queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
- data = aString.getData();
- aFlavor = DndUtil.kHTMLMime;
- } else if (VpeDndUtil.isNsIStringInstance(aValue)) {
- nsISupportsString aString = (nsISupportsString) aValue
- .queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
- data = aString.getData();
- if (VpeController.MODEL_FLAVOR.equals(dragTransferData.getFlavor())) {
- aFlavor = dragTransferData.getFlavor();
- } else {
- aFlavor = DndUtil.kURLMime;
- }
- }
-
- // if (object.getFileType() == XModelObject.FILE
- // && !TLDUtil.isTaglib(object)) {
- // flavor = "application/x-moz-file"; //$NON-NLS-1$
- // IFile f = (IFile) EclipseResourceUtil.getResource(object);
- // try {
- // data = f.getLocation().toFile().toURL().toString();
- // } catch (Exception e) {
- // VpePlugin.getPluginLog().logError(e);
- // }
- // } else {
- // String tagname = getTagName(object);
- // if (tagname.indexOf("taglib") >= 0)tagname =
"taglib"; //$NON-NLS-1$ //$NON-NLS-2$
- // Node sourceDragNode = ((Document) getModel().getAdapter(
- // Document.class)).createElement(tagname);
- // if (visualDropInfo.getDropContainer() != null) {
- // sourceDropInfo = vpeController.getVisualBuilder().getSourceInnerDropInfo(
- // sourceDragNode, visualDropInfo, true);
- // range = vpeController.getSelectionBuilder().getSourceSelectionRange(
- // sourceDropInfo.getContainer(), sourceDropInfo
- // .getOffset());
- // }
- // }
-
- if (visualDropInfo.getDropContainer() != null && data != null) {
- if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out
- .println(" drop! container: " +
visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
- }
- externalDropAny(aFlavor, data, range, null);
-
- // TypedEvent tEvent = new TypedEvent(mouseEvent);
- // tEvent.data = data;
- // dropContext.setFlavor(aFlavor);
- // dropContext.setMimeData(data);
- // DnDUtil.fireDnDEvent(dropContext, textEditor, tEvent);
- }
+ caretParent = visualDropInfo.getDropContainer();
+ caretOffset = visualDropInfo.getDropOffset();
+ canDrop = true;
+
}
-
- /**
- * Start drag session
- */
- public void startDragSession(nsIDOMEvent domEvent) {
- VpeDnD.this.startDragSession(domEvent);
+ if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
+ System.out
+ .println(" canDrop: " + canDrop + (canDrop ? " container: " +
caretParent.getNodeName() + " offset: " + caretOffset : ""));
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
-
- public void dragDrop(nsIDOMEvent domEvent) {
- VpeDnD.this.dragDrop(domEvent);
- vpeController.onRefresh();
- }
+ return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+
}
+
+// this method is never used
+// public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object, Node
parentNode, int offset) {
+// String tagname = vpeController.getTagName(object);
+// Node sourceDragNode = ((Document)
vpeController.getModel().getAdapter(Document.class))
+// .createElement(tagname);
+// return vpeController.getVisualBuilder().getSourceInnerDropInfo(sourceDragNode,
parentNode,
+// offset, false);
+// }
+
+// this method is never used
+// public void _dragOver(nsIDOMEvent event) {
+// if (!vpeController.getSwitcher()
+// .startActiveEditor(VpeController.ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+// return;
+// }
+// try {
+// if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
+// System.out.println("<<<<<<<<<<<<<<<<<<<<
dragOver"); //$NON-NLS-1$
+// }
+// // browser.computeDropPosition(event);
+// boolean canDrop = !vpeController.getXulRunnerEditor().isMozillaDragFlavor();
+// if (canDrop) {
+// Clipboard clipboard = new Clipboard(Display.getCurrent());
+// canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
+// }
+// if (canDrop) {
+// canDrop = VpeDndUtil.isDropEnabled((IModelObjectEditorInput)
+// vpeController.getSourceEditor().getEditorInput());
+// }
+// if (canDrop) {
+// VpeVisualCaretInfo caretInfo = vpeController.getSelectionBuilder()
+// .getVisualCaretInfo(event);
+// canDrop = caretInfo.exist();
+// if (canDrop) {
+// caretInfo.showCaret();
+// } else {
+// caretInfo.hideCaret();
+// }
+// }
+// if (!canDrop) {
+// event.stopPropagation();
+// event.preventDefault();
+// }
+// } finally {
+// vpeController.getSwitcher().stopActiveEditor();
+// }
+// }
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-03-18
17:24:42 UTC (rev 20910)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-03-18
17:32:16 UTC (rev 20911)
@@ -162,7 +162,7 @@
VpeDomMapping domMapping;
private VpeSourceDomBuilder sourceBuilder;
private VpeVisualDomBuilder visualBuilder;
- private VpeDnD dnd;
+ private MozillaDndListener dndListener;
/** @deprecated */
private VpeSelectionBuilder selectionBuilder;
// private VpeVisualKeyHandler visualKeyHandler;
@@ -242,7 +242,7 @@
VpeTemplateManager.getInstance(), sourceEditor, pageContext);
visualBuilder = new VpeVisualDomBuilder(domMapping, this, visualEditor,
pageContext);
- dnd = new VpeDnD(this);
+ dndListener = new VpeDnD(this);
pageContext.setSourceDomBuilder(sourceBuilder);
pageContext.setVisualDomBuilder(visualBuilder);
IDOMModel sourceModel = (IDOMModel) getModel();
@@ -455,7 +455,7 @@
= visualEditor.getMozillaEventAdapter();
if (mozillaEventAdapter != null) {
mozillaEventAdapter.addContextMenuListener(this);
- mozillaEventAdapter.addDndListener(dnd.getDndController());
+ mozillaEventAdapter.addDndListener(dndListener);
mozillaEventAdapter.addKeyListener(this);
mozillaEventAdapter.addMouseListener(this);
mozillaEventAdapter.addSelectionListener(this);
@@ -472,7 +472,7 @@
= visualEditor.getMozillaEventAdapter();
if (mozillaEventAdapter != null) {
mozillaEventAdapter.removeContextMenuListener(this);
- mozillaEventAdapter.removeDndListener(dnd.getDndController());
+ mozillaEventAdapter.removeDndListener(dndListener);
mozillaEventAdapter.removeKeyListener(this);
mozillaEventAdapter.removeMouseListener(this);
mozillaEventAdapter.removeSelectionListener(this);
@@ -1202,7 +1202,7 @@
XulRunnerVpeUtils.getElementBounds(
selectedElement),
VisualDomUtil.getMousePoint(mouseEvent))) {
- dnd.getDndController().dragGesture(mouseEvent);
+ dndListener.dragGesture(mouseEvent);
} else {
selectionManager.setSelection(mouseEvent);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java 2010-03-18
17:24:42 UTC (rev 20910)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaDndListener.java 2010-03-18
17:32:16 UTC (rev 20911)
@@ -12,9 +12,7 @@
import java.util.EventListener;
-import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
import org.mozilla.interfaces.nsIDOMEvent;
-import org.mozilla.interfaces.nsIDOMMouseEvent;
/**
* Listener for Drag&Drop events.
@@ -29,22 +27,12 @@
* @param event xulrunner drag event
*/
void dragGesture(nsIDOMEvent event);
- boolean canInnerDrag(nsIDOMMouseEvent mouseEvent);
- MozillaDropInfo canInnerDrop(nsIDOMMouseEvent mouseEvent);
- void innerDrop(nsIDOMMouseEvent mouseEvent);
- void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data);
- void startDragSession(nsIDOMEvent domEvent);
/**
* Calls when drop event occurs
* @param domEvent
*/
void dragDrop(nsIDOMEvent domEvent);
-
- MozillaDropInfo canExternalDrop(nsIDOMMouseEvent mouseEvent,
- String flavor, String data);
-
-
// these methods are never used
// void dragEnter(nsIDOMEvent event);
// void dragExit(nsIDOMEvent event);