本文整理匯總了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;
}