mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
platform: add some docs, disable "web" for the new UI IDEA-270273
GitOrigin-RevId: a2f987489767467d4eef38f26b397c85acbac84b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
62e05653e7
commit
41cbc844b0
+9
-5
@@ -50,8 +50,12 @@ import java.util.List;
|
||||
|
||||
import static com.intellij.platform.ProjectTemplatesFactory.CUSTOM_GROUP;
|
||||
|
||||
/**
|
||||
* Defines the new project wizard, which is used in small IDEs where we don't need to work with modules directly
|
||||
*/
|
||||
public abstract class AbstractNewProjectStep<T> extends DefaultActionGroup implements DumbAware, ActionsWithPanelProvider {
|
||||
static final ExtensionPointName<DirectoryProjectGenerator<?>> EP_NAME = new ExtensionPointName<>("com.intellij.directoryProjectGenerator");
|
||||
static final ExtensionPointName<DirectoryProjectGenerator<?>> EP_NAME =
|
||||
new ExtensionPointName<>("com.intellij.directoryProjectGenerator");
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(AbstractNewProjectStep.class);
|
||||
private static final Key<Boolean> CREATED_KEY = new Key<>("abstract.new.project.step.created");
|
||||
@@ -145,11 +149,10 @@ public abstract class AbstractNewProjectStep<T> extends DefaultActionGroup imple
|
||||
|
||||
ProjectSettingsStepBase<T> step;
|
||||
if (generator instanceof CustomStepProjectGenerator) {
|
||||
//noinspection unchecked,CastConflictsWithInstanceof
|
||||
//noinspection unchecked
|
||||
step = (ProjectSettingsStepBase<T>)((CustomStepProjectGenerator<T>)generator).createStep(generator, callback);
|
||||
}
|
||||
else {
|
||||
//noinspection unchecked
|
||||
step = createProjectSpecificSettingsStep(generator, callback);
|
||||
}
|
||||
|
||||
@@ -178,7 +181,7 @@ public abstract class AbstractNewProjectStep<T> extends DefaultActionGroup imple
|
||||
Project projectToClose = frame != null ? frame.getProject() : null;
|
||||
DirectoryProjectGenerator<T> generator = settings.getProjectGenerator();
|
||||
T actualSettings = projectGeneratorPeer.getSettings();
|
||||
Project project = doGenerateProject(projectToClose, settings.getProjectLocation(), generator, actualSettings);
|
||||
doGenerateProject(projectToClose, settings.getProjectLocation(), generator, actualSettings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +200,8 @@ public abstract class AbstractNewProjectStep<T> extends DefaultActionGroup imple
|
||||
return null;
|
||||
}
|
||||
|
||||
VirtualFile baseDir = WriteAction.compute(() -> LocalFileSystem.getInstance().refreshAndFindFileByPath(FileUtil.toSystemIndependentName(location.toString())));
|
||||
VirtualFile baseDir = WriteAction.compute(
|
||||
() -> LocalFileSystem.getInstance().refreshAndFindFileByPath(FileUtil.toSystemIndependentName(location.toString())));
|
||||
if (baseDir == null) {
|
||||
LOG.error("Couldn't find '" + location + "' in VFS");
|
||||
return null;
|
||||
|
||||
+7
-3
@@ -44,7 +44,9 @@ import java.util.List;
|
||||
|
||||
import static com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame.BOTTOM_PANEL;
|
||||
|
||||
@SuppressWarnings("ComponentNotRegistered")
|
||||
/**
|
||||
* {@link AbstractNewProjectStep}
|
||||
*/
|
||||
public class ProjectSettingsStepBase<T> extends AbstractActionWithPanel implements DumbAware, Disposable {
|
||||
protected DirectoryProjectGenerator<T> myProjectGenerator;
|
||||
protected AbstractNewProjectStep.AbstractCallback<T> myCallback;
|
||||
@@ -318,7 +320,9 @@ public class ProjectSettingsStepBase<T> extends AbstractActionWithPanel implemen
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
myLocationField.addBrowseFolderListener(IdeBundle.message("directory.project.location.title"),
|
||||
IdeBundle.message("directory.project.location.description"), null, descriptor);
|
||||
return LabeledComponent.create(myLocationField, BundleBase.replaceMnemonicAmpersand(IdeBundle.message("directory.project.location.label")), BorderLayout.WEST);
|
||||
return LabeledComponent.create(myLocationField,
|
||||
BundleBase.replaceMnemonicAmpersand(IdeBundle.message("directory.project.location.label")),
|
||||
BorderLayout.WEST);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -327,5 +331,5 @@ public class ProjectSettingsStepBase<T> extends AbstractActionWithPanel implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {}
|
||||
public void dispose() { }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
package com.intellij.openapi.module;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.NewProjectWizardLegacy;
|
||||
import com.intellij.ide.util.projectWizard.ModuleBuilder;
|
||||
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
|
||||
import com.intellij.ide.util.projectWizard.SettingsStep;
|
||||
@@ -28,7 +29,7 @@ public class WebModuleBuilder<T> extends ModuleBuilder {
|
||||
public static final String GROUP_NAME = "JavaScript";
|
||||
public static final Icon ICON = AllIcons.Nodes.PpWeb;
|
||||
|
||||
private final WebProjectTemplate<T> myTemplate;
|
||||
protected final WebProjectTemplate<T> myTemplate;
|
||||
protected final NotNullLazyValue<ProjectGeneratorPeer<T>> myGeneratorPeerLazyValue;
|
||||
|
||||
public WebModuleBuilder(@NotNull WebProjectTemplate<T> template) {
|
||||
@@ -61,6 +62,11 @@ public class WebModuleBuilder<T> extends ModuleBuilder {
|
||||
return GROUP_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return NewProjectWizardLegacy.isAvailable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getNodeIcon() {
|
||||
return myTemplate != null ? myTemplate.getIcon() : ICON;
|
||||
|
||||
@@ -14,7 +14,14 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
|
||||
/**
|
||||
* Provides simple directory-oriented generators, which usually used in small IDEs, where there is only one module
|
||||
* {@link com.intellij.ide.util.projectWizard.AbstractNewProjectStep}
|
||||
* {@link com.intellij.ide.util.projectWizard.ProjectSettingsStepBase}
|
||||
* {@link com.intellij.ide.util.projectWizard.CustomStepProjectGenerator}
|
||||
* {@link HideableProjectGenerator}
|
||||
*
|
||||
*/
|
||||
public interface DirectoryProjectGenerator<T> {
|
||||
@Nullable
|
||||
@Nls(capitalization = Nls.Capitalization.Sentence)
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
package com.intellij.platform;
|
||||
|
||||
/**
|
||||
* @author Dennis.Ushakov
|
||||
* Provides a way to hide {@link DirectoryProjectGenerator} based on internal state
|
||||
* (e.g. if the generator has sub-steps, that are registered separately, and we want to hide the generator if there are no nested steps)
|
||||
*/
|
||||
public interface HideableProjectGenerator {
|
||||
boolean isHidden();
|
||||
|
||||
Reference in New Issue
Block a user