Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 22099 Details for
Bug 81795
[Bugs] No CVS access for bugzilla plug-in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to remove all warnings in org.eclipse.team.bugs
org.eclipse.team.bugs.patch (text/plain), 50.91 KB, created by
Ed Burnette
on 2005-05-31 16:26:24 EDT
(
hide
)
Description:
Patch to remove all warnings in org.eclipse.team.bugs
Filename:
MIME Type:
Creator:
Ed Burnette
Created:
2005-05-31 16:26:24 EDT
Size:
50.91 KB
patch
obsolete
>Index: src/org/eclipse/team/bugs/extension/BugsImages.java >=================================================================== >RCS file: /cvs/eclipse/bugzilla/org.eclipse.team.bugs/src/org/eclipse/team/bugs/extension/BugsImages.java,v >retrieving revision 1.1 >diff -u -r1.1 BugsImages.java >--- src/org/eclipse/team/bugs/extension/BugsImages.java 10 Jan 2005 17:08:28 -0000 1.1 >+++ src/org/eclipse/team/bugs/extension/BugsImages.java 31 May 2005 20:25:14 -0000 >@@ -1,43 +1,47 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Common Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/cpl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.team.bugs.extension; >- >-import java.net.URL; >- >-import org.eclipse.jface.resource.ImageDescriptor; >-import org.eclipse.team.bugs.internal.main.BugsPlugin; >-import org.eclipse.ui.internal.util.BundleUtility; >- >- >-/** >- * >- */ >-public class BugsImages { >- >- public static final ImageDescriptor REFRESH; >- >- static { >- REFRESH= getDescriptor(BugsPlugin.ID, "icons/refresh.gif"); >- } >- >- protected static ImageDescriptor getDescriptor(String pluginID, String localPath) { >- final URL url = BundleUtility.find(pluginID, localPath); >- return ImageDescriptor.createFromURL(url); >- } >- >- /** >- * No need for instantiation >- */ >- protected BugsImages() {} >-} >- >- >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.team.bugs.extension; >+ >+import java.net.URL; >+ >+import org.eclipse.core.runtime.Path; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.team.bugs.internal.main.BugsPlugin; >+import org.osgi.framework.Bundle; >+ >+ >+/** >+ * >+ */ >+public class BugsImages { >+ >+ public static final ImageDescriptor REFRESH; >+ >+ static { >+ REFRESH= getDescriptor(BugsPlugin.ID, "icons/refresh.gif"); >+ } >+ >+ protected static ImageDescriptor getDescriptor(String pluginID, String localPath) { >+ Bundle bundle = Platform.getBundle(pluginID); >+ Path path = new Path(localPath); >+ final URL url = Platform.find(bundle, path); >+ return ImageDescriptor.createFromURL(url); >+ } >+ >+ /** >+ * No need for instantiation >+ */ >+ protected BugsImages() {} >+} >+ >+ >Index: src/org/eclipse/team/bugs/internal/registry/AddProviderWizardDescription.java >=================================================================== >RCS file: /cvs/eclipse/bugzilla/org.eclipse.team.bugs/src/org/eclipse/team/bugs/internal/registry/AddProviderWizardDescription.java,v >retrieving revision 1.1 >diff -u -r1.1 AddProviderWizardDescription.java >--- src/org/eclipse/team/bugs/internal/registry/AddProviderWizardDescription.java 10 Jan 2005 17:08:28 -0000 1.1 >+++ src/org/eclipse/team/bugs/internal/registry/AddProviderWizardDescription.java 31 May 2005 20:25:14 -0000 >@@ -1,91 +1,90 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Common Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/cpl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.team.bugs.internal.registry; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IStatus; >-import org.eclipse.core.runtime.Status; >-import org.eclipse.jface.resource.ImageDescriptor; >-import org.eclipse.jface.wizard.IWizard; >-import org.eclipse.team.bugs.internal.main.BugsPlugin; >-import org.eclipse.ui.internal.WorkbenchPlugin; >- >-/** >- * Descriptor for accessing and creating synchronize wizards >- */ >-public class AddProviderWizardDescription { >- >- public static final String ATT_ID = "id"; //$NON-NLS-1$ >- public static final String ATT_NAME = "name"; //$NON-NLS-1$ >- public static final String ATT_ICON = "icon"; //$NON-NLS-1$ >- public static final String ATT_CLASS = "class"; //$NON-NLS-1$ >- public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$ >- >- private String label; >- private String className; >- private String description; >- private String id; >- private ImageDescriptor imageDescriptor; >- >- private IConfigurationElement configElement; >- >- public AddProviderWizardDescription(IConfigurationElement e) throws CoreException { >- configElement = e; >- loadFromExtension(); >- } >- >- public IWizard createWizard() throws CoreException { >- Object obj = WorkbenchPlugin.createExtension(configElement, ATT_CLASS); >- return (IWizard) obj; >- } >- >- private void loadFromExtension() throws CoreException { >- String identifier = configElement.getAttribute(ATT_ID); >- label = configElement.getAttribute(ATT_NAME); >- className = configElement.getAttribute(ATT_CLASS); >- description = configElement.getAttribute(ATT_DESCRIPTION); >- >- // Sanity check. >- if ((label == null) || (className == null) || (identifier == null) || (description == null)) { >- throw new CoreException(new Status(IStatus.ERROR, configElement.getDeclaringExtension().getNamespace(), 0, "Invalid extension (missing label or class name): " + identifier, //$NON-NLS-1$ >- null)); >- } >- >- id = identifier; >- } >- >- public String getId() { >- return id; >- } >- >- public String getDescription() { >- return description; >- } >- >- public ImageDescriptor getImageDescriptor() { >- if (imageDescriptor != null) >- return imageDescriptor; >- String iconName = configElement.getAttribute(ATT_ICON); >- if (iconName == null) >- return null; >- imageDescriptor = BugsPlugin.getImageDescriptorFromExtension(configElement.getDeclaringExtension(), iconName); >- return imageDescriptor; >- } >- >- public String getName() { >- return label; >- } >- >- public String toString() { >- return "Synchronize Participant Creation Wizard(" + getId() + ")"; //$NON-NLS-2$//$NON-NLS-1$ >- } >-} >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.team.bugs.internal.registry; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.jface.wizard.IWizard; >+import org.eclipse.team.bugs.internal.main.BugsPlugin; >+ >+/** >+ * Descriptor for accessing and creating synchronize wizards >+ */ >+public class AddProviderWizardDescription { >+ >+ public static final String ATT_ID = "id"; //$NON-NLS-1$ >+ public static final String ATT_NAME = "name"; //$NON-NLS-1$ >+ public static final String ATT_ICON = "icon"; //$NON-NLS-1$ >+ public static final String ATT_CLASS = "class"; //$NON-NLS-1$ >+ public static final String ATT_DESCRIPTION = "description"; //$NON-NLS-1$ >+ >+ private String label; >+ private String className; >+ private String description; >+ private String id; >+ private ImageDescriptor imageDescriptor; >+ >+ private IConfigurationElement configElement; >+ >+ public AddProviderWizardDescription(IConfigurationElement e) throws CoreException { >+ configElement = e; >+ loadFromExtension(); >+ } >+ >+ public IWizard createWizard() throws CoreException { >+ Object obj = configElement.createExecutableExtension(ATT_CLASS); >+ return (IWizard) obj; >+ } >+ >+ private void loadFromExtension() throws CoreException { >+ String identifier = configElement.getAttribute(ATT_ID); >+ label = configElement.getAttribute(ATT_NAME); >+ className = configElement.getAttribute(ATT_CLASS); >+ description = configElement.getAttribute(ATT_DESCRIPTION); >+ >+ // Sanity check. >+ if ((label == null) || (className == null) || (identifier == null) || (description == null)) { >+ throw new CoreException(new Status(IStatus.ERROR, configElement.getDeclaringExtension().getNamespace(), 0, "Invalid extension (missing label or class name): " + identifier, //$NON-NLS-1$ >+ null)); >+ } >+ >+ id = identifier; >+ } >+ >+ public String getId() { >+ return id; >+ } >+ >+ public String getDescription() { >+ return description; >+ } >+ >+ public ImageDescriptor getImageDescriptor() { >+ if (imageDescriptor != null) >+ return imageDescriptor; >+ String iconName = configElement.getAttribute(ATT_ICON); >+ if (iconName == null) >+ return null; >+ imageDescriptor = BugsPlugin.getImageDescriptorFromExtension(configElement.getDeclaringExtension(), iconName); >+ return imageDescriptor; >+ } >+ >+ public String getName() { >+ return label; >+ } >+ >+ public String toString() { >+ return "Synchronize Participant Creation Wizard(" + getId() + ")"; //$NON-NLS-2$//$NON-NLS-1$ >+ } >+} >Index: src/org/eclipse/team/bugs/internal/views/TreeManager.java >=================================================================== >RCS file: /cvs/eclipse/bugzilla/org.eclipse.team.bugs/src/org/eclipse/team/bugs/internal/views/TreeManager.java,v >retrieving revision 1.3 >diff -u -r1.3 TreeManager.java >--- src/org/eclipse/team/bugs/internal/views/TreeManager.java 5 May 2005 17:49:40 -0000 1.3 >+++ src/org/eclipse/team/bugs/internal/views/TreeManager.java 31 May 2005 20:25:14 -0000 >@@ -1,62 +1,61 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Common Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/cpl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.team.bugs.internal.views; >- >-import org.eclipse.swt.widgets.Tree; >-import org.eclipse.team.bugs.extension.Providers; >-import org.eclipse.team.bugs.model.IBugProvider; >-import org.eclipse.team.bugs.model.IGenericModel; >-import org.eclipse.team.bugs.model.IProviderListener; >- >- >-class TreeManager implements IProviderListener { >- >- private BugView fView; >- private Tree fTree; >- >- public TreeManager(BugView view) { >- fView= view; >- fTree= view.getViewer().getTree(); >- } >- >- public void elementsAdded(IGenericModel parent, IGenericModel[] children) { >- fTree.setRedraw(false); >- try { >- fView.getViewer().refresh(parent != null ? parent : (Object)Providers.getInstance()); >- } finally { >- if (parent != null) { >- fView.getViewer().setExpandedState(parent.getProvider(), true); >- } >- fTree.setRedraw(true); >- } >- } >- >- public void elementsChanged(IGenericModel[] elements) { >- try { >- for (int i = 0; i < elements.length; i++) { >- fView.getViewer().update(elements[i], null); >- } >- } finally { >- fView.getViewer().setExpandedState(elements[0].getProvider(), true); >- fTree.setRedraw(true); >- } >- } >- >- public void elementsRemoved(IGenericModel parent, IGenericModel[] children) { >- fTree.setRedraw(false); >- try { >- fView.getViewer().refresh( parent != null ? parent : (Object)Providers.getInstance()); >- } finally { >- fTree.setRedraw(true); >- } >- } >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.team.bugs.internal.views; >+ >+import org.eclipse.swt.widgets.Tree; >+import org.eclipse.team.bugs.extension.Providers; >+import org.eclipse.team.bugs.model.IGenericModel; >+import org.eclipse.team.bugs.model.IProviderListener; >+ >+ >+class TreeManager implements IProviderListener { >+ >+ private BugView fView; >+ private Tree fTree; >+ >+ public TreeManager(BugView view) { >+ fView= view; >+ fTree= view.getViewer().getTree(); >+ } >+ >+ public void elementsAdded(IGenericModel parent, IGenericModel[] children) { >+ fTree.setRedraw(false); >+ try { >+ fView.getViewer().refresh(parent != null ? parent : (Object)Providers.getInstance()); >+ } finally { >+ if (parent != null) { >+ fView.getViewer().setExpandedState(parent.getProvider(), true); >+ } >+ fTree.setRedraw(true); >+ } >+ } >+ >+ public void elementsChanged(IGenericModel[] elements) { >+ try { >+ for (int i = 0; i < elements.length; i++) { >+ fView.getViewer().update(elements[i], null); >+ } >+ } finally { >+ fView.getViewer().setExpandedState(elements[0].getProvider(), true); >+ fTree.setRedraw(true); >+ } >+ } >+ >+ public void elementsRemoved(IGenericModel parent, IGenericModel[] children) { >+ fTree.setRedraw(false); >+ try { >+ fView.getViewer().refresh( parent != null ? parent : (Object)Providers.getInstance()); >+ } finally { >+ fTree.setRedraw(true); >+ } >+ } > } >\ No newline at end of file >Index: src/org/eclipse/team/bugs/internal/views/dnd/BugsDragDropAdapter.java >=================================================================== >RCS file: /cvs/eclipse/bugzilla/org.eclipse.team.bugs/src/org/eclipse/team/bugs/internal/views/dnd/BugsDragDropAdapter.java,v >retrieving revision 1.1 >diff -u -r1.1 BugsDragDropAdapter.java >--- src/org/eclipse/team/bugs/internal/views/dnd/BugsDragDropAdapter.java 10 Jan 2005 17:08:28 -0000 1.1 >+++ src/org/eclipse/team/bugs/internal/views/dnd/BugsDragDropAdapter.java 31 May 2005 20:25:14 -0000 >@@ -1,32 +1,32 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Common Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/cpl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.team.bugs.internal.views.dnd; >- >-import org.eclipse.swt.dnd.DropTargetEvent; >-import org.eclipse.team.bugs.model.IGenericModel; >- >-/** >- * >- */ >-public abstract class BugsDragDropAdapter { >- >- /** >- * Yields the model element for a given SWT item of the tree. >- * TODO: This is not JFace API, we should find a way to do this in a better way. >- * >- * @param item the SWT item. >- * @return the model element. >- */ >- protected IGenericModel getModelElement(DropTargetEvent event) { >- return event.item == null ? null : (IGenericModel)event.item.getData(); >- } >-} >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.team.bugs.internal.views.dnd; >+ >+import org.eclipse.swt.dnd.DropTargetEvent; >+import org.eclipse.team.bugs.model.IGenericModel; >+ >+/** >+ * >+ */ >+public abstract class BugsDragDropAdapter { >+ >+ /** >+ * Yields the model element for a given SWT item of the tree. >+ * TODO: This is not JFace API, we should find a way to do this in a better way. >+ * >+ * @param event the SWT item. >+ * @return the model element. >+ */ >+ protected IGenericModel getModelElement(DropTargetEvent event) { >+ return event.item == null ? null : (IGenericModel)event.item.getData(); >+ } >+} >Index: src/org/eclipse/team/bugs/internal/views/dnd/DragManager.java >=================================================================== >RCS file: /cvs/eclipse/bugzilla/org.eclipse.team.bugs/src/org/eclipse/team/bugs/internal/views/dnd/DragManager.java,v >retrieving revision 1.1 >diff -u -r1.1 DragManager.java >--- src/org/eclipse/team/bugs/internal/views/dnd/DragManager.java 10 Jan 2005 17:08:28 -0000 1.1 >+++ src/org/eclipse/team/bugs/internal/views/dnd/DragManager.java 31 May 2005 20:25:14 -0000 >@@ -1,195 +1,194 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Common Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/cpl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.team.bugs.internal.views.dnd; >- >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.HashMap; >-import java.util.HashSet; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >-import java.util.Set; >- >-import org.eclipse.jface.util.Assert; >-import org.eclipse.swt.dnd.DND; >-import org.eclipse.swt.dnd.DragSource; >-import org.eclipse.swt.dnd.DragSourceEvent; >-import org.eclipse.swt.dnd.DragSourceListener; >-import org.eclipse.swt.dnd.Transfer; >-import org.eclipse.swt.dnd.TransferData; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.team.bugs.internal.views.BugView; >-import org.eclipse.team.bugs.model.IBugProvider; >- >-/** >- * This class listens to drag events on the bug view and dispatches the >- * event to the plugin implementing the selected provider. Every provider >- * can register exactly one listener. >- */ >-public class DragManager implements DragSourceListener { >- >- /** >- * A helper class to store the listeners, along with their supported >- * transfers and operations. >- */ >- private static class ListenerInfo { >- >- private Object fListener; >- private Transfer [] fTransfers; >- >- public Object getListener() { >- return fListener; >- } >- >- public Transfer [] getTransferTypes() { >- return fTransfers; >- } >- >- public boolean supports(TransferData transferData) { >- final List transfers= Arrays.asList(fTransfers); >- for (Iterator iter = transfers.iterator(); iter.hasNext();) { >- if (((Transfer)iter.next()).isSupportedType(transferData)) >- return true; >- } >- return false; >- } >- >- public ListenerInfo(Object listener, Transfer [] transferTypes) { >- fListener= listener; >- fTransfers= transferTypes; >- } >- } >- >- >- private final BugView fView; >- private final Control fControl; >- >- private DragSource fDragMoveSource; >- >- private final Map fListenerInfos; >- >- /** >- * The supported transfers. Duplicate entries mean that a transfer is supported by more than one >- * listener. >- */ >- private final List fTransfers; >- >- private ListenerInfo fCurrent; >- >- >- public DragManager(BugView view) { >- fView= view; >- fListenerInfos= new HashMap(); >- fTransfers= new ArrayList(); >- fControl= view.getViewer().getControl(); >- fCurrent= null; >- fDragMoveSource= new DragSource(fControl, DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT | DND.DROP_TARGET_MOVE); >- fDragMoveSource.addDragListener(this); >- } >- >- /** >- * The event is dispatched to the selected provider if the listener registered for this provider >- * matches the type of transfer and operation. Else, nothing is done. >- * @see org.eclipse.swt.dnd.DragSourceListener#dragStart(org.eclipse.swt.dnd.DragSourceEvent) >- */ >- public void dragStart(DragSourceEvent event){ >- fCurrent= getListenerInfo(); >- if (fCurrent == null) { >- event.doit= false; >- } else { >- ((DragSourceListener)fCurrent.getListener()).dragStart(event); >- if (!event.doit) >- fCurrent= null; >- } >- } >- >- /** >- * The event is dispatched to the selected provider if the listener registered for this provider >- * matches the type of transfer and operation. Else, nothing is done. >- * @see org.eclipse.swt.dnd.DragSourceListener#dragSetData(org.eclipse.swt.dnd.DragSourceEvent) >- */ >- public void dragSetData(DragSourceEvent event){ >- Assert.isNotNull(fCurrent); >- ((DragSourceListener)fCurrent.getListener()).dragSetData(event); >- } >- >- /** >- * The event is dispatched to the selected provider if the listener registered for this provider >- * matches the type of transfer and operation. Else, nothing is done. >- * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished(org.eclipse.swt.dnd.DragSourceEvent) >- */ >- public void dragFinished(DragSourceEvent event){ >- Assert.isNotNull(fCurrent); >- ((DragSourceListener)fCurrent.getListener()).dragFinished(event); >- fCurrent= null; >- } >- >- /** >- * Register a <code>DragSourceListener</code> for the given provider. For every provider, one listener >- * can be registered. If this method is called and a listener for the given provider is already registered, >- * the previous listener is removed and the new one is added. >- * @param provider the provider >- * @param operations the supported operations >- * @param transferTypes the supported types >- * @param listener the listener to be notified >- */ >- public void addDragSupport(IBugProvider provider, Transfer[] transferTypes, DragSourceListener listener) { >- if (fListenerInfos.containsKey(provider)) >- internalRemoveSupport(provider); >- fListenerInfos.put(provider, new ListenerInfo(listener, transferTypes)); >- fTransfers.addAll(Arrays.asList(transferTypes)); >- updateDragSource(); >- } >- >- /** >- * Remove the listener for the given provider. >- * @param provider the provider. >- */ >- public void removeDragSupport(IBugProvider provider) { >- internalRemoveSupport(provider); >- updateDragSource(); >- } >- >- /** >- * Update the drag source with the set of all supported transfer types. >- */ >- private void updateDragSource() { >- final Set set= new HashSet(fTransfers); >- final Transfer [] transfers= new Transfer[set.size()]; >- set.toArray(transfers); >- fDragMoveSource.setTransfer(transfers); >- } >- >- /** >- * A helper method to unregister the listener for a provider. >- * @param provider the provider >- */ >- private void internalRemoveSupport(IBugProvider provider) { >- final ListenerInfo info= (ListenerInfo)fListenerInfos.remove(provider); >- if (info == null) >- return; >- final Transfer [] transfers= info.getTransferTypes(); >- for (int i = 0; i < transfers.length; i++) { >- fTransfers.remove(transfers[i]); >- } >- } >- >- private ListenerInfo getListenerInfo() { >- final IBugProvider provider= fView.getSelection().getSelectedProvider(); >- >- if (provider == null) >- return null; >- >- return (ListenerInfo)fListenerInfos.get(provider); >- } >-} >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.team.bugs.internal.views.dnd; >+ >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.HashMap; >+import java.util.HashSet; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+import java.util.Set; >+ >+import org.eclipse.jface.util.Assert; >+import org.eclipse.swt.dnd.DND; >+import org.eclipse.swt.dnd.DragSource; >+import org.eclipse.swt.dnd.DragSourceEvent; >+import org.eclipse.swt.dnd.DragSourceListener; >+import org.eclipse.swt.dnd.Transfer; >+import org.eclipse.swt.dnd.TransferData; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.team.bugs.internal.views.BugView; >+import org.eclipse.team.bugs.model.IBugProvider; >+ >+/** >+ * This class listens to drag events on the bug view and dispatches the >+ * event to the plugin implementing the selected provider. Every provider >+ * can register exactly one listener. >+ */ >+public class DragManager implements DragSourceListener { >+ >+ /** >+ * A helper class to store the listeners, along with their supported >+ * transfers and operations. >+ */ >+ private static class ListenerInfo { >+ >+ private Object fListener; >+ private Transfer [] fTransfers; >+ >+ public Object getListener() { >+ return fListener; >+ } >+ >+ public Transfer [] getTransferTypes() { >+ return fTransfers; >+ } >+ >+ public boolean supports(TransferData transferData) { >+ final List transfers= Arrays.asList(fTransfers); >+ for (Iterator iter = transfers.iterator(); iter.hasNext();) { >+ if (((Transfer)iter.next()).isSupportedType(transferData)) >+ return true; >+ } >+ return false; >+ } >+ >+ public ListenerInfo(Object listener, Transfer [] transferTypes) { >+ fListener= listener; >+ fTransfers= transferTypes; >+ } >+ } >+ >+ >+ private final BugView fView; >+ private final Control fControl; >+ >+ private DragSource fDragMoveSource; >+ >+ private final Map fListenerInfos; >+ >+ /** >+ * The supported transfers. Duplicate entries mean that a transfer is supported by more than one >+ * listener. >+ */ >+ private final List fTransfers; >+ >+ private ListenerInfo fCurrent; >+ >+ >+ public DragManager(BugView view) { >+ fView= view; >+ fListenerInfos= new HashMap(); >+ fTransfers= new ArrayList(); >+ fControl= view.getViewer().getControl(); >+ fCurrent= null; >+ fDragMoveSource= new DragSource(fControl, DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK | DND.DROP_DEFAULT | DND.DROP_TARGET_MOVE); >+ fDragMoveSource.addDragListener(this); >+ } >+ >+ /** >+ * The event is dispatched to the selected provider if the listener registered for this provider >+ * matches the type of transfer and operation. Else, nothing is done. >+ * @see org.eclipse.swt.dnd.DragSourceListener#dragStart(org.eclipse.swt.dnd.DragSourceEvent) >+ */ >+ public void dragStart(DragSourceEvent event){ >+ fCurrent= getListenerInfo(); >+ if (fCurrent == null) { >+ event.doit= false; >+ } else { >+ ((DragSourceListener)fCurrent.getListener()).dragStart(event); >+ if (!event.doit) >+ fCurrent= null; >+ } >+ } >+ >+ /** >+ * The event is dispatched to the selected provider if the listener registered for this provider >+ * matches the type of transfer and operation. Else, nothing is done. >+ * @see org.eclipse.swt.dnd.DragSourceListener#dragSetData(org.eclipse.swt.dnd.DragSourceEvent) >+ */ >+ public void dragSetData(DragSourceEvent event){ >+ Assert.isNotNull(fCurrent); >+ ((DragSourceListener)fCurrent.getListener()).dragSetData(event); >+ } >+ >+ /** >+ * The event is dispatched to the selected provider if the listener registered for this provider >+ * matches the type of transfer and operation. Else, nothing is done. >+ * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished(org.eclipse.swt.dnd.DragSourceEvent) >+ */ >+ public void dragFinished(DragSourceEvent event){ >+ Assert.isNotNull(fCurrent); >+ ((DragSourceListener)fCurrent.getListener()).dragFinished(event); >+ fCurrent= null; >+ } >+ >+ /** >+ * Register a <code>DragSourceListener</code> for the given provider. For every provider, one listener >+ * can be registered. If this method is called and a listener for the given provider is already registered, >+ * the previous listener is removed and the new one is added. >+ * @param provider the provider >+ * @param transferTypes the supported types >+ * @param listener the listener to be notified >+ */ >+ public void addDragSupport(IBugProvider provider, Transfer[] transferTypes, DragSourceListener listener) { >+ if (fListenerInfos.containsKey(provider)) >+ internalRemoveSupport(provider); >+ fListenerInfos.put(provider, new ListenerInfo(listener, transferTypes)); >+ fTransfers.addAll(Arrays.asList(transferTypes)); >+ updateDragSource(); >+ } >+ >+ /** >+ * Remove the listener for the given provider. >+ * @param provider the provider. >+ */ >+ public void removeDragSupport(IBugProvider provider) { >+ internalRemoveSupport(provider); >+ updateDragSource(); >+ } >+ >+ /** >+ * Update the drag source with the set of all supported transfer types. >+ */ >+ private void updateDragSource() { >+ final Set set= new HashSet(fTransfers); >+ final Transfer [] transfers= new Transfer[set.size()]; >+ set.toArray(transfers); >+ fDragMoveSource.setTransfer(transfers); >+ } >+ >+ /** >+ * A helper method to unregister the listener for a provider. >+ * @param provider the provider >+ */ >+ private void internalRemoveSupport(IBugProvider provider) { >+ final ListenerInfo info= (ListenerInfo)fListenerInfos.remove(provider); >+ if (info == null) >+ return; >+ final Transfer [] transfers= info.getTransferTypes(); >+ for (int i = 0; i < transfers.length; i++) { >+ fTransfers.remove(transfers[i]); >+ } >+ } >+ >+ private ListenerInfo getListenerInfo() { >+ final IBugProvider provider= fView.getSelection().getSelectedProvider(); >+ >+ if (provider == null) >+ return null; >+ >+ return (ListenerInfo)fListenerInfos.get(provider); >+ } >+} >Index: src/org/eclipse/team/bugs/internal/views/dnd/DropManager.java >=================================================================== >RCS file: /cvs/eclipse/bugzilla/org.eclipse.team.bugs/src/org/eclipse/team/bugs/internal/views/dnd/DropManager.java,v >retrieving revision 1.1 >diff -u -r1.1 DropManager.java >--- src/org/eclipse/team/bugs/internal/views/dnd/DropManager.java 10 Jan 2005 17:08:28 -0000 1.1 >+++ src/org/eclipse/team/bugs/internal/views/dnd/DropManager.java 31 May 2005 20:25:14 -0000 >@@ -1,241 +1,241 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2004 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Common Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/cpl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.team.bugs.internal.views.dnd; >- >-import java.util.AbstractCollection; >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.HashMap; >-import java.util.HashSet; >-import java.util.Iterator; >-import java.util.List; >-import java.util.Map; >-import java.util.Set; >- >-import org.eclipse.swt.dnd.DND; >-import org.eclipse.swt.dnd.DropTarget; >-import org.eclipse.swt.dnd.DropTargetEvent; >-import org.eclipse.swt.dnd.DropTargetListener; >-import org.eclipse.swt.dnd.Transfer; >-import org.eclipse.swt.dnd.TransferData; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.team.bugs.internal.views.BugView; >-import org.eclipse.team.bugs.model.IBugProvider; >-import org.eclipse.team.bugs.model.IGenericModel; >- >-/** >- * >- */ >-public class DropManager implements DropTargetListener { >- >- /** >- * A helper class to store the listeners, along with their supported >- * transfers and operations. >- */ >- private static class ListenerInfo { >- >- private DropTargetListener fListener; >- private int fOperations; >- private Transfer [] fTransfers; >- >- public DropTargetListener getListener() { >- return fListener; >- } >- >- public int getOperations() { >- return fOperations; >- } >- >- public Transfer [] getTransferTypes() { >- return fTransfers; >- } >- >- public boolean supports(TransferData [] transferData, int operations) { >- if ((fOperations & operations) == 0) >- return false; >- final List transfers= Arrays.asList(fTransfers); >- for (Iterator iter = transfers.iterator(); iter.hasNext();) { >- final Transfer transfer= (Transfer)iter.next(); >- for (int i = 0; i < transferData.length; i++) { >- if (transfer.isSupportedType(transferData[i])) { >- return true; >- } >- } >- } >- return false; >- } >- >- public ListenerInfo(DropTargetListener listener, int operations, Transfer [] transferTypes) { >- fListener= listener; >- fOperations= operations; >- fTransfers= transferTypes; >- } >- } >- >- private final Map fListenerInfos; >- private final AbstractCollection fTransfers; >- private final DropTarget fDropTarget; >- private Control fControl; >- >- /** >- * @param viewer >- */ >- public DropManager(BugView view) { >- super(); >- fListenerInfos= new HashMap(); >- fTransfers= new ArrayList(); >- fControl= view.getViewer().getControl(); >- fDropTarget= new DropTarget(fControl, DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT | DND.DROP_TARGET_MOVE); >- fDropTarget.setTransfer(new Transfer[0]); >- fDropTarget.addDropListener(this); >- } >- >- /** >- * Register a <code>DropTargetListener</code> for the given provider. For every provider, one listener >- * can be registered. If this method is called and a listener for the given provider is already registered, >- * the previous listener is removed and the new one is added. >- * @param provider the provider >- * @param operations the supported operations >- * @param transferTypes the supported types >- * @param listener the listener to be notified >- */ >- public void addDropSupport(IBugProvider provider, int operations, Transfer[] transferTypes, DropTargetListener listener) { >- if (fListenerInfos.containsKey(provider)) >- internalRemoveSupport(provider); >- fListenerInfos.put(provider, new ListenerInfo(listener, operations, transferTypes)); >- fTransfers.addAll(Arrays.asList(transferTypes)); >- updateDropTarget(); >- } >- >- /** >- * Remove the listener for the given provider. >- * @param provider the provider. >- */ >- public void removeDropSupport(IBugProvider provider) { >- internalRemoveSupport(provider); >- updateDropTarget(); >- } >- >- /** >- * Update the drag source with the set of all supported transfer types. >- */ >- private void updateDropTarget() { >- final Set set= new HashSet(fTransfers); >- final Transfer [] transfers= new Transfer[set.size()]; >- set.toArray(transfers); >- fDropTarget.setTransfer(transfers); >- } >- >- /** >- * A helper method to unregister the listener for a provider. >- * @param provider the provider >- */ >- private void internalRemoveSupport(IBugProvider provider) { >- final ListenerInfo info= (ListenerInfo)fListenerInfos.remove(provider); >- if (info == null) >- return; >- final Transfer [] transfers= info.getTransferTypes(); >- for (int i = 0; i < transfers.length; i++) { >- fTransfers.remove(transfers[i]); >- } >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.swt.dnd.DropTargetListener#dragEnter(org.eclipse.swt.dnd.DropTargetEvent) >- */ >- public void dragEnter(DropTargetEvent event) { >- final ListenerInfo info= getCurrentInfo(event); >- if (info != null && info.supports(event.dataTypes, event.operations)) { >- info.getListener().dragEnter(event); >- return; >- } >- event.detail= DND.DROP_NONE; >- event.currentDataType= null; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.swt.dnd.DropTargetListener#dragLeave(org.eclipse.swt.dnd.DropTargetEvent) >- */ >- public void dragLeave(DropTargetEvent event) { >- final ListenerInfo info= getCurrentInfo(event); >- if (info != null && info.supports(event.dataTypes, event.operations)) { >- info.getListener().dragLeave(event); >- return; >- } >- event.detail= DND.DROP_NONE; >- event.currentDataType= null; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent) >- */ >- public void dragOperationChanged(DropTargetEvent event) { >- final ListenerInfo info= getCurrentInfo(event); >- if (info != null && info.supports(event.dataTypes, event.operations)) { >- info.getListener().dragOperationChanged(event); >- return; >- } >- event.detail= DND.DROP_NONE; >- event.currentDataType= null; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.swt.dnd.DropTargetListener#dragOver(org.eclipse.swt.dnd.DropTargetEvent) >- */ >- public void dragOver(DropTargetEvent event) { >- final ListenerInfo info= getCurrentInfo(event); >- if (info != null && info.supports(event.dataTypes, event.operations)) { >- info.getListener().dragOver(event); >- return; >- } >- event.detail= DND.DROP_NONE; >- event.currentDataType= null; >- } >- >- >- /* (non-Javadoc) >- * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent) >- */ >- public void drop(DropTargetEvent event) { >- final ListenerInfo info= getCurrentInfo(event); >- if (info.supports(event.dataTypes, event.operations)) { >- info.getListener().drop(event); >- } else { >- event.detail= DND.DROP_NONE; >- event.currentDataType= null; >- } >- } >- >- >- /* (non-Javadoc) >- * @see org.eclipse.swt.dnd.DropTargetListener#dropAccept(org.eclipse.swt.dnd.DropTargetEvent) >- */ >- public void dropAccept(DropTargetEvent event) { >- final ListenerInfo info= getCurrentInfo(event); >- if (info.supports(event.dataTypes, event.operations)) { >- info.getListener().dropAccept(event); >- } else { >- event.detail= DND.DROP_NONE; >- event.currentDataType= null; >- } >- } >- >- protected ListenerInfo getCurrentInfo(DropTargetEvent event) { >- if (event.item == null) >- return null; >- final IGenericModel element= (IGenericModel)event.item.getData(); >- if (element == null) >- return null; >- final IBugProvider provider= element.getProvider(); >- return (ListenerInfo)fListenerInfos.get(provider); >- } >-} >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.team.bugs.internal.views.dnd; >+ >+import java.util.AbstractCollection; >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.HashMap; >+import java.util.HashSet; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+import java.util.Set; >+ >+import org.eclipse.swt.dnd.DND; >+import org.eclipse.swt.dnd.DropTarget; >+import org.eclipse.swt.dnd.DropTargetEvent; >+import org.eclipse.swt.dnd.DropTargetListener; >+import org.eclipse.swt.dnd.Transfer; >+import org.eclipse.swt.dnd.TransferData; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.team.bugs.internal.views.BugView; >+import org.eclipse.team.bugs.model.IBugProvider; >+import org.eclipse.team.bugs.model.IGenericModel; >+ >+/** >+ * >+ */ >+public class DropManager implements DropTargetListener { >+ >+ /** >+ * A helper class to store the listeners, along with their supported >+ * transfers and operations. >+ */ >+ private static class ListenerInfo { >+ >+ private DropTargetListener fListener; >+ private int fOperations; >+ private Transfer [] fTransfers; >+ >+ public DropTargetListener getListener() { >+ return fListener; >+ } >+ >+ public int getOperations() { >+ return fOperations; >+ } >+ >+ public Transfer [] getTransferTypes() { >+ return fTransfers; >+ } >+ >+ public boolean supports(TransferData [] transferData, int operations) { >+ if ((fOperations & operations) == 0) >+ return false; >+ final List transfers= Arrays.asList(fTransfers); >+ for (Iterator iter = transfers.iterator(); iter.hasNext();) { >+ final Transfer transfer= (Transfer)iter.next(); >+ for (int i = 0; i < transferData.length; i++) { >+ if (transfer.isSupportedType(transferData[i])) { >+ return true; >+ } >+ } >+ } >+ return false; >+ } >+ >+ public ListenerInfo(DropTargetListener listener, int operations, Transfer [] transferTypes) { >+ fListener= listener; >+ fOperations= operations; >+ fTransfers= transferTypes; >+ } >+ } >+ >+ private final Map fListenerInfos; >+ private final AbstractCollection fTransfers; >+ private final DropTarget fDropTarget; >+ private Control fControl; >+ >+ /** >+ * @param view >+ */ >+ public DropManager(BugView view) { >+ super(); >+ fListenerInfos= new HashMap(); >+ fTransfers= new ArrayList(); >+ fControl= view.getViewer().getControl(); >+ fDropTarget= new DropTarget(fControl, DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT | DND.DROP_TARGET_MOVE); >+ fDropTarget.setTransfer(new Transfer[0]); >+ fDropTarget.addDropListener(this); >+ } >+ >+ /** >+ * Register a <code>DropTargetListener</code> for the given provider. For every provider, one listener >+ * can be registered. If this method is called and a listener for the given provider is already registered, >+ * the previous listener is removed and the new one is added. >+ * @param provider the provider >+ * @param operations the supported operations >+ * @param transferTypes the supported types >+ * @param listener the listener to be notified >+ */ >+ public void addDropSupport(IBugProvider provider, int operations, Transfer[] transferTypes, DropTargetListener listener) { >+ if (fListenerInfos.containsKey(provider)) >+ internalRemoveSupport(provider); >+ fListenerInfos.put(provider, new ListenerInfo(listener, operations, transferTypes)); >+ fTransfers.addAll(Arrays.asList(transferTypes)); >+ updateDropTarget(); >+ } >+ >+ /** >+ * Remove the listener for the given provider. >+ * @param provider the provider. >+ */ >+ public void removeDropSupport(IBugProvider provider) { >+ internalRemoveSupport(provider); >+ updateDropTarget(); >+ } >+ >+ /** >+ * Update the drag source with the set of all supported transfer types. >+ */ >+ private void updateDropTarget() { >+ final Set set= new HashSet(fTransfers); >+ final Transfer [] transfers= new Transfer[set.size()]; >+ set.toArray(transfers); >+ fDropTarget.setTransfer(transfers); >+ } >+ >+ /** >+ * A helper method to unregister the listener for a provider. >+ * @param provider the provider >+ */ >+ private void internalRemoveSupport(IBugProvider provider) { >+ final ListenerInfo info= (ListenerInfo)fListenerInfos.remove(provider); >+ if (info == null) >+ return; >+ final Transfer [] transfers= info.getTransferTypes(); >+ for (int i = 0; i < transfers.length; i++) { >+ fTransfers.remove(transfers[i]); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.dnd.DropTargetListener#dragEnter(org.eclipse.swt.dnd.DropTargetEvent) >+ */ >+ public void dragEnter(DropTargetEvent event) { >+ final ListenerInfo info= getCurrentInfo(event); >+ if (info != null && info.supports(event.dataTypes, event.operations)) { >+ info.getListener().dragEnter(event); >+ return; >+ } >+ event.detail= DND.DROP_NONE; >+ event.currentDataType= null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.dnd.DropTargetListener#dragLeave(org.eclipse.swt.dnd.DropTargetEvent) >+ */ >+ public void dragLeave(DropTargetEvent event) { >+ final ListenerInfo info= getCurrentInfo(event); >+ if (info != null && info.supports(event.dataTypes, event.operations)) { >+ info.getListener().dragLeave(event); >+ return; >+ } >+ event.detail= DND.DROP_NONE; >+ event.currentDataType= null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent) >+ */ >+ public void dragOperationChanged(DropTargetEvent event) { >+ final ListenerInfo info= getCurrentInfo(event); >+ if (info != null && info.supports(event.dataTypes, event.operations)) { >+ info.getListener().dragOperationChanged(event); >+ return; >+ } >+ event.detail= DND.DROP_NONE; >+ event.currentDataType= null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.dnd.DropTargetListener#dragOver(org.eclipse.swt.dnd.DropTargetEvent) >+ */ >+ public void dragOver(DropTargetEvent event) { >+ final ListenerInfo info= getCurrentInfo(event); >+ if (info != null && info.supports(event.dataTypes, event.operations)) { >+ info.getListener().dragOver(event); >+ return; >+ } >+ event.detail= DND.DROP_NONE; >+ event.currentDataType= null; >+ } >+ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent) >+ */ >+ public void drop(DropTargetEvent event) { >+ final ListenerInfo info= getCurrentInfo(event); >+ if (info.supports(event.dataTypes, event.operations)) { >+ info.getListener().drop(event); >+ } else { >+ event.detail= DND.DROP_NONE; >+ event.currentDataType= null; >+ } >+ } >+ >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.dnd.DropTargetListener#dropAccept(org.eclipse.swt.dnd.DropTargetEvent) >+ */ >+ public void dropAccept(DropTargetEvent event) { >+ final ListenerInfo info= getCurrentInfo(event); >+ if (info.supports(event.dataTypes, event.operations)) { >+ info.getListener().dropAccept(event); >+ } else { >+ event.detail= DND.DROP_NONE; >+ event.currentDataType= null; >+ } >+ } >+ >+ protected ListenerInfo getCurrentInfo(DropTargetEvent event) { >+ if (event.item == null) >+ return null; >+ final IGenericModel element= (IGenericModel)event.item.getData(); >+ if (element == null) >+ return null; >+ final IBugProvider provider= element.getProvider(); >+ return (ListenerInfo)fListenerInfos.get(provider); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 81795
: 22099 |
22100