Search in sources :

Example 1 with IWorkspaceProject

use of com.liferay.ide.core.IWorkspaceProject in project liferay-ide by liferay.

the class PortalSourcePathComputerDelegate method computeSourceContainers.

@Override
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
    final List<ISourceContainer> sourceContainers = new ArrayList<ISourceContainer>();
    final IServer server = ServerUtil.getServer(configuration);
    IWorkspaceProject workspaceProject = LiferayCore.create(IWorkspaceProject.class, server);
    if (workspaceProject != null) {
        addSourceContainers(configuration, monitor, sourceContainers, workspaceProject.getProject());
    }
    Stream.of(server.getModules()).map(module -> LiferayCore.create(module.getProject())).filter(liferayProject -> liferayProject != null).forEach(liferayProject -> addSourceContainers(configuration, monitor, sourceContainers, liferayProject.getProject()));
    return sourceContainers.toArray(new ISourceContainer[0]);
}
Also used : JavaSourcePathComputer(org.eclipse.jdt.launching.sourcelookup.containers.JavaSourcePathComputer) DebugPlugin(org.eclipse.debug.core.DebugPlugin) IServer(org.eclipse.wst.server.core.IServer) LiferayServerCore(com.liferay.ide.server.core.LiferayServerCore) CoreException(org.eclipse.core.runtime.CoreException) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) ILaunchConfigurationType(org.eclipse.debug.core.ILaunchConfigurationType) ILaunchManager(org.eclipse.debug.core.ILaunchManager) ArrayList(java.util.ArrayList) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) LiferayCore(com.liferay.ide.core.LiferayCore) ServerUtil(org.eclipse.wst.server.core.ServerUtil) List(java.util.List) Stream(java.util.stream.Stream) IProject(org.eclipse.core.resources.IProject) ISourceContainer(org.eclipse.debug.core.sourcelookup.ISourceContainer) IWorkspaceProject(com.liferay.ide.core.IWorkspaceProject) IJavaLaunchConfigurationConstants(org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants) IServer(org.eclipse.wst.server.core.IServer) ArrayList(java.util.ArrayList) ISourceContainer(org.eclipse.debug.core.sourcelookup.ISourceContainer) IWorkspaceProject(com.liferay.ide.core.IWorkspaceProject)

Aggregations

IWorkspaceProject (com.liferay.ide.core.IWorkspaceProject)1 LiferayCore (com.liferay.ide.core.LiferayCore)1 LiferayServerCore (com.liferay.ide.server.core.LiferayServerCore)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Stream (java.util.stream.Stream)1 IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 DebugPlugin (org.eclipse.debug.core.DebugPlugin)1 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)1 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)1 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1 ILaunchManager (org.eclipse.debug.core.ILaunchManager)1 ISourceContainer (org.eclipse.debug.core.sourcelookup.ISourceContainer)1 IJavaLaunchConfigurationConstants (org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants)1 JavaSourcePathComputer (org.eclipse.jdt.launching.sourcelookup.containers.JavaSourcePathComputer)1 IServer (org.eclipse.wst.server.core.IServer)1 ServerUtil (org.eclipse.wst.server.core.ServerUtil)1