English 中文(简体)
Eclipse RCP就外部勘探商提交的未被接受的剪辑
原标题:Eclipse RCP drop file from external explorer not accepted

我有一份Eclipse RCP申请,该申请应当通过拖拉机开放档案;从窗户勘探商中删除。 因此,我执行了这一规定:

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

    @Override
    public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        configurer.addEditorAreaTransfer(FileTransfer.getInstance());
        configurer.configureEditorAreaDropListener(editorDropListener);
        return new ApplicationWorkbenchWindowAdvisor(configurer);
    }
[...]
}

<代码>DropListener为“代码>DropTargetAdapter,实施<代码>drop()。

现在,如果我从我的探索者手中拿到我的申请,我就会发现,“Windows Un available”会变幻灯,下降不会奏效。 The editorDropListener.drop(.

如果我用CTRLALT钥匙接手,我就拿到“窗口拷贝”的 mo。 登机工程和editorDropListener.drop()被成功点名。

在什么地方,允许哪一种下降?

问题回答

It seems this problem has not been solve from above. I just have look up the apis of DND and solve this problem, eliminate the Ctrl or Alt press. Drag and Drop We just need to add some code in you EditorAreaDropAdapter:

        @Override
public void dragEnter(DropTargetEvent event) {
    // TODO Auto-generated method stub
    event.detail = DND.DROP_COPY;
    super.dragEnter(event);
}

详细情况必须定为DND。 DROP_COPY forceptence.

It is a little more complicated than that, as the editor area does not accept a MOVE DND request.

详细情况请见<代码>org.eclipse.ui.internal.ide.EditorAreaDropAdapter。

Use this code in your listener. it will work.

                @Override
        public void dragEnter(final DropTargetEvent event) {

            if (event.detail == DND.DROP_DEFAULT) {
                if ((event.operations & DND.DROP_COPY) != 0) {
                    event.detail = DND.DROP_COPY;
                } else {
                    event.detail = DND.DROP_NONE;
                }
            }
        }




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签