本文整理汇总了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;
}
}
示例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);
}
}
}
示例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();
}
}
});
}
}
示例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;
}
示例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;
}
示例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());
}
示例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();
}
示例8: getModalityStateForQuestionDialogs
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public ModalityState getModalityStateForQuestionDialogs() {
return ModalityState.defaultModalityState();
}
示例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);
}
示例10: CvsOperationExecutor
import com.intellij.openapi.application.ModalityState; //导入方法依赖的package包/类
public CvsOperationExecutor(Project project) {
this(true, project, ModalityState.defaultModalityState());
}
示例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;
}