use of com.intellij.openapi.application.Application in project intellij-community by JetBrains.
the class IdeaPluginDescriptorImpl method isBundled.
@Override
public boolean isBundled() {
if (PluginManagerCore.CORE_PLUGIN_ID.equals(myId.getIdString())) {
return true;
}
String path;
try {
//to avoid paths like this /home/kb/IDEA/bin/../config/plugins/APlugin
path = getPath().getCanonicalPath();
} catch (IOException e) {
path = getPath().getAbsolutePath();
}
Application app = ApplicationManager.getApplication();
if (app != null && app.isInternal()) {
if (path.startsWith(PathManager.getHomePath() + File.separator + "out" + File.separator + "classes")) {
return true;
}
if (app.isUnitTestMode() && !path.startsWith(PathManager.getPluginsPath() + File.separatorChar)) {
return true;
}
}
return path.startsWith(PathManager.getPreInstalledPluginsPath());
}
use of com.intellij.openapi.application.Application in project intellij-community by JetBrains.
the class IdeaPluginDescriptorImpl method readExternal.
public void readExternal(@NotNull Document document, @NotNull URL url, @NotNull JDOMXIncluder.PathResolver pathResolver) throws InvalidDataException, FileNotFoundException {
Application application = ApplicationManager.getApplication();
readExternal(document, url, application != null && application.isUnitTestMode(), pathResolver);
}
use of com.intellij.openapi.application.Application in project intellij-community by JetBrains.
the class PluginManagerCore method prepareLoadingPluginsErrorMessage.
private static void prepareLoadingPluginsErrorMessage(@NotNull List<String> errors) {
if (!errors.isEmpty()) {
String errorMessage = IdeBundle.message("error.problems.found.loading.plugins") + StringUtil.join(errors, "<p/>");
Application app = ApplicationManager.getApplication();
if (app != null && !app.isHeadlessEnvironment() && !app.isUnitTestMode()) {
if (myPluginError == null) {
myPluginError = errorMessage;
} else {
myPluginError += "\n" + errorMessage;
}
} else {
getLogger().error(errorMessage);
}
}
}
use of com.intellij.openapi.application.Application in project intellij-community by JetBrains.
the class IdeFocusManager method getGlobalInstance.
@NotNull
public static IdeFocusManager getGlobalInstance() {
IdeFocusManager fm = null;
Application app = ApplicationManager.getApplication();
if (app != null && app.hasComponent(IdeFocusManager.class)) {
fm = app.getComponent(IdeFocusManager.class);
}
if (fm == null) {
// happens when app is semi-initialized (e.g. when IDEA server dialog is shown)
fm = PassThroughIdeFocusManager.getInstance();
}
return fm;
}
use of com.intellij.openapi.application.Application in project intellij-community by JetBrains.
the class TextFieldWithBrowseButton method installPathCompletion.
protected void installPathCompletion(final FileChooserDescriptor fileChooserDescriptor, @Nullable Disposable parent) {
final Application application = ApplicationManager.getApplication();
if (application == null || application.isUnitTestMode() || application.isHeadlessEnvironment())
return;
FileChooserFactory.getInstance().installFileCompletion(getChildComponent(), fileChooserDescriptor, true, parent);
}
Aggregations