use of com.intellij.ide.util.PropertiesComponent in project flutter-intellij by flutter.
the class FlutterInitializer method setCanReportAnalytics.
public static void setCanReportAnalytics(boolean canReportAnalytics) {
if (getCanReportAnalytics() != canReportAnalytics) {
final boolean wasReporting = getCanReportAnalytics();
final PropertiesComponent properties = PropertiesComponent.getInstance();
properties.setValue(analyticsOptOutKey, !canReportAnalytics);
if (analytics != null) {
analytics.setCanSend(getCanReportAnalytics());
}
if (!wasReporting && canReportAnalytics) {
getAnalytics().sendScreenView("main");
}
}
}
use of com.intellij.ide.util.PropertiesComponent in project flutter-intellij by flutter.
the class FlutterUtils method disableGradleProjectMigrationNotification.
public static void disableGradleProjectMigrationNotification(@NotNull Project project) {
final String showMigrateToGradlePopup = "show.migrate.to.gradle.popup";
final PropertiesComponent properties = PropertiesComponent.getInstance(project);
if (properties.getValue(showMigrateToGradlePopup) == null) {
properties.setValue(showMigrateToGradlePopup, "false");
}
}
use of com.intellij.ide.util.PropertiesComponent in project flutter-intellij by flutter.
the class FlutterRunNotifications method checkForDisplayFirstReload.
private void checkForDisplayFirstReload() {
final PropertiesComponent properties = PropertiesComponent.getInstance(myProject);
final boolean alreadyRun = properties.getBoolean(RELOAD_ALREADY_RUN);
if (!alreadyRun) {
properties.setValue(RELOAD_ALREADY_RUN, true);
final Notification notification = new Notification(FlutterMessages.FLUTTER_NOTIFICATION_GOUP_ID, FlutterBundle.message("flutter.reload.firstRun.title"), FlutterBundle.message("flutter.reload.firstRun.content"), NotificationType.INFORMATION);
notification.setIcon(FlutterIcons.HotReload);
notification.addAction(new AnAction("Learn more") {
@Override
public void actionPerformed(AnActionEvent event) {
BrowserUtil.browse(FlutterBundle.message("flutter.reload.firstRun.url"));
notification.expire();
}
});
Notifications.Bus.notify(notification);
}
}
use of com.intellij.ide.util.PropertiesComponent in project flutter-intellij by flutter.
the class FlutterSettings method sendSettingsToAnalytics.
public void sendSettingsToAnalytics(Analytics analytics) {
final PropertiesComponent properties = getPropertiesComponent();
// Send data on the number of experimental features enabled by users.
analytics.sendEvent("settings", "ping");
if (isEnablePreviewDart2()) {
analytics.sendEvent("settings", "enableDart2");
} else if (isDisablePreviewDart2()) {
analytics.sendEvent("settings", "disableDart2");
}
if (isReloadOnSave()) {
analytics.sendEvent("settings", afterLastPeriod(reloadOnSaveKey));
}
if (isFormatCodeOnSave()) {
analytics.sendEvent("settings", afterLastPeriod(formatCodeOnSaveKey));
if (isOrganizeImportsOnSaveKey()) {
analytics.sendEvent("settings", afterLastPeriod(organizeImportsOnSaveKey));
}
}
if (isOpenInspectorOnAppLaunch()) {
analytics.sendEvent("settings", afterLastPeriod(openInspectorOnAppLaunchKey));
}
if (isShowOnlyWidgets()) {
analytics.sendEvent("settings", afterLastPeriod(showOnlyWidgetsKey));
}
if (isShowPreviewArea()) {
analytics.sendEvent("settings", afterLastPeriod(showPreviewAreaKey));
}
if (isShowHeapDisplay()) {
analytics.sendEvent("settings", afterLastPeriod(showHeapDisplayKey));
}
}
use of com.intellij.ide.util.PropertiesComponent in project liferay-ide by liferay.
the class LiferayProjectTemplateList method restoreSelection.
public void restoreSelection() {
PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
String templateName = propertiesComponent.getValue(_PROJECT_WIZARD_TEMPLATE);
if ((templateName != null) && (_templateList.getModel() instanceof CollectionListModel)) {
List<ProjectTemplate> list = ((CollectionListModel<ProjectTemplate>) _templateList.getModel()).toList();
ProjectTemplate template = ContainerUtil.find(list, template1 -> templateName.equals(template1.getName()));
if (template != null) {
_templateList.setSelectedValue(template, true);
}
}
ListSelectionModel listSelectionModel = _templateList.getSelectionModel();
listSelectionModel.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent event) {
ProjectTemplate template = getSelectedTemplate();
if (template != null) {
PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
propertiesComponent.setValue(_PROJECT_WIZARD_TEMPLATE, template.getName());
}
}
});
}
Aggregations