mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
External system: onSuccessImport method extended to have ability to operate on imported data
This commit is contained in:
+10
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
@@ -70,6 +71,15 @@ public abstract class AbstractProjectDataService<E, I> implements ProjectDataSer
|
||||
@NotNull IdeModifiableModelsProvider modelsProvider) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #onSuccessImport(Collection, ProjectData, Project)}
|
||||
*/
|
||||
public void onSuccessImport(@NotNull Project project) {
|
||||
}
|
||||
|
||||
public void onSuccessImport(@NotNull Collection<DataNode<E>> imported,
|
||||
@Nullable ProjectData projectData,
|
||||
@NotNull Project project) {
|
||||
onSuccessImport(project);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -331,7 +331,9 @@ public abstract class AbstractModuleDataService<E extends ModuleData> extends Ab
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccessImport(@NotNull Project project) {
|
||||
public void onSuccessImport(@NotNull Collection<DataNode<E>> imported,
|
||||
@Nullable ProjectData projectData,
|
||||
@NotNull Project project) {
|
||||
final Set<String> orphanFiles = project.getUserData(ORPHAN_MODULE_FILES);
|
||||
if (orphanFiles != null && !orphanFiles.isEmpty()) {
|
||||
ExternalSystemApiUtil.executeOnEdt(false, () -> {
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ public class ProjectDataManagerImpl implements ProjectDataManager {
|
||||
for (ProjectDataService<?, ?> service : services) {
|
||||
if (service instanceof AbstractProjectDataService) {
|
||||
final long taskStartTime = System.currentTimeMillis();
|
||||
((AbstractProjectDataService)service).onSuccessImport(project);
|
||||
((AbstractProjectDataService)service).onSuccessImport(toImport, projectData, project);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
final long taskTimeInMs = (System.currentTimeMillis() - taskStartTime);
|
||||
LOG.debug(String.format("Service %s run post import task in %d ms", service.getClass().getSimpleName(), taskTimeInMs));
|
||||
|
||||
Reference in New Issue
Block a user