2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.projectImport
;
18 import com
.intellij
.ide
.DataManager
;
19 import com
.intellij
.ide
.IdeBundle
;
20 import com
.intellij
.ide
.util
.projectWizard
.ProjectBuilder
;
21 import com
.intellij
.openapi
.actionSystem
.PlatformDataKeys
;
22 import com
.intellij
.openapi
.extensions
.ExtensionPointName
;
23 import com
.intellij
.openapi
.options
.ConfigurationException
;
24 import com
.intellij
.openapi
.project
.Project
;
25 import com
.intellij
.openapi
.module
.Module
;
26 import com
.intellij
.openapi
.module
.ModifiableModuleModel
;
27 import com
.intellij
.openapi
.roots
.ui
.configuration
.ModulesProvider
;
28 import com
.intellij
.packaging
.artifacts
.ModifiableArtifactModel
;
29 import org
.jetbrains
.annotations
.Nullable
;
32 import java
.util
.List
;
35 * @author Vladislav.Kaznacheev
37 public abstract class ProjectImportBuilder
<T
> extends ProjectBuilder
{
38 public static final ExtensionPointName
<ProjectImportBuilder
> EXTENSIONS_POINT_NAME
= ExtensionPointName
.create("com.intellij.projectImportBuilder");
40 private boolean myUpdate
;
42 public abstract String
getName();
44 public abstract Icon
getIcon();
46 public abstract List
<T
> getList();
48 public abstract boolean isMarked(final T element
);
50 public abstract void setList(List
<T
> list
) throws ConfigurationException
;
52 public abstract void setOpenProjectSettingsAfter(boolean on
);
55 public List
<Module
> commit(Project project
, ModifiableModuleModel model
, ModulesProvider modulesProvider
) {
56 return commit(project
, model
, modulesProvider
, null);
60 public abstract List
<Module
> commit(Project project
, ModifiableModuleModel model
, ModulesProvider modulesProvider
, ModifiableArtifactModel artifactModel
);
63 public static Project
getCurrentProject() {
64 return PlatformDataKeys
.PROJECT
.getData(DataManager
.getInstance().getDataContext());
67 protected String
getTitle() {
68 return IdeBundle
.message("project.import.wizard.title", getName());
71 public boolean isUpdate() {
75 public void setUpdate(final boolean update
) {