Java 类org.eclipse.ui.part.PluginTransfer 实例源码

项目:PDFReporter-Studio    文件:FieldsTable.java   
private void addDropSupport() {
    int ops = DND.DROP_COPY | DND.DROP_MOVE;
    Transfer[] transfers = new Transfer[] { NodeTransfer.getInstance(), PluginTransfer.getInstance() };
    tviewer.addDragSupport(ops, transfers, new NodeDragListener(tviewer));

    transfers = new Transfer[] { NodeTransfer.getInstance() };
    NodeTableDropAdapter dropAdapter = new NodeTableDropAdapter(tviewer) {
        @Override
        public boolean performDrop(Object data) {
            if (data instanceof ANode[]) {
                ANode[] nodes = (ANode[]) data;
                List<JRField> fields = (List<JRField>) tviewer.getInput();
                for (ANode n : nodes) {
                    JRDesignField f = (JRDesignField) n.getAdapter(JRDesignField.class);
                    if (f != null) {
                        // be sure that the name is ok
                        f.setName(ModelUtils.getNameForField((List<JRDesignField>) tviewer.getInput(), f.getName()));
                        fields.add(f);
                    }
                }
                setFields(fields);
                return true;
            }
            return false;
        }
    };
    tviewer.addDropSupport(ops, transfers, dropAdapter);
}
项目:Eclipse-Postfix-Code-Completion    文件:CallHierarchyViewPart.java   
private void addDropAdapters(StructuredViewer viewer) {
    Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance(), PluginTransfer.getInstance() };
    int ops= DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT;

    DelegatingDropAdapter delegatingDropAdapter= new DelegatingDropAdapter();
    delegatingDropAdapter.addDropTargetListener(new CallHierarchyTransferDropAdapter(this, viewer));
    delegatingDropAdapter.addDropTargetListener(new PluginTransferDropAdapter(viewer));

    viewer.addDropSupport(ops, transfers, delegatingDropAdapter);
}
项目:Eclipse-Postfix-Code-Completion    文件:JdtViewerDropSupport.java   
public void start() {
    Assert.isLegal(!fStarted);

    int ops= DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT;

    Transfer[] transfers= new Transfer[] {
        LocalSelectionTransfer.getInstance(),
        FileTransfer.getInstance(),
        PluginTransfer.getInstance()};

    fViewer.addDropSupport(ops, transfers, fDelegatingDropAdapter);

    fStarted= true;
}
项目:Eclipse-Postfix-Code-Completion    文件:TypeHierarchyViewPart.java   
private void addDropAdapters(AbstractTreeViewer viewer) {
    Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance(), PluginTransfer.getInstance() };
    int ops= DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT;

    DelegatingDropAdapter delegatingDropAdapter= new DelegatingDropAdapter();
    delegatingDropAdapter.addDropTargetListener(new TypeHierarchyTransferDropAdapter(this, viewer));
    delegatingDropAdapter.addDropTargetListener(new PluginTransferDropAdapter(viewer));

    viewer.addDropSupport(ops, transfers, delegatingDropAdapter);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CallHierarchyViewPart.java   
private void addDropAdapters(StructuredViewer viewer) {
    Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance(), PluginTransfer.getInstance() };
    int ops= DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT;

    DelegatingDropAdapter delegatingDropAdapter= new DelegatingDropAdapter();
    delegatingDropAdapter.addDropTargetListener(new CallHierarchyTransferDropAdapter(this, viewer));
    delegatingDropAdapter.addDropTargetListener(new PluginTransferDropAdapter(viewer));

    viewer.addDropSupport(ops, transfers, delegatingDropAdapter);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JdtViewerDropSupport.java   
public void start() {
    Assert.isLegal(!fStarted);

    int ops= DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT;

    Transfer[] transfers= new Transfer[] {
        LocalSelectionTransfer.getInstance(),
        FileTransfer.getInstance(),
        PluginTransfer.getInstance()};

    fViewer.addDropSupport(ops, transfers, fDelegatingDropAdapter);

    fStarted= true;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:TypeHierarchyViewPart.java   
private void addDropAdapters(AbstractTreeViewer viewer) {
    Transfer[] transfers= new Transfer[] { LocalSelectionTransfer.getInstance(), PluginTransfer.getInstance() };
    int ops= DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT;

    DelegatingDropAdapter delegatingDropAdapter= new DelegatingDropAdapter();
    delegatingDropAdapter.addDropTargetListener(new TypeHierarchyTransferDropAdapter(this, viewer));
    delegatingDropAdapter.addDropTargetListener(new PluginTransferDropAdapter(viewer));

    viewer.addDropSupport(ops, transfers, delegatingDropAdapter);
}
项目:Eclipse-Postfix-Code-Completion    文件:PluginTransferDropAdapter.java   
/**
 * {@inheritDoc}
 */
public Transfer getTransfer() {
    return PluginTransfer.getInstance();
}
项目:Eclipse-Postfix-Code-Completion    文件:PluginTransferDropAdapter.java   
/**
 * {@inheritDoc}
 */
public boolean isEnabled(DropTargetEvent event) {
    return PluginTransfer.getInstance().isSupportedType(event.currentDataType);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PluginTransferDropAdapter.java   
/**
 * {@inheritDoc}
 */
public Transfer getTransfer() {
    return PluginTransfer.getInstance();
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PluginTransferDropAdapter.java   
/**
 * {@inheritDoc}
 */
public boolean isEnabled(DropTargetEvent event) {
    return PluginTransfer.getInstance().isSupportedType(event.currentDataType);
}