Search in sources :

Example 6 with ModuleProjectStructureElement

use of com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement 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));
    }
}
Also used : ModuleStructureConfigurable(com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable) ModuleProjectStructureElement(com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement) StructureConfigurableContext(com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext) Module(com.intellij.openapi.module.Module)

Example 7 with ModuleProjectStructureElement

use of com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement in project intellij-community by JetBrains.

the class ModuleJdkConfigurable method clearCaches.

private void clearCaches() {
    final Module module = getRootModel().getModule();
    final Project project = module.getProject();
    final StructureConfigurableContext context = ModuleStructureConfigurable.getInstance(project).getContext();
    context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, module));
}
Also used : Project(com.intellij.openapi.project.Project) ModuleProjectStructureElement(com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement) StructureConfigurableContext(com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext) Module(com.intellij.openapi.module.Module)

Example 8 with ModuleProjectStructureElement

use of com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement in project intellij-community by JetBrains.

the class ModuleStructureConfigurable method removeLibraryOrderEntry.

public void removeLibraryOrderEntry(final Module module, final Library library) {
    final ModuleEditor moduleEditor = myContext.myModulesConfigurator.getModuleEditor(module);
    LOG.assertTrue(moduleEditor != null, "Current module editor was not initialized");
    final ModifiableRootModel modelProxy = moduleEditor.getModifiableRootModelProxy();
    final OrderEntry[] entries = modelProxy.getOrderEntries();
    for (OrderEntry entry : entries) {
        if (entry instanceof LibraryOrderEntry && Comparing.strEqual(entry.getPresentableName(), library.getName())) {
            modelProxy.removeOrderEntry(entry);
            break;
        }
    }
    myContext.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(myContext, module));
    myTree.repaint();
}
Also used : ClonableOrderEntry(com.intellij.openapi.roots.impl.ClonableOrderEntry) ModuleProjectStructureElement(com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement) ModuleEditor(com.intellij.openapi.roots.ui.configuration.ModuleEditor)

Example 9 with ModuleProjectStructureElement

use of com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement 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()));
}
Also used : ModuleProjectStructureElement(com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement) StructureConfigurableContext(com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext) TIntArrayList(gnu.trove.TIntArrayList) RelativePoint(com.intellij.ui.awt.RelativePoint)

Example 10 with ModuleProjectStructureElement

use of com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement 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()));
}
Also used : ModuleProjectStructureElement(com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement) StructureConfigurableContext(com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext)

Aggregations

ModuleProjectStructureElement (com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement)10 StructureConfigurableContext (com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext)6 Module (com.intellij.openapi.module.Module)3 ClonableOrderEntry (com.intellij.openapi.roots.impl.ClonableOrderEntry)3 ModuleEditor (com.intellij.openapi.roots.ui.configuration.ModuleEditor)2 ModuleGroup (com.intellij.ide.projectView.impl.ModuleGroup)1 Project (com.intellij.openapi.project.Project)1 ProjectRootManagerImpl (com.intellij.openapi.roots.impl.ProjectRootManagerImpl)1 RootModelImpl (com.intellij.openapi.roots.impl.RootModelImpl)1 ArtifactsStructureConfigurableContext (com.intellij.openapi.roots.ui.configuration.artifacts.ArtifactsStructureConfigurableContext)1 ArtifactsTreeNode (com.intellij.openapi.roots.ui.configuration.artifacts.nodes.ArtifactsTreeNode)1 ModuleStructureConfigurable (com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable)1 LibraryProjectStructureElement (com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.LibraryProjectStructureElement)1 ProjectStructureDaemonAnalyzer (com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStructureDaemonAnalyzer)1 VirtualFilePointerManager (com.intellij.openapi.vfs.pointers.VirtualFilePointerManager)1 PackagingSourceItem (com.intellij.packaging.ui.PackagingSourceItem)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 TIntArrayList (gnu.trove.TIntArrayList)1