use of com.intellij.ide.projectWizard.NewProjectWizard in project intellij-community by JetBrains.
the class ModulesConfigurator method runModuleWizard.
@Nullable
ProjectBuilder runModuleWizard(Component dialogParent, boolean anImport) {
AbstractProjectWizard wizard;
if (anImport) {
wizard = ImportModuleAction.selectFileAndCreateWizard(myProject, dialogParent);
if (wizard == null)
return null;
if (wizard.getStepCount() == 0) {
ProjectBuilder builder = wizard.getProjectBuilder();
Disposer.dispose(wizard.getDisposable());
return builder;
}
} else {
wizard = new NewProjectWizard(myProject, dialogParent, this);
}
if (wizard.showAndGet()) {
final ProjectBuilder builder = wizard.getProjectBuilder();
if (builder instanceof ModuleBuilder) {
final ModuleBuilder moduleBuilder = (ModuleBuilder) builder;
if (moduleBuilder.getName() == null) {
moduleBuilder.setName(wizard.getProjectName());
}
if (moduleBuilder.getModuleFilePath() == null) {
moduleBuilder.setModuleFilePath(wizard.getModuleFilePath());
}
}
if (!builder.validate(myProject, myProject)) {
return null;
}
return wizard.getProjectBuilder();
}
return null;
}
use of com.intellij.ide.projectWizard.NewProjectWizard in project moe-ide-integration by multi-os-engine.
the class MOENewProjectAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
NewProjectUtil.createNewProject(getEventProject(anActionEvent), wizard);
}
use of com.intellij.ide.projectWizard.NewProjectWizard in project intellij-community by JetBrains.
the class NewModuleAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = getEventProject(e);
if (project == null) {
return;
}
Object dataFromContext = prepareDataFromContext(e);
String defaultPath = null;
final VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE);
if (virtualFile != null && virtualFile.isDirectory()) {
defaultPath = virtualFile.getPath();
}
NewProjectWizard wizard = new NewProjectWizard(project, new DefaultModulesProvider(project), defaultPath);
if (wizard.showAndGet()) {
createModuleFromWizard(project, dataFromContext, wizard);
}
}
use of com.intellij.ide.projectWizard.NewProjectWizard in project intellij-community by JetBrains.
the class NewProjectAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
NewProjectUtil.createNewProject(getEventProject(e), wizard);
}
use of com.intellij.ide.projectWizard.NewProjectWizard in project moe-ide-integration by multi-os-engine.
the class MOENewModuleAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Project project = getEventProject(e);
if (project != null) {
Object dataFromContext = this.prepareDataFromContext(e);
// String defaultPath = null;
// VirtualFile virtualFile = (VirtualFile)e.getData(CommonDataKeys.VIRTUAL_FILE);
// if(virtualFile != null && virtualFile.isDirectory()) {
// defaultPath = virtualFile.getPath();
// }
//
// NewProjectWizard wizard = new NewProjectWizard(project, new DefaultModulesProvider(project), defaultPath);
// TODO: temp hack for adding by force a module that will be changed with correct one.
// TODO: didn't find alternative way to fix incorrect adding MOE module in AS 2.1 and AS 2.0
String tempModuleDir = project.getBasePath() + File.separator + "temp";
NewProjectWizard wizard = new NewProjectWizard(project, new DefaultModulesProvider(project), tempModuleDir);
if (wizard.showAndGet()) {
this.createModuleFromWizard(project, dataFromContext, wizard);
}
}
}
Aggregations