mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[ES] import spec builder API cleanup
GitOrigin-RevId: 506c484a8c739b0e6b400a46e90c53abe19470a2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
69c67340be
commit
a344f48996
+9
-5
@@ -106,11 +106,11 @@ public class ImportSpecBuilder {
|
||||
mySpec.setProgressExecutionMode(myProgressExecutionMode);
|
||||
mySpec.setForceWhenUptodate(myForceWhenUptodate);
|
||||
mySpec.setCreateDirectoriesForEmptyContentRoots(myCreateDirectoriesForEmptyContentRoots);
|
||||
mySpec.setCallback(myCallback == null ? new DefaultProjectRefreshCallback(mySpec) : myCallback);
|
||||
mySpec.setPreviewMode(isPreviewMode);
|
||||
mySpec.setReportRefreshError(isReportRefreshError);
|
||||
mySpec.setArguments(myArguments);
|
||||
mySpec.setVmOptions(myVmOptions);
|
||||
mySpec.setCallback(myCallback == null ? new DefaultProjectRefreshCallback(mySpec) : myCallback);
|
||||
return mySpec;
|
||||
}
|
||||
|
||||
@@ -128,17 +128,21 @@ public class ImportSpecBuilder {
|
||||
|
||||
@ApiStatus.Internal
|
||||
public final static class DefaultProjectRefreshCallback implements ExternalProjectRefreshCallback {
|
||||
private final ImportSpecImpl myMySpec;
|
||||
private final Project myProject;
|
||||
private final ProgressExecutionMode myExecutionMode;
|
||||
|
||||
public DefaultProjectRefreshCallback(ImportSpecImpl mySpec) {myMySpec = mySpec;}
|
||||
public DefaultProjectRefreshCallback(ImportSpec spec) {
|
||||
myProject = spec.getProject();
|
||||
myExecutionMode = spec.getProgressExecutionMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(@Nullable final DataNode<ProjectData> externalProject) {
|
||||
if (externalProject == null) {
|
||||
return;
|
||||
}
|
||||
final boolean synchronous = myMySpec.getProgressExecutionMode() == ProgressExecutionMode.MODAL_SYNC;
|
||||
ServiceManager.getService(ProjectDataManager.class).importData(externalProject, myMySpec.getProject(), synchronous);
|
||||
final boolean synchronous = myExecutionMode == ProgressExecutionMode.MODAL_SYNC;
|
||||
ServiceManager.getService(ProjectDataManager.class).importData(externalProject, myProject, synchronous);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user