當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。