TextMateSettingsState () { TextMateSettingsState state = new TextMateSettingsState(); ArrayList<BundleConfigBean> bundles = new ArrayList<>(); TextMateUserBundlesSettings settings = TextMateUserBundlesSettings.getInstance(); if (settings != null) { for (Map.Entry<String, TextMatePersistentBundle> entry : settings.getBundles().entrySet()) { bundles.add(new BundleConfigBean(entry.getValue().getName(), entry.getKey(), entry.getValue().getEnabled())); } } TextMateBuiltinBundlesSettings builtinBundlesSettings = TextMateBuiltinBundlesSettings.getInstance(); if (builtinBundlesSettings != null) { Set<String> turnedOffBundleNames = builtinBundlesSettings.getTurnedOffBundleNames(); for (TextMateBundleToLoad bundle : TextMateServiceImpl.discoverBuiltinBundles(builtinBundlesSettings)) { bundles.add(new BundleConfigBean(bundle.getName(), bundle.getPath(), !turnedOffBundleNames.contains(bundle.getName()))); } } state.setBundles(bundles); return state; }