Search in sources :

Example 91 with TIntArrayList

use of gnu.trove.TIntArrayList in project intellij-community by JetBrains.

the class JUnitConfigurable method onTypeChanged.

public void onTypeChanged(final int newType) {
    myTypeChooser.setSelectedItem(newType);
    final TIntArrayList enabledFields = ourEnabledFields.get(newType);
    for (int i = 0; i < myTestLocations.length; i++) getTestLocation(i).setEnabled(enabledFields.contains(i));
    /*if (newType == JUnitConfigurationModel.PATTERN) {
      myModule.setEnabled(false);
    } else */
    if (newType != JUnitConfigurationModel.ALL_IN_PACKAGE && newType != JUnitConfigurationModel.PATTERN && newType != JUnitConfigurationModel.CATEGORY) {
        myModule.setEnabled(true);
    } else {
        onScopeChanged();
    }
}
Also used : TIntArrayList(gnu.trove.TIntArrayList)

Example 92 with TIntArrayList

use of gnu.trove.TIntArrayList in project intellij-community by JetBrains.

the class JdkChooserPanel method updateList.

public void updateList(final Sdk selectedJdk, @Nullable final SdkType type, @Nullable final Sdk[] globalSdks) {
    final int[] selectedIndices = myList.getSelectedIndices();
    fillList(type, globalSdks);
    // restore selection
    if (selectedJdk != null) {
        TIntArrayList list = new TIntArrayList();
        for (int i = 0; i < myListModel.size(); i++) {
            final Sdk jdk = (Sdk) myListModel.getElementAt(i);
            if (Comparing.strEqual(jdk.getName(), selectedJdk.getName())) {
                list.add(i);
            }
        }
        final int[] indicesToSelect = list.toNativeArray();
        if (indicesToSelect.length > 0) {
            myList.setSelectedIndices(indicesToSelect);
        } else if (myList.getModel().getSize() > 0) {
            myList.setSelectedIndex(0);
        }
    } else {
        if (selectedIndices.length > 0) {
            myList.setSelectedIndices(selectedIndices);
        } else {
            myList.setSelectedIndex(0);
        }
    }
    myCurrentJdk = (Sdk) myList.getSelectedValue();
}
Also used : Sdk(com.intellij.openapi.projectRoots.Sdk) TIntArrayList(gnu.trove.TIntArrayList)

Example 93 with TIntArrayList

use of gnu.trove.TIntArrayList in project intellij-community by JetBrains.

the class DaemonAnalyzerTestCase method doHighlighting.

@NotNull
protected List<HighlightInfo> doHighlighting() {
    PsiDocumentManager.getInstance(myProject).commitAllDocuments();
    TIntArrayList toIgnore = new TIntArrayList();
    if (!doTestLineMarkers()) {
        toIgnore.add(Pass.LINE_MARKERS);
    }
    if (!doExternalValidation()) {
        toIgnore.add(Pass.EXTERNAL_TOOLS);
    }
    if (forceExternalValidation()) {
        toIgnore.add(Pass.LINE_MARKERS);
        toIgnore.add(Pass.LOCAL_INSPECTIONS);
        toIgnore.add(Pass.WHOLE_FILE_LOCAL_INSPECTIONS);
        toIgnore.add(Pass.POPUP_HINTS);
        toIgnore.add(Pass.UPDATE_ALL);
    }
    boolean canChange = canChangeDocumentDuringHighlighting();
    List<HighlightInfo> infos = CodeInsightTestFixtureImpl.instantiateAndRun(getFile(), getEditor(), toIgnore.toNativeArray(), canChange);
    if (!canChange) {
        Document document = getDocument(getFile());
        DaemonCodeAnalyzerEx daemonCodeAnalyzer = DaemonCodeAnalyzerEx.getInstanceEx(myProject);
        daemonCodeAnalyzer.getFileStatusMap().assertAllDirtyScopesAreNull(document);
    }
    return infos;
}
Also used : HighlightInfo(com.intellij.codeInsight.daemon.impl.HighlightInfo) DaemonCodeAnalyzerEx(com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx) Document(com.intellij.openapi.editor.Document) TIntArrayList(gnu.trove.TIntArrayList) NotNull(org.jetbrains.annotations.NotNull)

Example 94 with TIntArrayList

use of gnu.trove.TIntArrayList in project intellij-community by JetBrains.

the class LightDaemonAnalyzerTestCase method doHighlighting.

@NotNull
protected List<HighlightInfo> doHighlighting() {
    PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
    TIntArrayList toIgnoreList = new TIntArrayList();
    if (!doFolding()) {
        toIgnoreList.add(Pass.UPDATE_FOLDING);
    }
    if (!doInspections()) {
        toIgnoreList.add(Pass.LOCAL_INSPECTIONS);
        toIgnoreList.add(Pass.WHOLE_FILE_LOCAL_INSPECTIONS);
    }
    int[] toIgnore = toIgnoreList.isEmpty() ? ArrayUtil.EMPTY_INT_ARRAY : toIgnoreList.toNativeArray();
    Editor editor = getEditor();
    PsiFile file = getFile();
    if (editor instanceof EditorWindow) {
        editor = ((EditorWindow) editor).getDelegate();
        file = InjectedLanguageManager.getInstance(file.getProject()).getTopLevelFile(file);
    }
    return CodeInsightTestFixtureImpl.instantiateAndRun(file, editor, toIgnore, false);
}
Also used : PsiFile(com.intellij.psi.PsiFile) Editor(com.intellij.openapi.editor.Editor) TIntArrayList(gnu.trove.TIntArrayList) EditorWindow(com.intellij.injected.editor.EditorWindow) NotNull(org.jetbrains.annotations.NotNull)

Example 95 with TIntArrayList

use of gnu.trove.TIntArrayList 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)

Aggregations

TIntArrayList (gnu.trove.TIntArrayList)104 NotNull (org.jetbrains.annotations.NotNull)34 ArrayList (java.util.ArrayList)9 List (java.util.List)7 Nullable (org.jetbrains.annotations.Nullable)7 VirtualFile (com.intellij.openapi.vfs.VirtualFile)4 ArrangementMatchingRulesControl (com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl)3 StringSearcher (com.intellij.util.text.StringSearcher)3 TIntHashSet (gnu.trove.TIntHashSet)3 TIntProcedure (gnu.trove.TIntProcedure)3 IOException (java.io.IOException)3 IDevice (com.android.ddmlib.IDevice)2 ArrangementMatchingRulesModel (com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesModel)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 Project (com.intellij.openapi.project.Project)2 TextRange (com.intellij.openapi.util.TextRange)2 ElementToWorkOn (com.intellij.refactoring.introduceField.ElementToWorkOn)2 IntroduceParameterProcessor (com.intellij.refactoring.introduceParameter.IntroduceParameterProcessor)2 RelativePoint (com.intellij.ui.awt.RelativePoint)2 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)2