mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-26195: Add application server library: incorrect scope
This commit is contained in:
+7
-1
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.ProjectBundle;
|
||||
import com.intellij.openapi.roots.LibraryOrderEntry;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.OrderEntry;
|
||||
import com.intellij.openapi.roots.impl.libraries.LibraryTableBase;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryTable;
|
||||
import com.intellij.openapi.roots.ui.configuration.libraries.LibraryEditingUtil;
|
||||
@@ -98,7 +99,12 @@ class AddLibraryAction extends AddItemPopupAction<Library> {
|
||||
}
|
||||
}
|
||||
}
|
||||
return ClasspathTableItem.createLibItem(rootModel.addLibraryEntry(item), myContext);
|
||||
final LibraryOrderEntry orderEntry = rootModel.addLibraryEntry(item);
|
||||
final LibraryTable table = item.getTable();
|
||||
if (table instanceof LibraryTableBase) {
|
||||
orderEntry.setScope(((LibraryTableBase)table).getDefaultDependencyScope());
|
||||
}
|
||||
return ClasspathTableItem.createLibItem(orderEntry, myContext);
|
||||
}
|
||||
|
||||
protected ClasspathElementChooser<Library> createChooser() {
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.roots.DependencyScope;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryTable;
|
||||
@@ -125,6 +126,11 @@ public abstract class LibraryTableBase implements PersistentStateComponent<Eleme
|
||||
return createLibrary(null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DependencyScope getDefaultDependencyScope() {
|
||||
return DependencyScope.COMPILE;
|
||||
}
|
||||
|
||||
public void fireLibraryRenamed(LibraryImpl library) {
|
||||
myDispatcher.getMulticaster().afterLibraryRenamed(library);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user