當前位置: 首頁>>代碼示例>>Java>>正文


Java ModalityState.defaultModalityState方法代碼示例

本文整理匯總了Java中com.intellij.openapi.application.ModalityState.defaultModalityState方法的典型用法代碼示例。如果您正苦於以下問題:Java ModalityState.defaultModalityState方法的具體用法?Java ModalityState.defaultModalityState怎麽用?Java ModalityState.defaultModalityState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.application.ModalityState的用法示例。


在下文中一共展示了ModalityState.defaultModalityState方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateDirectories

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
@NotNull
public UpdateSession updateDirectories(@NotNull FilePath[] contentRoots, final UpdatedFiles updatedFiles, ProgressIndicator progressIndicator,
                                       @NotNull final Ref<SequentialUpdatesContext> contextRef) {
  CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(myProject);
  if (!myLastUpdateWasConfigured) {
    cvsConfiguration.CLEAN_COPY = false;
    cvsConfiguration.RESET_STICKY = false;
  }
  myLastUpdateWasConfigured = false;

  try {
    final UpdateSettingsOnCvsConfiguration updateSettings = createSettingsAndUpdateContext(cvsConfiguration, contextRef);
    final UpdateHandler handler = CommandCvsHandler.createUpdateHandler(contentRoots, updateSettings, myProject, updatedFiles);
    handler.addCvsListener(new UpdatedFilesProcessor(updatedFiles));
    CvsOperationExecutor cvsOperationExecutor = new CvsOperationExecutor(true, myProject, ModalityState.defaultModalityState());
    cvsOperationExecutor.setShowErrors(false);
    cvsOperationExecutor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
    final CvsResult result = cvsOperationExecutor.getResult();
    return createUpdateSessionAdapter(updatedFiles, result);
  }
  finally {
    cvsConfiguration.CLEAN_COPY = false;
    cvsConfiguration.RESET_STICKY = false;                    
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:CvsUpdateEnvironment.java

示例2: allowStartingDumbModeInside

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
@Override
public void allowStartingDumbModeInside(@NotNull DumbModePermission permission, @NotNull Runnable runnable) {
  ModalityState modality = ModalityState.defaultModalityState();
  DumbModePermission prev = myPermissions.put(modality, permission);
  try {
    runnable.run();
  }
  finally {
    if (prev == null) {
      myPermissions.remove(modality);
    } else {
      myPermissions.put(modality, prev);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:DumbPermissionServiceImpl.java

示例3: run

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
public final void run() {
  synchronized (myLock) {
    final CommandGroup commandGroup = getNextCommandGroup();
    if (commandGroup == null || commandGroup.isEmpty()) return;

    final Condition conditionForGroup = commandGroup.getExpireCondition();

    final FinalizableCommand command = commandGroup.takeNextCommand();
    myCommandCount--;

    final Condition expire = command.getExpireCondition() != null ? command.getExpireCondition() : conditionForGroup;

    if (LOG.isDebugEnabled()) {
      LOG.debug("CommandProcessor.run " + command);
    }
    // max. I'm not actually quite sure this should have NON_MODAL modality but it should
    // definitely have some since runnables in command list may (and do) request some PSI activity
    final boolean queueNext = myCommandCount > 0;
    Application application = ApplicationManager.getApplication();
    ModalityState modalityState = Registry.is("ide.perProjectModality") ? ModalityState.defaultModalityState() : ModalityState.NON_MODAL;
    application.getInvokator().invokeLater(command, modalityState, expire == null ? application.getDisposed() : expire).doWhenDone(new Runnable() {
      public void run() {
        if (queueNext) {
          CommandProcessor.this.run();
        }
      }
    });
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:CommandProcessor.java

示例4: getBranchesProvider

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
private static BranchesProvider getBranchesProvider(CvsOperation operation, Project project) throws VcsException {
  LOG.assertTrue(operation instanceof BranchesProvider);
  final CvsOperationExecutor executor =
    new CvsOperationExecutor(true, project, new ModalityContextImpl(ModalityState.defaultModalityState()));
  final CommandCvsHandler handler = new CommandCvsHandler(CvsBundle.message("load.tags.operation.name"), operation, true);
  executor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
  final CvsResult executionResult = executor.getResult();
  if (executionResult.hasErrors()) throw executionResult.composeError();
  return (BranchesProvider)operation;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:TagsHelper.java

示例5: getCurrentModalityState

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
private ModalityState getCurrentModalityState() {
  ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
  ModalityState modalityState = progressIndicator == null
                                ? myDefaultModalityState
                                : progressIndicator.getModalityState();
  if (modalityState == null) modalityState = ModalityState.defaultModalityState();
  return modalityState;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:ModalityContextImpl.java

示例6: updateDirectories

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
@NotNull
public UpdateSession updateDirectories(@NotNull FilePath[] contentRoots, final UpdatedFiles updatedFiles,
                                       ProgressIndicator progressIndicator,
                                       @NotNull final Ref<SequentialUpdatesContext> context) {
  final UpdateSettings updateSettings = UpdateSettings.DONT_MAKE_ANY_CHANGES;
  final UpdateHandler handler = CommandCvsHandler.createUpdateHandler(contentRoots,
                                                                      updateSettings, myProject, updatedFiles);
  handler.addCvsListener(new UpdatedFilesProcessor(updatedFiles));
  CvsOperationExecutor cvsOperationExecutor = new CvsOperationExecutor(true, myProject, ModalityState.defaultModalityState());
  cvsOperationExecutor.setShowErrors(false);
  cvsOperationExecutor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
  final CvsResult result = cvsOperationExecutor.getResult();
  return new UpdateSessionAdapter(result.getErrorsAndWarnings(), result.isCanceled());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:CvsStatusEnvironment.java

示例7: getCurrent

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
private static ModalityState getCurrent() {
  if (ApplicationManager.getApplication().isDispatchThread()) {
    return ModalityState.current();
  }
  final ProgressIndicator pi = ProgressManager.getInstance().getProgressIndicator();
  if (pi == null) {
    return ModalityState.defaultModalityState();
  }
  return pi.getModalityState();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:SvnAuthenticationManager.java

示例8: getModalityStateForQuestionDialogs

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
public ModalityState getModalityStateForQuestionDialogs() {
  return ModalityState.defaultModalityState();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:IdeUIModifiableModelsProvider.java

示例9: invokeLater

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
@NotNull
static ActionCallback invokeLater(@NotNull Runnable runnable, @NotNull Condition<?> expired) {
  ModalityState modalityState = ModalityState.defaultModalityState();
  return invokeLater(runnable, modalityState, expired);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:LaterInvocator.java

示例10: CvsOperationExecutor

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
public CvsOperationExecutor(Project project) {
  this(true, project, ModalityState.defaultModalityState());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:CvsOperationExecutor.java

示例11: executeQuietOperation

import com.intellij.openapi.application.ModalityState; //導入方法依賴的package包/類
public static CvsOperationExecutor executeQuietOperation(String title, CvsOperation operation, final Project project) {
  CvsOperationExecutor executor = new CvsOperationExecutor(false, project, ModalityState.defaultModalityState());
  executor.setIsQuietOperation(true);
  executor.performActionSync(new CommandCvsHandler(title, operation), CvsOperationExecutorCallback.EMPTY);
  return executor;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:CvsVcs2.java


注:本文中的com.intellij.openapi.application.ModalityState.defaultModalityState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。