本文整理汇总了Java中com.intellij.openapi.command.undo.UndoManager.isRedoInProgress方法的典型用法代码示例。如果您正苦于以下问题:Java UndoManager.isRedoInProgress方法的具体用法?Java UndoManager.isRedoInProgress怎么用?Java UndoManager.isRedoInProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.command.undo.UndoManager
的用法示例。
在下文中一共展示了UndoManager.isRedoInProgress方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: documentChanged
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
@Override
public void documentChanged(DocumentEvent e) {
UndoManager undoManager = UndoManager.getInstance(myProject);
boolean undoOrRedo = undoManager.isUndoInProgress() || undoManager.isRedoInProgress();
if (undoOrRedo) {
// allow undo/redo up until 'creation stamp' back in time
// and check it after action is completed
if (e.getDocument() == myOrigDocument) {
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (myOrigCreationStamp > myOrigDocument.getModificationStamp()) {
closeEditor();
}
}
});
}
}
else if (e.getDocument() == myNewDocument) {
commitToOriginal(e);
if (!isValid()) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
closeEditor();
}
}, myProject.getDisposed());
}
}
else if (e.getDocument() == myOrigDocument) {
if (myCommittingToOriginal || myAltFullRange != null && myAltFullRange.isValid()) return;
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
closeEditor();
}
}, myProject.getDisposed());
}
}
示例2: documentChanged
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
@Override
public void documentChanged(DocumentEvent e) {
UndoManager undoManager = UndoManager.getInstance(myProject);
boolean undoOrRedo = undoManager.isUndoInProgress() || undoManager.isRedoInProgress();
if (undoOrRedo) {
// allow undo/redo up until 'creation stamp' back in time
// and check it after action is completed
if (e.getDocument() == myOrigDocument) {
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (myOrigCreationStamp > myOrigDocument.getModificationStamp()) {
closeEditor();
}
}
});
}
}
else if (e.getDocument() == myNewDocument) {
commitToOriginal();
}
else if (e.getDocument() == myOrigDocument) {
if (myCommittingToOriginal || myAltFullRange != null && myAltFullRange.isValid()) return;
closeEditor();
}
}
示例3: isUndoRedoInProgress
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public boolean isUndoRedoInProgress() {
UndoManager undoManager = UndoManager.getInstance(getProject());
return undoManager.isUndoInProgress() || undoManager.isRedoInProgress();
}
示例4: isUndoOrRedo
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
private static boolean isUndoOrRedo(@NotNull final Project project) {
final UndoManager undoManager = UndoManager.getInstance(project);
return undoManager.isUndoInProgress() || undoManager.isRedoInProgress();
}
示例5: isUndoRedoInProgress
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public boolean isUndoRedoInProgress()
{
UndoManager undoManager = UndoManager.getInstance(getProject());
return undoManager.isUndoInProgress() || undoManager.isRedoInProgress();
}