本文整理汇总了Java中com.intellij.openapi.command.undo.UndoManager.getGlobalInstance方法的典型用法代码示例。如果您正苦于以下问题:Java UndoManager.getGlobalInstance方法的具体用法?Java UndoManager.getGlobalInstance怎么用?Java UndoManager.getGlobalInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.command.undo.UndoManager
的用法示例。
在下文中一共展示了UndoManager.getGlobalInstance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanupApplicationCaches
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public static void cleanupApplicationCaches(Project project) {
if (project != null && !project.isDisposed()) {
UndoManagerImpl globalInstance = (UndoManagerImpl)UndoManager.getGlobalInstance();
if (globalInstance != null) {
globalInstance.dropHistoryInTests();
}
((UndoManagerImpl)UndoManager.getInstance(project)).dropHistoryInTests();
((PsiManagerImpl)PsiManager.getInstance(project)).cleanupForNextTest();
}
ProjectManagerImpl projectManager = (ProjectManagerImpl)ProjectManager.getInstance();
if (projectManager.isDefaultProjectInitialized()) {
Project defaultProject = projectManager.getDefaultProject();
((PsiManagerImpl)PsiManager.getInstance(defaultProject)).cleanupForNextTest();
}
LocalFileSystemImpl localFileSystem = (LocalFileSystemImpl)LocalFileSystem.getInstance();
if (localFileSystem != null) {
localFileSystem.cleanupForNextTest();
}
}
示例2: cleanupApplicationCaches
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public static void cleanupApplicationCaches(Project project) {
if (project != null && !project.isDisposed()) {
UndoManagerImpl globalInstance = (UndoManagerImpl)UndoManager.getGlobalInstance();
if (globalInstance != null) {
globalInstance.dropHistoryInTests();
}
((UndoManagerImpl)UndoManager.getInstance(project)).dropHistoryInTests();
((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().cleanupForNextTest();
}
LocalFileSystemImpl localFileSystem = (LocalFileSystemImpl)LocalFileSystem.getInstance();
if (localFileSystem != null) {
localFileSystem.cleanupForNextTest();
}
LocalHistoryImpl.getInstanceImpl().cleanupForNextTest();
PatchedWeakReference.clearAll();
}
示例3: runExecuteAction
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public void runExecuteAction(LanguageConsoleImpl languageConsole) {
// Process input and add to history
final Document document = languageConsole.getCurrentEditor().getDocument();
final String text = document.getText();
final TextRange range = new TextRange(0, document.getTextLength());
languageConsole.getCurrentEditor().getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset());
if (myAddCurrentToHistory) {
languageConsole.addCurrentToHistory(range, false, myPreserveMarkup);
}
languageConsole.setInputText("");
final UndoManager manager = languageConsole.getProject() == null ? UndoManager.getGlobalInstance() : UndoManager.getInstance(
languageConsole.getProject());
((UndoManagerImpl)manager).invalidateActionsFor(DocumentReferenceManager.getInstance().create(document));
myConsoleHistoryModel.addToHistory(text);
// Send to interpreter / server
processLine(text);
}
示例4: cleanupApplicationCaches
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public static void cleanupApplicationCaches(Project project) {
if (project != null && !project.isDisposed()) {
UndoManagerImpl globalInstance = (UndoManagerImpl)UndoManager.getGlobalInstance();
if (globalInstance != null) {
globalInstance.dropHistoryInTests();
}
((UndoManagerImpl)UndoManager.getInstance(project)).dropHistoryInTests();
((PsiManagerEx)PsiManager.getInstance(project)).getFileManager().cleanupForNextTest();
}
LocalFileSystemImpl localFileSystem = (LocalFileSystemImpl)LocalFileSystem.getInstance();
if (localFileSystem != null) {
localFileSystem.cleanupForNextTest();
}
LocalHistory.getInstance().cleanupForNextTest();
}
示例5: register
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public static void register(@javax.annotation.Nullable Project project, @Nonnull Editor editor, @Nonnull JComponent component) {
UndoManager undoManager = project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance();
TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(editor);
if (undoManager != null) {
EmptyAction.setupAction(new ProxyUndoRedoAction(undoManager, textEditor, true), IdeActions.ACTION_UNDO, component);
EmptyAction.setupAction(new ProxyUndoRedoAction(undoManager, textEditor, false), IdeActions.ACTION_REDO, component);
}
}
示例6: MergeModelBase
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public MergeModelBase(@javax.annotation.Nullable Project project, @Nonnull Document document) {
myProject = project;
myDocument = document;
myUndoManager = myProject != null ? UndoManager.getInstance(myProject) : UndoManager.getGlobalInstance();
myDocument.addDocumentListener(new MyDocumentListener(), this);
}
示例7: putNonundoableOperation
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
public static void putNonundoableOperation(@Nullable Project project, @Nonnull Document document) {
UndoManager undoManager = project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance();
if (undoManager != null) {
DocumentReference ref = DocumentReferenceManager.getInstance().create(document);
undoManager.nonundoableActionPerformed(ref, false);
}
}
示例8: getUndoManager
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
private static UndoManagerImpl getUndoManager(Project project) {
return (UndoManagerImpl)(project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance());
}
示例9: getUndoManager
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
private UndoManagerImpl getUndoManager() {
return (UndoManagerImpl)(myProject == null ? UndoManager.getGlobalInstance() : UndoManager.getInstance(myProject));
}
示例10: getUndoManager
import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
private static UndoManager getUndoManager(FileEditor editor, DataContext dataContext) {
Project project = getProject(editor, dataContext);
return project != null ? UndoManager.getInstance(project) : UndoManager.getGlobalInstance();
}