use of com.intellij.ide.plugins.PluginStateListener in project azure-tools-for-java by Microsoft.
the class AzurePlugin method runActivity.
@Override
public void runActivity(@NotNull Project project) {
this.azureSettings = AzureSettings.getSafeInstance(project);
initializeAIRegistry(project);
// Showing dialog needs to be run in UI thread
initializeWhatsNew(project);
if (!IS_ANDROID_STUDIO) {
LOG.info("Starting Azure Plugin");
firstInstallationByVersion = isFirstInstallationByVersion();
try {
// this code is for copying componentset.xml in plugins folder
copyPluginComponents();
if (pluginStateListener == null) {
pluginStateListener = new PluginStateListener() {
@Override
public void install(@NotNull IdeaPluginDescriptor ideaPluginDescriptor) {
}
@Override
public void uninstall(@NotNull IdeaPluginDescriptor ideaPluginDescriptor) {
String pluginId = ideaPluginDescriptor.getPluginId().toString();
if (pluginId.equalsIgnoreCase(CommonConst.PLUGIN_ID)) {
EventUtil.logEvent(EventType.info, SYSTEM, PLUGIN_UNINSTALL, null, null);
}
}
};
PluginInstaller.addStateListener(pluginStateListener);
}
clearTempDirectory();
loadWebappsSettings(project);
afterInitialization(project);
} catch (ProcessCanceledException e) {
throw e;
} catch (Exception e) {
/* This is not a user initiated task
So user should not get any exception prompt.*/
LOG.error(AzureBundle.message("expErlStrtUp"), e);
}
}
}
Aggregations