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


Java ExternalChangeAction类代码示例

本文整理汇总了Java中com.intellij.psi.ExternalChangeAction的典型用法代码示例。如果您正苦于以下问题:Java ExternalChangeAction类的具体用法?Java ExternalChangeAction怎么用?Java ExternalChangeAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExternalChangeAction类属于com.intellij.psi包,在下文中一共展示了ExternalChangeAction类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: documentChanged

import com.intellij.psi.ExternalChangeAction; //导入依赖的package包/类
@Override
public void documentChanged(DocumentEvent e) {
  final Document document = e.getDocument();
  if (!ApplicationManager.getApplication().hasWriteAction(ExternalChangeAction.ExternalDocumentChange.class)) {
    myUnsavedDocuments.add(document);
  }
  final Runnable currentCommand = CommandProcessor.getInstance().getCurrentCommand();
  Project project = currentCommand == null ? null : CommandProcessor.getInstance().getCurrentCommandProject();
  if (project == null)
    project = ProjectUtil.guessProjectForFile(getFile(document));
  String lineSeparator = CodeStyleFacade.getInstance(project).getLineSeparator();
  document.putUserData(LINE_SEPARATOR_KEY, lineSeparator);

  // avoid documents piling up during batch processing
  if (areTooManyDocumentsInTheQueue(myUnsavedDocuments)) {
    saveAllDocumentsLater();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:FileDocumentManagerImpl.java

示例2: createActivityAndSetupManifest

import com.intellij.psi.ExternalChangeAction; //导入依赖的package包/类
private void createActivityAndSetupManifest(final AndroidFacet facet, final PsiDirectory sourceDir) {
  if (myPackageName != null) {
    CommandProcessor.getInstance().executeCommand(facet.getModule().getProject(), new ExternalChangeAction() {
      @Override
      public void run() {
        Runnable action = new Runnable() {
          @Override
          public void run() {
            PsiDirectory packageDir = createPackageIfPossible(sourceDir, myPackageName);
            if (packageDir == null) return;
            final Manifest manifest = facet.getManifest();
            if (manifest != null) {
              manifest.getPackage().setValue(myPackageName);
              final Module module = facet.getModule();
              final Project project = module.getProject();
              StartupManager.getInstance(project).runWhenProjectIsInitialized(new Runnable() {
                @Override
                public void run() {
                  FileDocumentManager.getInstance().saveAllDocuments();
                }
              });

              assignApplicationName(facet);

              Sdk sdk = getAndroidSdkForModule(module);
              if (sdk != null) {
                final AndroidPlatform platform = AndroidPlatform.parse(sdk);
                if (platform != null) {
                  configureManifest(facet, platform.getTarget());
                }
              }
            }
          }
        };
        ApplicationManager.getApplication().runWriteAction(action);
      }
    }, AndroidBundle.message("build.android.module.process.title"), null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:AndroidModuleBuilder.java

示例3: isRefresh

import com.intellij.psi.ExternalChangeAction; //导入依赖的package包/类
public static boolean isRefresh() {
  return ApplicationManager.getApplication().hasWriteAction(ExternalChangeAction.class);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:UndoManagerImpl.java


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