当前位置: 首页>>代码示例>>Java>>正文


Java UndoManager.getGlobalInstance方法代码示例

本文整理汇总了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();
  }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:PlatformTestCase.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:PlatformTestCase.java

示例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);
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ConsoleExecuteActionHandler.java

示例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();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:PlatformTestCase.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:ProxyUndoRedoAction.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:MergeModelBase.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:DiffUtil.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:CommandProcessorImpl.java

示例9: getUndoManager

import com.intellij.openapi.command.undo.UndoManager; //导入方法依赖的package包/类
private UndoManagerImpl getUndoManager() {
  return (UndoManagerImpl)(myProject == null ? UndoManager.getGlobalInstance() : UndoManager.getInstance(myProject));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DocumentUndoProvider.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:UndoRedoAction.java


注:本文中的com.intellij.openapi.command.undo.UndoManager.getGlobalInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。