本文整理匯總了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();
}
}
示例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);
}
}
示例3: isRefresh
import com.intellij.psi.ExternalChangeAction; //導入依賴的package包/類
public static boolean isRefresh() {
return ApplicationManager.getApplication().hasWriteAction(ExternalChangeAction.class);
}