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();
}
}
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();
}
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;
}
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);
}
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()));
}
Aggregations