本文整理汇总了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);
}