mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -79,7 +79,7 @@ public class AddModuleWizard extends AbstractWizard<ModuleWizardStep> {
|
||||
initModuleWizard(project, null);
|
||||
}
|
||||
|
||||
private void initModuleWizard(final Project project, @Nullable final String defaultPath) {
|
||||
private void initModuleWizard(@Nullable final Project project, @Nullable final String defaultPath) {
|
||||
myWizardContext = new WizardContext(project);
|
||||
if (defaultPath != null) {
|
||||
myWizardContext.setProjectFileDirectory(defaultPath);
|
||||
|
||||
+7
-6
@@ -68,18 +68,19 @@ public class CreateFromScratchMode extends WizardMode {
|
||||
StepSequence sequence, List<ModuleBuilder> builders) {
|
||||
sequence.addCommonStep(new ProjectNameWithTypeStep(context, sequence, mode));
|
||||
for (ModuleBuilder builder : builders) {
|
||||
addModuleBuilder(builder, context, modulesProvider, sequence);
|
||||
context.setTemplateMode(mode instanceof CreateFromTemplateMode);
|
||||
addStepsForBuilder(builder, context, modulesProvider, sequence);
|
||||
}
|
||||
return sequence;
|
||||
}
|
||||
|
||||
private static void addModuleBuilder(ModuleBuilder builder,
|
||||
WizardContext context,
|
||||
ModulesProvider modulesProvider,
|
||||
StepSequence myStepSequence) {
|
||||
private static void addStepsForBuilder(ModuleBuilder builder,
|
||||
WizardContext context,
|
||||
ModulesProvider modulesProvider,
|
||||
StepSequence sequence) {
|
||||
final String id = builder.getBuilderId();
|
||||
for (ModuleWizardStep step : builder.createWizardSteps(context, modulesProvider)) {
|
||||
myStepSequence.addSpecificStep(id, step);
|
||||
sequence.addSpecificStep(id, step);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ public class BuildRootIndexImpl implements BuildRootIndex {
|
||||
for (ModuleBuildTarget target : targets) {
|
||||
final File annotationOut = paths.getAnnotationProcessorGeneratedSourcesOutputDir(target.getModule(), target.isTests(), profile);
|
||||
if (annotationOut != null) {
|
||||
if (findJavaRootDescriptor(null, annotationOut) == null) {
|
||||
// register only if the root is not under already existing roots
|
||||
if (findJavaRootDescriptor(null, annotationOut) == null && !FileUtil.filesEqual(annotationOut, target.getOutputDir())) {
|
||||
// register only if the root is not under already existing roots and not is the same as target's output root
|
||||
final ResourcesOnlyRootDescriptor descriptor = new ResourcesOnlyRootDescriptor(annotationOut, target, true, false, "");
|
||||
registerDescriptor(descriptor);
|
||||
//noinspection unchecked
|
||||
|
||||
@@ -59,7 +59,7 @@ public class WizardContext {
|
||||
void nextStepRequested();
|
||||
}
|
||||
|
||||
public WizardContext(Project project) {
|
||||
public WizardContext(@Nullable Project project) {
|
||||
myProject = project;
|
||||
if (myProject != null){
|
||||
myProjectJdk = ProjectRootManager.getInstance(myProject).getProjectSdk();
|
||||
@@ -172,4 +172,16 @@ public class WizardContext {
|
||||
public StorageScheme getProjectStorageFormat() {
|
||||
return myProjectStorageFormat;
|
||||
}
|
||||
|
||||
private boolean myTemplateMode;
|
||||
|
||||
/** This will be removed shortly */
|
||||
@Deprecated
|
||||
public boolean isTemplateMode() {
|
||||
return myTemplateMode;
|
||||
}
|
||||
|
||||
public void setTemplateMode(boolean templateMode) {
|
||||
myTemplateMode = templateMode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ public class WebModuleType extends WebModuleTypeBase<ModuleBuilder> {
|
||||
|
||||
@Override
|
||||
public ModuleWizardStep[] createWizardSteps(WizardContext wizardContext, ModuleBuilder moduleBuilder, ModulesProvider modulesProvider) {
|
||||
if (wizardContext.isTemplateMode()) return ModuleWizardStep.EMPTY_ARRAY;
|
||||
WebModuleGenerationStep generationStep = new WebModuleGenerationStep(
|
||||
moduleBuilder,
|
||||
wizardContext.getStepIcon(),
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
initWizard(title);
|
||||
}
|
||||
|
||||
public AbstractWizard(final String title, final Project project) {
|
||||
public AbstractWizard(final String title, @Nullable final Project project) {
|
||||
super(project, true);
|
||||
mySteps = new ArrayList<T>();
|
||||
initWizard(title);
|
||||
|
||||
@@ -44,6 +44,7 @@ import com.intellij.util.ThrowableRunnable;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import com.intellij.util.ui.VcsSynchronousProgressWrapper;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -559,6 +560,10 @@ public abstract class AbstractVcs<ComList extends CommittedChangeList> extends S
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean allowsRemoteCalls(@NotNull final VirtualFile file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setCheckinEnvironment(CheckinEnvironment checkinEnvironment) {
|
||||
if (myCheckinEnvironment != null) throw new IllegalStateException("Attempt to redefine checkin environment");
|
||||
myCheckinEnvironment = checkinEnvironment;
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public class BrowseChangesAction extends AnAction implements DumbAware {
|
||||
VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
|
||||
if (vFile == null) return false;
|
||||
AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(vFile);
|
||||
if (vcs == null || vcs.getCommittedChangesProvider() == null) {
|
||||
if (vcs == null || vcs.getCommittedChangesProvider() == null || !vcs.allowsRemoteCalls(vFile)) {
|
||||
return false;
|
||||
}
|
||||
FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(vFile);
|
||||
|
||||
Reference in New Issue
Block a user