use of com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext in project intellij-community by JetBrains.
the class ClasspathPanelImpl method addItems.
@Override
public void addItems(List<ClasspathTableItem<?>> toAdd) {
for (ClasspathTableItem<?> item : toAdd) {
myModel.addRow(item);
}
TIntArrayList toSelect = new TIntArrayList();
for (int i = myModel.getRowCount() - toAdd.size(); i < myModel.getRowCount(); i++) {
toSelect.add(myEntryTable.convertRowIndexToView(i));
}
TableUtil.selectRows(myEntryTable, toSelect.toNativeArray());
TableUtil.scrollSelectionToVisible(myEntryTable);
final StructureConfigurableContext context = ModuleStructureConfigurable.getInstance(myState.getProject()).getContext();
context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, getRootModel().getModule()));
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext in project intellij-community by JetBrains.
the class ClasspathPanelImpl method removeSelectedItems.
private void removeSelectedItems(final List removedRows) {
if (removedRows.isEmpty()) {
return;
}
for (final Object removedRow : removedRows) {
final ClasspathTableItem<?> item = (ClasspathTableItem<?>) ((Object[]) removedRow)[ClasspathTableModel.ITEM_COLUMN];
final OrderEntry orderEntry = item.getEntry();
if (orderEntry == null) {
continue;
}
getRootModel().removeOrderEntry(orderEntry);
}
final int[] selectedRows = myEntryTable.getSelectedRows();
myModel.fireTableDataChanged();
TableUtil.selectRows(myEntryTable, selectedRows);
final StructureConfigurableContext context = ModuleStructureConfigurable.getInstance(myState.getProject()).getContext();
context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, getRootModel().getModule()));
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext in project intellij-community by JetBrains.
the class UIRootConfigurationAccessor method getLibrary.
@Override
@Nullable
public Library getLibrary(Library library, final String libraryName, final String libraryLevel) {
final StructureConfigurableContext context = ProjectStructureConfigurable.getInstance(myProject).getContext();
if (library == null) {
if (libraryName != null) {
library = context.getLibrary(libraryName, libraryLevel);
}
} else {
final Library model = context.getLibraryModel(library);
if (model != null) {
library = model;
}
library = context.getLibrary(library.getName(), library.getTable().getTableLevel());
}
return library;
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext in project intellij-community by JetBrains.
the class ProjectJdkConfigurable method clearCaches.
private void clearCaches() {
final ModuleStructureConfigurable rootConfigurable = ModuleStructureConfigurable.getInstance(myProject);
Module[] modules = rootConfigurable.getModules();
for (Module module : modules) {
final StructureConfigurableContext context = rootConfigurable.getContext();
context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, module));
}
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext in project intellij-community by JetBrains.
the class IdeaModifiableModelsProvider method getLibraryTableModifiableModel.
@Override
public LibraryTable.ModifiableModel getLibraryTableModifiableModel() {
final Project[] projects = ProjectManager.getInstance().getOpenProjects();
for (Project project : projects) {
if (!project.isInitialized()) {
continue;
}
StructureConfigurableContext context = getProjectStructureContext(project);
LibraryTableModifiableModelProvider provider = context != null ? context.createModifiableModelProvider(LibraryTablesRegistrar.APPLICATION_LEVEL) : null;
final LibraryTable.ModifiableModel modifiableModel = provider != null ? provider.getModifiableModel() : null;
if (modifiableModel != null) {
return modifiableModel;
}
}
return LibraryTablesRegistrar.getInstance().getLibraryTable().getModifiableModel();
}
Aggregations