use of org.jetbrains.annotations.CalledInAwt in project intellij-community by JetBrains.
the class ThreesideTextDiffViewer method installEditorListeners.
//
// Listeners
//
@CalledInAwt
protected void installEditorListeners() {
new TextDiffViewerUtil.EditorActionsPopup(createEditorPopupActions()).install(getEditors());
new TextDiffViewerUtil.EditorFontSizeSynchronizer(getEditors()).install(this);
getEditor(ThreeSide.LEFT).getScrollingModel().addVisibleAreaListener(myVisibleAreaListener1);
getEditor(ThreeSide.BASE).getScrollingModel().addVisibleAreaListener(myVisibleAreaListener1);
getEditor(ThreeSide.BASE).getScrollingModel().addVisibleAreaListener(myVisibleAreaListener2);
getEditor(ThreeSide.RIGHT).getScrollingModel().addVisibleAreaListener(myVisibleAreaListener2);
SyncScrollSupport.SyncScrollable scrollable1 = getSyncScrollable(Side.LEFT);
SyncScrollSupport.SyncScrollable scrollable2 = getSyncScrollable(Side.RIGHT);
if (scrollable1 != null && scrollable2 != null) {
mySyncScrollSupport = new ThreesideSyncScrollSupport(getEditors(), scrollable1, scrollable2);
myEditorSettingsAction.setSyncScrollSupport(mySyncScrollSupport);
}
}
use of org.jetbrains.annotations.CalledInAwt in project intellij-community by JetBrains.
the class TwosideTextDiffViewer method installEditorListeners.
//
// Listeners
//
@CalledInAwt
protected void installEditorListeners() {
new TextDiffViewerUtil.EditorActionsPopup(createEditorPopupActions()).install(getEditors());
new TextDiffViewerUtil.EditorFontSizeSynchronizer(getEditors()).install(this);
getEditor(Side.LEFT).getScrollingModel().addVisibleAreaListener(myVisibleAreaListener);
getEditor(Side.RIGHT).getScrollingModel().addVisibleAreaListener(myVisibleAreaListener);
SyncScrollSupport.SyncScrollable scrollable = getSyncScrollable();
if (scrollable != null) {
mySyncScrollSupport = new TwosideSyncScrollSupport(getEditors(), scrollable);
myEditorSettingsAction.setSyncScrollSupport(mySyncScrollSupport);
}
}
use of org.jetbrains.annotations.CalledInAwt in project intellij-community by JetBrains.
the class MergeModelBase method collectAffectedChanges.
/*
* Nearby changes could be affected as well (ex: by moveChangesAfterInsertion)
*
* null means all changes could be affected
*/
@NotNull
@CalledInAwt
private TIntArrayList collectAffectedChanges(@NotNull TIntArrayList directChanges) {
TIntArrayList result = new TIntArrayList(directChanges.size());
int directArrayIndex = 0;
int otherIndex = 0;
while (directArrayIndex < directChanges.size() && otherIndex < getChangesCount()) {
int directIndex = directChanges.get(directArrayIndex);
if (directIndex == otherIndex) {
result.add(directIndex);
otherIndex++;
continue;
}
int directStart = getLineStart(directIndex);
int directEnd = getLineEnd(directIndex);
int otherStart = getLineStart(otherIndex);
int otherEnd = getLineEnd(otherIndex);
if (otherEnd < directStart) {
otherIndex++;
continue;
}
if (otherStart > directEnd) {
directArrayIndex++;
continue;
}
result.add(otherIndex);
otherIndex++;
}
LOG.assertTrue(directChanges.size() <= result.size());
return result;
}
use of org.jetbrains.annotations.CalledInAwt in project intellij-community by JetBrains.
the class ApplyPatchDifferentiatedDialog method runExecutor.
@CalledInAwt
private void runExecutor(ApplyPatchExecutor executor) {
final Collection<AbstractFilePatchInProgress> included = getIncluded();
if (included.isEmpty())
return;
final MultiMap<VirtualFile, AbstractFilePatchInProgress> patchGroups = new MultiMap<>();
for (AbstractFilePatchInProgress patchInProgress : included) {
patchGroups.putValue(patchInProgress.getBase(), patchInProgress);
}
final LocalChangeList selected = getSelectedChangeList();
FilePresentationModel presentation = myRecentPathFileChange.get();
VirtualFile vf = presentation != null ? presentation.getVf() : null;
executor.apply(getOriginalRemaining(), patchGroups, selected, vf == null ? null : vf.getName(), myReader == null ? null : myReader.getAdditionalInfo(ApplyPatchDefaultExecutor.pathsFromGroups(patchGroups)));
}
use of org.jetbrains.annotations.CalledInAwt in project intellij-community by JetBrains.
the class ApplyPatchAction method showAndGetApplyPatch.
@CalledInAwt
public static Boolean showAndGetApplyPatch(@NotNull final Project project, @NotNull final File file) {
VirtualFile vFile = VfsUtil.findFileByIoFile(file, true);
String patchPath = file.getPath();
if (vFile == null) {
VcsNotifier.getInstance(project).notifyWeakError("Can't find patch file " + patchPath);
return false;
}
if (!isPatchFile(file)) {
VcsNotifier.getInstance(project).notifyWeakError("Selected file " + patchPath + " is not patch type file ");
return false;
}
final ApplyPatchDifferentiatedDialog dialog = new ApplyPatchDifferentiatedDialog(project, new ApplyPatchDefaultExecutor(project), Collections.emptyList(), ApplyPatchMode.APPLY_PATCH_IN_MEMORY, vFile);
dialog.setModal(true);
return dialog.showAndGet();
}
Aggregations