mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
bug 339015: Preference "Show source roots at the top of project" should also apply for Make Target View
This commit is contained in:
parent
9002e4e9c1
commit
2242cfd362
9 changed files with 353 additions and 44 deletions
|
@ -12,6 +12,7 @@
|
||||||
package org.eclipse.cdt.make.internal.ui.dnd;
|
package org.eclipse.cdt.make.internal.ui.dnd;
|
||||||
|
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
|
import org.eclipse.cdt.make.ui.TargetSourceContainer;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.jface.util.TransferDropTargetListener;
|
import org.eclipse.jface.util.TransferDropTargetListener;
|
||||||
import org.eclipse.swt.dnd.DND;
|
import org.eclipse.swt.dnd.DND;
|
||||||
|
@ -257,6 +258,9 @@ public abstract class AbstractContainerAreaDropAdapter implements TransferDropTa
|
||||||
return ((IMakeTarget) dropTarget).getContainer();
|
return ((IMakeTarget) dropTarget).getContainer();
|
||||||
} else if (dropTarget instanceof IContainer) {
|
} else if (dropTarget instanceof IContainer) {
|
||||||
return (IContainer) dropTarget;
|
return (IContainer) dropTarget;
|
||||||
|
} else if (dropTarget instanceof TargetSourceContainer) {
|
||||||
|
IContainer dropContainer = ((TargetSourceContainer) dropTarget).getContainer();
|
||||||
|
return dropContainer;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,19 +7,33 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Andrew Gvozdev - some improvements such as adding source folders bug 339015
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.ui;
|
package org.eclipse.cdt.make.ui;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
|
import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICDescriptionDelta;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionListener;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICSettingObject;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
import org.eclipse.cdt.make.core.IMakeTargetListener;
|
import org.eclipse.cdt.make.core.IMakeTargetListener;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.MakeTargetEvent;
|
import org.eclipse.cdt.make.core.MakeTargetEvent;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceChangeEvent;
|
import org.eclipse.core.resources.IResourceChangeEvent;
|
||||||
import org.eclipse.core.resources.IResourceChangeListener;
|
import org.eclipse.core.resources.IResourceChangeListener;
|
||||||
|
@ -27,7 +41,6 @@ import org.eclipse.core.resources.IResourceDelta;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
|
||||||
import org.eclipse.jface.viewers.AbstractTreeViewer;
|
import org.eclipse.jface.viewers.AbstractTreeViewer;
|
||||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||||
import org.eclipse.jface.viewers.StructuredViewer;
|
import org.eclipse.jface.viewers.StructuredViewer;
|
||||||
|
@ -36,63 +49,132 @@ import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Content provider for Make Targets view and for Make Targets dialog from
|
||||||
|
* "Make Targets"->"Build..." in project context menu.
|
||||||
|
*
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class MakeContentProvider implements ITreeContentProvider, IMakeTargetListener, IResourceChangeListener {
|
public class MakeContentProvider implements ITreeContentProvider, IMakeTargetListener, IResourceChangeListener, ICProjectDescriptionListener {
|
||||||
|
/** presentation of the content, i.e. for MakeView tree of for BuildTargetDialog table */
|
||||||
protected boolean bFlatten;
|
protected boolean bFlatten;
|
||||||
|
|
||||||
protected StructuredViewer viewer;
|
protected StructuredViewer viewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for MakeContentProvider
|
* Default constructor.
|
||||||
*/
|
*/
|
||||||
public MakeContentProvider() {
|
public MakeContentProvider() {
|
||||||
this(false);
|
this(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param flat - {@code true} for "flat" representation for a table
|
||||||
|
* or {@code false} to represent as a tree.
|
||||||
|
*/
|
||||||
public MakeContentProvider(boolean flat) {
|
public MakeContentProvider(boolean flat) {
|
||||||
bFlatten = flat;
|
bFlatten = flat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
|
||||||
|
*/
|
||||||
public Object[] getChildren(Object obj) {
|
public Object[] getChildren(Object obj) {
|
||||||
if (obj instanceof IWorkspaceRoot) {
|
if (obj instanceof IWorkspaceRoot) {
|
||||||
try {
|
try {
|
||||||
return MakeCorePlugin.getDefault().getTargetManager().getTargetBuilderProjects();
|
return MakeCorePlugin.getDefault().getTargetManager().getTargetBuilderProjects();
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// ignore
|
MakeCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
} else if (obj instanceof IContainer) {
|
} else if (obj instanceof IContainer) {
|
||||||
ArrayList<IAdaptable> children = new ArrayList<IAdaptable>();
|
IContainer container = (IContainer)obj;
|
||||||
|
ArrayList<Object> children = new ArrayList<Object>();
|
||||||
|
|
||||||
|
boolean isAddingSourceRoots = !bFlatten && (container instanceof IProject) && CCorePlugin.showSourceRootsAtTopOfProject();
|
||||||
|
|
||||||
|
// add source roots if necessary
|
||||||
|
if (isAddingSourceRoots) {
|
||||||
|
IProject project = (IProject) container;
|
||||||
|
ICSourceEntry[] srcEntries = getSourceEntries(project);
|
||||||
|
for (ICSourceEntry srcEntry : srcEntries) {
|
||||||
|
if (!srcEntry.getFullPath().equals(project.getFullPath())) {
|
||||||
|
children.add(new TargetSourceContainer(srcEntry));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add regular folders
|
||||||
try {
|
try {
|
||||||
IResource[] resource = ((IContainer)obj).members();
|
IResource[] resources = container.members();
|
||||||
for (int i = 0; i < resource.length; i++) {
|
for (IResource rc : resources) {
|
||||||
if (resource[i] instanceof IContainer) {
|
if (rc instanceof IContainer) {
|
||||||
children.add(resource[i]);
|
if (!(isAddingSourceRoots && isSourceEntry(rc))) {
|
||||||
|
children.add(rc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children.addAll(Arrays.asList(MakeCorePlugin.getDefault().getTargetManager().getTargets((IContainer)obj)));
|
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// ignore
|
MakeCorePlugin.log(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// finally add targets
|
||||||
|
try {
|
||||||
|
IMakeTarget[] targets = MakeCorePlugin.getDefault().getTargetManager().getTargets(container);
|
||||||
|
children.addAll(Arrays.asList(targets));
|
||||||
|
} catch (CoreException e) {
|
||||||
|
MakeCorePlugin.log(e);
|
||||||
|
}
|
||||||
|
return children.toArray();
|
||||||
|
|
||||||
|
} else if (obj instanceof TargetSourceContainer) {
|
||||||
|
ArrayList<Object> children = new ArrayList<Object>();
|
||||||
|
try {
|
||||||
|
IContainer container = ((TargetSourceContainer) obj).getContainer();
|
||||||
|
IResource[] resources = container.members();
|
||||||
|
for (IResource rc : resources) {
|
||||||
|
if (rc instanceof IContainer) {
|
||||||
|
children.add(rc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
children.addAll(Arrays.asList(MakeCorePlugin.getDefault().getTargetManager().getTargets(container)));
|
||||||
|
} catch (CoreException e) {
|
||||||
|
MakeCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
return children.toArray();
|
return children.toArray();
|
||||||
}
|
}
|
||||||
return new Object[0];
|
return new Object[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
|
||||||
|
*/
|
||||||
public Object getParent(Object obj) {
|
public Object getParent(Object obj) {
|
||||||
if (obj instanceof IMakeTarget) {
|
if (obj instanceof IMakeTarget) {
|
||||||
|
// this is ambiguous as make target can sit in 2 places, in its container
|
||||||
|
// or source folder represented by TargetSourceContainer
|
||||||
return ((IMakeTarget)obj).getContainer();
|
return ((IMakeTarget)obj).getContainer();
|
||||||
} else if (obj instanceof IContainer) {
|
} else if (obj instanceof IContainer) {
|
||||||
return ((IContainer)obj).getParent();
|
return ((IContainer)obj).getParent();
|
||||||
|
} else if (obj instanceof TargetSourceContainer) {
|
||||||
|
IContainer container = ((TargetSourceContainer)obj).getContainer();
|
||||||
|
// TargetSourceContainer sits at project root
|
||||||
|
return container.getProject();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
|
||||||
|
*/
|
||||||
public boolean hasChildren(Object obj) {
|
public boolean hasChildren(Object obj) {
|
||||||
return getChildren(obj).length > 0;
|
return getChildren(obj).length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
|
||||||
|
*/
|
||||||
public Object[] getElements(Object obj) {
|
public Object[] getElements(Object obj) {
|
||||||
if (bFlatten) {
|
if (bFlatten) {
|
||||||
List<Object> list = new ArrayList<Object>();
|
List<Object> list = new ArrayList<Object>();
|
||||||
|
@ -106,12 +188,18 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
|
||||||
return getChildren(obj);
|
return getChildren(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
|
||||||
|
*/
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
if (viewer != null) {
|
if (viewer != null) {
|
||||||
MakeCorePlugin.getDefault().getTargetManager().removeListener(this);
|
MakeCorePlugin.getDefault().getTargetManager().removeListener(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
||||||
|
*/
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||||
if (this.viewer == null) {
|
if (this.viewer == null) {
|
||||||
MakeCorePlugin.getDefault().getTargetManager().addListener(this);
|
MakeCorePlugin.getDefault().getTargetManager().addListener(this);
|
||||||
|
@ -123,22 +211,32 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
|
||||||
oldWorkspace = (IWorkspace) oldInput;
|
oldWorkspace = (IWorkspace) oldInput;
|
||||||
} else if (oldInput instanceof IContainer) {
|
} else if (oldInput instanceof IContainer) {
|
||||||
oldWorkspace = ((IContainer) oldInput).getWorkspace();
|
oldWorkspace = ((IContainer) oldInput).getWorkspace();
|
||||||
|
} else if (oldInput instanceof TargetSourceContainer) {
|
||||||
|
oldWorkspace = ((TargetSourceContainer) oldInput).getContainer().getWorkspace();
|
||||||
}
|
}
|
||||||
if (newInput instanceof IWorkspace) {
|
if (newInput instanceof IWorkspace) {
|
||||||
newWorkspace = (IWorkspace) newInput;
|
newWorkspace = (IWorkspace) newInput;
|
||||||
} else if (newInput instanceof IContainer) {
|
} else if (newInput instanceof IContainer) {
|
||||||
newWorkspace = ((IContainer) newInput).getWorkspace();
|
newWorkspace = ((IContainer) newInput).getWorkspace();
|
||||||
|
} else if (newInput instanceof TargetSourceContainer) {
|
||||||
|
newWorkspace = ((TargetSourceContainer) newInput).getContainer().getWorkspace();
|
||||||
}
|
}
|
||||||
if (oldWorkspace != newWorkspace) {
|
if (oldWorkspace != newWorkspace) {
|
||||||
|
ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager();
|
||||||
if (oldWorkspace != null) {
|
if (oldWorkspace != null) {
|
||||||
oldWorkspace.removeResourceChangeListener(this);
|
oldWorkspace.removeResourceChangeListener(this);
|
||||||
|
mngr.removeCProjectDescriptionListener(this);
|
||||||
}
|
}
|
||||||
if (newWorkspace != null) {
|
if (newWorkspace != null) {
|
||||||
newWorkspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
|
newWorkspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
|
||||||
|
mngr.addCProjectDescriptionListener(this, CProjectDescriptionEvent.APPLIED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.make.core.IMakeTargetListener#targetChanged(org.eclipse.cdt.make.core.MakeTargetEvent)
|
||||||
|
*/
|
||||||
public void targetChanged(final MakeTargetEvent event) {
|
public void targetChanged(final MakeTargetEvent event) {
|
||||||
final Control ctrl = viewer.getControl();
|
final Control ctrl = viewer.getControl();
|
||||||
if (ctrl != null && !ctrl.isDisposed()) {
|
if (ctrl != null && !ctrl.isDisposed()) {
|
||||||
|
@ -166,24 +264,31 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
|
||||||
} else {
|
} else {
|
||||||
//We can't just call refresh on the container target that
|
//We can't just call refresh on the container target that
|
||||||
//has been created since it may be that the container has
|
//has been created since it may be that the container has
|
||||||
//been filtered out and the fiters in the viewer don't know
|
//been filtered out and the filters in the viewer don't know
|
||||||
//any better how to call out to the filter selection again.
|
//any better how to call out to the filter selection again.
|
||||||
//Instead we walk to the root container and refresh it.
|
//Instead we walk to the root project container and refresh it.
|
||||||
IContainer container = event.getTarget().getContainer();
|
Set<IContainer> containers = new HashSet<IContainer>();
|
||||||
while(container.getParent() != null) {
|
IMakeTarget[] targets = event.getTargets();
|
||||||
|
for (IMakeTarget target : targets) {
|
||||||
|
IContainer container = target.getContainer();
|
||||||
|
while(!(container instanceof IProject) && container.getParent()!=null) {
|
||||||
container = container.getParent();
|
container = container.getParent();
|
||||||
}
|
}
|
||||||
|
containers.add(container);
|
||||||
|
}
|
||||||
|
for (IContainer container : containers) {
|
||||||
viewer.refresh(container);
|
viewer.refresh(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void processDelta(IResourceDelta delta) {
|
private void processDelta(IResourceDelta delta) {
|
||||||
// Bail out if the widget was disposed.
|
// Bail out if the widget was disposed.
|
||||||
Control ctrl = viewer.getControl();
|
Control ctrl = viewer.getControl();
|
||||||
if (ctrl == null || ctrl.isDisposed() || delta == null) {
|
if (ctrl == null || ctrl.isDisposed() || delta == null) {
|
||||||
|
@ -256,10 +361,83 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
|
||||||
|
*/
|
||||||
public void resourceChanged(IResourceChangeEvent event) {
|
public void resourceChanged(IResourceChangeEvent event) {
|
||||||
final IResourceDelta delta = event.getDelta();
|
final IResourceDelta delta = event.getDelta();
|
||||||
Control ctrl = viewer.getControl();
|
Control ctrl = viewer.getControl();
|
||||||
if (ctrl != null && !ctrl.isDisposed())
|
if (ctrl != null && !ctrl.isDisposed())
|
||||||
processDelta(delta);
|
processDelta(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*
|
||||||
|
* @since 7.1
|
||||||
|
*/
|
||||||
|
public void handleEvent(final CProjectDescriptionEvent event) {
|
||||||
|
Display display = Display.getDefault();
|
||||||
|
display.asyncExec(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
ICDescriptionDelta delta = event.getDefaultSettingCfgDelta();
|
||||||
|
if (delta==null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int flags = delta.getChangeFlags();
|
||||||
|
if ( ((flags & ICDescriptionDelta.SOURCE_ADDED) != 0) ||
|
||||||
|
((flags & ICDescriptionDelta.SOURCE_REMOVED) != 0) ) {
|
||||||
|
|
||||||
|
IProject project = null;
|
||||||
|
ICSettingObject setting = delta.getOldSetting();
|
||||||
|
if (setting==null)
|
||||||
|
setting = delta.getNewSetting();
|
||||||
|
|
||||||
|
if (setting instanceof ICConfigurationDescription)
|
||||||
|
project = ((ICConfigurationDescription) setting).getProjectDescription().getProject();
|
||||||
|
|
||||||
|
if (project!=null)
|
||||||
|
viewer.refresh(project);
|
||||||
|
else
|
||||||
|
viewer.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get source entries for default setting configuration (i.e. configuration shown in UI).
|
||||||
|
*/
|
||||||
|
private static ICSourceEntry[] getSourceEntries(IProject project) {
|
||||||
|
ICProjectDescriptionManager mgr = CCorePlugin.getDefault().getProjectDescriptionManager();
|
||||||
|
ICProjectDescription prjDescription = mgr.getProjectDescription(project, false);
|
||||||
|
if (prjDescription!=null) {
|
||||||
|
ICConfigurationDescription cfgDescription = prjDescription.getDefaultSettingConfiguration();
|
||||||
|
if (cfgDescription!=null) {
|
||||||
|
ICSourceEntry[] srcEntries = cfgDescription.getResolvedSourceEntries();
|
||||||
|
return srcEntries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ICSourceEntry[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the resource is in the list of source entries.
|
||||||
|
|
||||||
|
* @param rc - resource to check.
|
||||||
|
* @return {@code true} if the resource is a source folder, {@code false} otherwise.
|
||||||
|
*
|
||||||
|
* @since 7.1
|
||||||
|
*/
|
||||||
|
public static boolean isSourceEntry(IResource rc) {
|
||||||
|
IProject project = rc.getProject();
|
||||||
|
ICSourceEntry[] srcEntries = getSourceEntries(project);
|
||||||
|
for (ICSourceEntry srcEntry : srcEntries) {
|
||||||
|
if (srcEntry.getFullPath().equals(rc.getFullPath()))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,16 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
* Andrew Gvozdev - some improvements such as adding source folders bug 339015
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.make.ui;
|
package org.eclipse.cdt.make.ui;
|
||||||
|
|
||||||
|
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
|
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
|
||||||
|
import org.eclipse.cdt.ui.CDTSharedImages;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.jface.viewers.ILabelProvider;
|
import org.eclipse.jface.viewers.ILabelProvider;
|
||||||
import org.eclipse.jface.viewers.ITableLabelProvider;
|
import org.eclipse.jface.viewers.ITableLabelProvider;
|
||||||
|
@ -22,13 +25,15 @@ import org.eclipse.swt.graphics.Image;
|
||||||
import org.eclipse.ui.model.WorkbenchLabelProvider;
|
import org.eclipse.ui.model.WorkbenchLabelProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Label provider for Make Targets view and for Make Targets dialog from
|
||||||
|
* "Make Targets"->"Build..." in project context menu.
|
||||||
|
*
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class MakeLabelProvider extends LabelProvider implements ITableLabelProvider {
|
public class MakeLabelProvider extends LabelProvider implements ITableLabelProvider {
|
||||||
private IPath pathPrefix;
|
private IPath pathPrefix;
|
||||||
|
private WorkbenchLabelProvider fLableProvider = new WorkbenchLabelProvider();
|
||||||
WorkbenchLabelProvider fLableProvider = new WorkbenchLabelProvider();
|
|
||||||
|
|
||||||
public MakeLabelProvider() {
|
public MakeLabelProvider() {
|
||||||
this(null);
|
this(null);
|
||||||
|
@ -43,10 +48,14 @@ public class MakeLabelProvider extends LabelProvider implements ITableLabelProvi
|
||||||
@Override
|
@Override
|
||||||
public Image getImage(Object obj) {
|
public Image getImage(Object obj) {
|
||||||
Image image = null;
|
Image image = null;
|
||||||
if (obj instanceof IMakeTarget) {
|
if (obj instanceof TargetSourceContainer) {
|
||||||
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_BUILD_TARGET);
|
return CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_SOURCE_ROOT);
|
||||||
} else if (obj instanceof IContainer) {
|
} else if (obj instanceof IContainer) {
|
||||||
|
if (!(obj instanceof IProject) && MakeContentProvider.isSourceEntry((IContainer) obj))
|
||||||
|
return CDTSharedImages.getImage(CDTSharedImages.IMG_OBJS_SOURCE_ROOT);
|
||||||
return fLableProvider.getImage(obj);
|
return fLableProvider.getImage(obj);
|
||||||
|
} else if (obj instanceof IMakeTarget) {
|
||||||
|
return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_BUILD_TARGET);
|
||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
@ -56,10 +65,16 @@ public class MakeLabelProvider extends LabelProvider implements ITableLabelProvi
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getText(Object obj) {
|
public String getText(Object obj) {
|
||||||
if (obj instanceof IMakeTarget) {
|
if (obj instanceof TargetSourceContainer) {
|
||||||
return ((IMakeTarget) obj).getName();
|
IContainer container = ((TargetSourceContainer) obj).getContainer();
|
||||||
|
IPath path = container.getFullPath();
|
||||||
|
// remove leading project name
|
||||||
|
path = path.removeFirstSegments(1);
|
||||||
|
return path.toString();
|
||||||
} else if (obj instanceof IContainer) {
|
} else if (obj instanceof IContainer) {
|
||||||
return fLableProvider.getText(obj);
|
return fLableProvider.getText(obj);
|
||||||
|
} else if (obj instanceof IMakeTarget) {
|
||||||
|
return ((IMakeTarget) obj).getName();
|
||||||
}
|
}
|
||||||
return ""; //$NON-NLS-1$
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2011, 2011 Andrew Gvozdev.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Andrew Gvozdev - Initial implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.cdt.make.ui;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
|
||||||
|
import org.eclipse.core.resources.IContainer;
|
||||||
|
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A class to represent source folders added to Make Targets View on top.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
|
*
|
||||||
|
* @since 7.1
|
||||||
|
*/
|
||||||
|
public class TargetSourceContainer {
|
||||||
|
private IContainer container;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param srcEntry - source entry backing the container.
|
||||||
|
*/
|
||||||
|
public TargetSourceContainer(ICSourceEntry srcEntry) {
|
||||||
|
IWorkspaceRoot wspRoot = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
|
container = wspRoot.getFolder(srcEntry.getFullPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns resource container associated with the source entry.
|
||||||
|
*
|
||||||
|
* @return resource container.
|
||||||
|
*/
|
||||||
|
public IContainer getContainer() {
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return container.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj instanceof TargetSourceContainer)
|
||||||
|
return container.equals(((TargetSourceContainer) obj).container);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
||||||
|
import org.eclipse.cdt.make.ui.TargetSourceContainer;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -84,6 +85,8 @@ public abstract class AbstractTargetAction
|
||||||
} else {
|
} else {
|
||||||
fContainer = ((IResource)obj).getParent();
|
fContainer = ((IResource)obj).getParent();
|
||||||
}
|
}
|
||||||
|
} else if (obj instanceof TargetSourceContainer) {
|
||||||
|
fContainer = ((TargetSourceContainer)obj).getContainer();
|
||||||
} else if (obj instanceof IMakeTarget) {
|
} else if (obj instanceof IMakeTarget) {
|
||||||
fContainer = ((IMakeTarget)obj).getContainer();
|
fContainer = ((IMakeTarget)obj).getContainer();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
|
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
||||||
import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetDndUtil;
|
import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetDndUtil;
|
||||||
|
import org.eclipse.cdt.make.ui.TargetSourceContainer;
|
||||||
import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog;
|
import org.eclipse.cdt.make.ui.dialogs.MakeTargetDialog;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -43,12 +44,20 @@ public class AddTargetAction extends SelectionListenerAction {
|
||||||
public void run() {
|
public void run() {
|
||||||
Object selection = getSelectedElement();
|
Object selection = getSelectedElement();
|
||||||
try {
|
try {
|
||||||
if (selection instanceof IContainer) {
|
if (selection instanceof IMakeTarget) {
|
||||||
MakeTargetDialog dialog = new MakeTargetDialog(shell, (IContainer) selection);
|
|
||||||
dialog.open();
|
|
||||||
} else if (selection instanceof IMakeTarget) {
|
|
||||||
IMakeTarget makeTarget = (IMakeTarget)selection;
|
IMakeTarget makeTarget = (IMakeTarget)selection;
|
||||||
MakeTargetDndUtil.copyOneTarget(makeTarget, makeTarget.getContainer(), DND.DROP_COPY, shell, false);
|
MakeTargetDndUtil.copyOneTarget(makeTarget, makeTarget.getContainer(), DND.DROP_COPY, shell, false);
|
||||||
|
} else {
|
||||||
|
IContainer container = null;
|
||||||
|
if (selection instanceof TargetSourceContainer) {
|
||||||
|
container = ((TargetSourceContainer) selection).getContainer();
|
||||||
|
} else if (selection instanceof IContainer) {
|
||||||
|
container = (IContainer) selection;
|
||||||
|
}
|
||||||
|
if (container!=null) {
|
||||||
|
MakeTargetDialog dialog = new MakeTargetDialog(shell, container);
|
||||||
|
dialog.open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
MakeUIPlugin.errorDialog(shell, MakeUIPlugin.getResourceString("AddTargetAction.exception.title"), //$NON-NLS-1$
|
MakeUIPlugin.errorDialog(shell, MakeUIPlugin.getResourceString("AddTargetAction.exception.title"), //$NON-NLS-1$
|
||||||
|
@ -65,7 +74,7 @@ public class AddTargetAction extends SelectionListenerAction {
|
||||||
private Object getSelectedElement() {
|
private Object getSelectedElement() {
|
||||||
if (getStructuredSelection().size()==1) {
|
if (getStructuredSelection().size()==1) {
|
||||||
Object element = getStructuredSelection().getFirstElement();
|
Object element = getStructuredSelection().getFirstElement();
|
||||||
if (element instanceof IContainer || element instanceof IMakeTarget) {
|
if (element instanceof IContainer || element instanceof TargetSourceContainer || element instanceof IMakeTarget) {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,15 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.make.ui.views;
|
package org.eclipse.cdt.make.ui.views;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
|
import org.eclipse.cdt.make.internal.ui.MakeUIImages;
|
||||||
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
|
||||||
import org.eclipse.core.resources.IFolder;
|
import org.eclipse.cdt.make.ui.MakeContentProvider;
|
||||||
|
import org.eclipse.cdt.make.ui.TargetSourceContainer;
|
||||||
|
import org.eclipse.core.resources.IContainer;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceProxy;
|
import org.eclipse.core.resources.IResourceProxy;
|
||||||
import org.eclipse.core.resources.IResourceProxyVisitor;
|
import org.eclipse.core.resources.IResourceProxyVisitor;
|
||||||
|
@ -57,7 +61,7 @@ public class FilterEmtpyFoldersAction extends Action {
|
||||||
//Check the make targets of the specified container, and if they don't exist, run
|
//Check the make targets of the specified container, and if they don't exist, run
|
||||||
//through the children looking for the first match that we can find that contains
|
//through the children looking for the first match that we can find that contains
|
||||||
//a make target.
|
//a make target.
|
||||||
private boolean hasMakeTargets(IFolder container) throws CoreException {
|
private boolean hasMakeTargets(IContainer container) throws CoreException {
|
||||||
IMakeTarget [] targets = MakeCorePlugin.getDefault().getTargetManager().getTargets(container);
|
IMakeTarget [] targets = MakeCorePlugin.getDefault().getTargetManager().getTargets(container);
|
||||||
if(targets != null && targets.length > 0) {
|
if(targets != null && targets.length > 0) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -74,7 +78,14 @@ public class FilterEmtpyFoldersAction extends Action {
|
||||||
if(proxy.getType() != IResource.FOLDER) {
|
if(proxy.getType() != IResource.FOLDER) {
|
||||||
return true; //We only look at folders for content
|
return true; //We only look at folders for content
|
||||||
}
|
}
|
||||||
IFolder folder = (IFolder) proxy.requestResource();
|
IContainer folder = (IContainer) proxy.requestResource();
|
||||||
|
if (CCorePlugin.showSourceRootsAtTopOfProject() && !(folder instanceof IProject)) {
|
||||||
|
boolean isSourceEntry = MakeContentProvider.isSourceEntry(folder);
|
||||||
|
if (isSourceEntry)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
IMakeTarget [] targets = MakeCorePlugin.getDefault().getTargetManager().getTargets(folder);
|
IMakeTarget [] targets = MakeCorePlugin.getDefault().getTargetManager().getTargets(folder);
|
||||||
if(targets != null && targets.length > 0) {
|
if(targets != null && targets.length > 0) {
|
||||||
haveTargets[0] = true;
|
haveTargets[0] = true;
|
||||||
|
@ -88,20 +99,40 @@ public class FilterEmtpyFoldersAction extends Action {
|
||||||
return haveTargets[0];
|
return haveTargets[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean select(Viewer viewer, Object parentElement, Object element) {
|
public boolean select(Viewer viewer, Object parentElement, Object element) {
|
||||||
if (isChecked() && element instanceof IFolder) {
|
if (isChecked()) {
|
||||||
|
IContainer container = null;
|
||||||
|
if (element instanceof IContainer) {
|
||||||
|
container = (IContainer)element;
|
||||||
|
if (!(container instanceof IProject)) {
|
||||||
|
// under subfolders do not show source roots second time (when filtered)
|
||||||
|
if (CCorePlugin.showSourceRootsAtTopOfProject() && MakeContentProvider.isSourceEntry(container))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (element instanceof TargetSourceContainer) {
|
||||||
|
container = ((TargetSourceContainer) element).getContainer();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (container!=null) {
|
||||||
try {
|
try {
|
||||||
return hasMakeTargets((IFolder)element);
|
return hasMakeTargets(container);
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.action.Action#run()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fViewer.refresh();
|
fViewer.refresh();
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.cdt.make.internal.ui.dnd.TextTransferDropTargetListener;
|
||||||
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
|
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
|
||||||
import org.eclipse.cdt.make.ui.MakeContentProvider;
|
import org.eclipse.cdt.make.ui.MakeContentProvider;
|
||||||
import org.eclipse.cdt.make.ui.MakeLabelProvider;
|
import org.eclipse.cdt.make.ui.MakeLabelProvider;
|
||||||
|
import org.eclipse.cdt.make.ui.TargetSourceContainer;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.jface.action.IMenuListener;
|
import org.eclipse.jface.action.IMenuListener;
|
||||||
|
@ -64,11 +65,12 @@ import org.eclipse.ui.part.DrillDownAdapter;
|
||||||
import org.eclipse.ui.part.ViewPart;
|
import org.eclipse.ui.part.ViewPart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Implementation of Make Target View.
|
||||||
|
*
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class MakeView extends ViewPart {
|
public class MakeView extends ViewPart {
|
||||||
|
|
||||||
private static final String TARGET_BUILD_LAST_COMMAND = "org.eclipse.cdt.make.ui.targetBuildLastCommand"; //$NON-NLS-1$
|
private static final String TARGET_BUILD_LAST_COMMAND = "org.eclipse.cdt.make.ui.targetBuildLastCommand"; //$NON-NLS-1$
|
||||||
|
|
||||||
private Clipboard clipboard;
|
private Clipboard clipboard;
|
||||||
|
@ -129,13 +131,14 @@ public class MakeView extends ViewPart {
|
||||||
});
|
});
|
||||||
|
|
||||||
fViewer.setSorter(new ViewerSorter() {
|
fViewer.setSorter(new ViewerSorter() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int category(Object element) {
|
public int category(Object element) {
|
||||||
if (element instanceof IResource) {
|
if (element instanceof TargetSourceContainer) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (element instanceof IResource) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
return 3;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
|
fViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetTransfer;
|
||||||
import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetTransferData;
|
import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetTransferData;
|
||||||
import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetTransferDropTargetListener;
|
import org.eclipse.cdt.make.internal.ui.dnd.MakeTargetTransferDropTargetListener;
|
||||||
import org.eclipse.cdt.make.internal.ui.dnd.TextTransferDropTargetListener;
|
import org.eclipse.cdt.make.internal.ui.dnd.TextTransferDropTargetListener;
|
||||||
|
import org.eclipse.cdt.make.ui.TargetSourceContainer;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
import org.eclipse.swt.dnd.Clipboard;
|
import org.eclipse.swt.dnd.Clipboard;
|
||||||
|
@ -146,6 +147,10 @@ public class PasteTargetAction extends SelectionListenerAction {
|
||||||
return dropContainer;
|
return dropContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (first instanceof TargetSourceContainer) {
|
||||||
|
return ((TargetSourceContainer) first).getContainer();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue