public void writeProfiles(Collection<Profile> profiles, IScopeContext instanceScope) throws CoreException { ByteArrayOutputStream stream= new ByteArrayOutputStream(2000); try { writeProfilesToStream(profiles, stream, ENCODING, fProfileVersioner); String val; try { val= stream.toString(ENCODING); } catch (UnsupportedEncodingException e) { val= stream.toString(); } IEclipsePreferences uiPreferences = instanceScope.getNode(JavaUI.ID_PLUGIN); uiPreferences.put(fProfilesKey, val); uiPreferences.putInt(fProfilesVersionKey, fProfileVersioner.getCurrentVersion()); } finally { try { stream.close(); } catch (IOException e) { /* ignore */ } } }
private static List<Profile> addBuiltinProfiles(List<Profile> profiles, IProfileVersioner profileVersioner) { final Profile javaProfile= new BuiltInProfile(JAVA_PROFILE, FormatterMessages.ProfileManager_java_conventions_profile_name, getJavaSettings(), 1, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(javaProfile); final Profile eclipseProfile= new BuiltInProfile(ECLIPSE_PROFILE, FormatterMessages.ProfileManager_eclipse_profile_name, getEclipseSettings(), 2, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(eclipseProfile); final Profile eclipse21Profile= new BuiltInProfile(ECLIPSE21_PROFILE, FormatterMessages.ProfileManager_default_profile_name, getEclipse21Settings(), 3, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(eclipse21Profile); return profiles; }
private static List addBuiltinProfiles(List profiles, IProfileVersioner profileVersioner) { final Profile javaProfile= new BuiltInProfile(JAVA_PROFILE, FormatterMessages.ProfileManager_java_conventions_profile_name, getJavaSettings(), 1, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(javaProfile); final Profile eclipseProfile= new BuiltInProfile(ECLIPSE_PROFILE, FormatterMessages.ProfileManager_eclipse_profile_name, getEclipseSettings(), 2, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(eclipseProfile); final Profile eclipse21Profile= new BuiltInProfile(ECLIPSE21_PROFILE, FormatterMessages.ProfileManager_default_profile_name, getEclipse21Settings(), 3, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(eclipse21Profile); return profiles; }
private static List<Profile> addBuiltinProfiles(List<Profile> profiles, IProfileVersioner profileVersioner) { final Profile javaProfile= new BuiltInProfile(JAVA_PROFILE, FormatterMessages.ProfileManager_java_conventions_profile_name, getJavaSettings(), 1, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(javaProfile); final Profile eclipseProfile= new BuiltInProfile(ECLIPSE_PROFILE, FormatterMessages.ProfileManager_eclipse_profile_name, getEclipseSettings(), 2, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(eclipseProfile); final Profile eclipse21Profile= new BuiltInProfile(ECLIPSE21_PROFILE, FormatterMessages.ProfileManager_default_profile_name, getEclipse21Settings(), 3, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind()); profiles.add(eclipse21Profile); return profiles; }
rootElement.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profileVersioner.getCurrentVersion()));
rootElement.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profileVersioner.getCurrentVersion()));
rootElement.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profileVersioner.getCurrentVersion()));
public void writeProfiles(Collection profiles, IScopeContext instanceScope) throws CoreException { ByteArrayOutputStream stream= new ByteArrayOutputStream(2000); try { writeProfilesToStream(profiles, stream, ENCODING, fProfileVersioner); String val; try { val= stream.toString(ENCODING); } catch (UnsupportedEncodingException e) { val= stream.toString(); } IEclipsePreferences uiPreferences = instanceScope.getNode(JavaUI.ID_PLUGIN); uiPreferences.put(fProfilesKey, val); uiPreferences.putInt(fProfilesVersionKey, fProfileVersioner.getCurrentVersion()); } finally { try { stream.close(); } catch (IOException e) { /* ignore */ } } }
public void writeProfiles(Collection<Profile> profiles, IScopeContext instanceScope) throws CoreException { ByteArrayOutputStream stream= new ByteArrayOutputStream(2000); try { writeProfilesToStream(profiles, stream, ENCODING, fProfileVersioner); String val; try { val= stream.toString(ENCODING); } catch (UnsupportedEncodingException e) { val= stream.toString(); } IEclipsePreferences uiPreferences = instanceScope.getNode(JavaUI.ID_PLUGIN); uiPreferences.put(fProfilesKey, val); uiPreferences.putInt(fProfilesVersionKey, fProfileVersioner.getCurrentVersion()); } finally { try { stream.close(); } catch (IOException e) { /* ignore */ } } }
@Override protected void okPressed() { if (!getStatus().isOK()) return; JavaPlugin.getDefault().getDialogSettings().put(PREF_OPEN_EDIT_DIALOG, fOpenEditDialog); final Map<String, String> baseSettings= new HashMap<>(fSortedProfiles.get(fProfileCombo.getSelectionIndex()).getSettings()); final String profileName= fNameText.getText(); fCreatedProfile= new CustomProfile(profileName, baseSettings, fProfileVersioner.getCurrentVersion(), fProfileVersioner.getProfileKind()); fProfileManager.addProfile(fCreatedProfile); super.okPressed(); }
@Override protected void okPressed() { if (!getStatus().isOK()) return; JavaPlugin.getDefault().getDialogSettings().put(PREF_OPEN_EDIT_DIALOG, fOpenEditDialog); final Map<String, String> baseSettings= new HashMap<>(fSortedProfiles.get(fProfileCombo.getSelectionIndex()).getSettings()); final String profileName= fNameText.getText(); fCreatedProfile= new CustomProfile(profileName, baseSettings, fProfileVersioner.getCurrentVersion(), fProfileVersioner.getProfileKind()); fProfileManager.addProfile(fCreatedProfile); super.okPressed(); }
protected void okPressed() { if (!getStatus().isOK()) return; JavaPlugin.getDefault().getDialogSettings().put(PREF_OPEN_EDIT_DIALOG, fOpenEditDialog); final Map baseSettings= new HashMap(((Profile)fSortedProfiles.get(fProfileCombo.getSelectionIndex())).getSettings()); final String profileName= fNameText.getText(); fCreatedProfile= new CustomProfile(profileName, baseSettings, fProfileVersioner.getCurrentVersion(), fProfileVersioner.getProfileKind()); fProfileManager.addProfile(fCreatedProfile); super.okPressed(); }
if (version != fProfileVersioner.getCurrentVersion()) { Map allOptions= new HashMap(); for (int i= 0; i < fKeySets.length; i++) {
if (version != fProfileVersioner.getCurrentVersion()) { Map<String, String> allOptions= new HashMap<>(); for (int i= 0; i < fKeySets.length; i++) {
if (version != fProfileVersioner.getCurrentVersion()) { Map<String, String> allOptions= new HashMap<>(); for (int i= 0; i < fKeySets.length; i++) {
/** * Update all formatter settings with the settings of the specified profile. * @param profile The profile to write to the preference store */ private void writeToPreferenceStore(Profile profile, IScopeContext context) { final Map<String, String> profileOptions= profile.getSettings(); for (int i= 0; i < fKeySets.length; i++) { updatePreferences(context.getNode(fKeySets[i].getNodeName()), fKeySets[i].getKeys(), profileOptions); } final IEclipsePreferences uiPrefs= context.getNode(JavaUI.ID_PLUGIN); if (uiPrefs.getInt(fProfileVersionKey, 0) != fProfileVersioner.getCurrentVersion()) { uiPrefs.putInt(fProfileVersionKey, fProfileVersioner.getCurrentVersion()); } if (context.getName() == InstanceScope.SCOPE) { uiPrefs.put(fProfileKey, profile.getID()); } else if (context.getName() == ProjectScope.SCOPE && !profile.isSharedProfile()) { uiPrefs.put(fProfileKey, profile.getID()); } }
/** * Update all formatter settings with the settings of the specified profile. * @param profile The profile to write to the preference store */ private void writeToPreferenceStore(Profile profile, IScopeContext context) { final Map profileOptions= profile.getSettings(); for (int i= 0; i < fKeySets.length; i++) { updatePreferences(context.getNode(fKeySets[i].getNodeName()), fKeySets[i].getKeys(), profileOptions); } final IEclipsePreferences uiPrefs= context.getNode(JavaUI.ID_PLUGIN); if (uiPrefs.getInt(fProfileVersionKey, 0) != fProfileVersioner.getCurrentVersion()) { uiPrefs.putInt(fProfileVersionKey, fProfileVersioner.getCurrentVersion()); } if (context.getName() == InstanceScope.SCOPE) { uiPrefs.put(fProfileKey, profile.getID()); } else if (context.getName() == ProjectScope.SCOPE && !profile.isSharedProfile()) { uiPrefs.put(fProfileKey, profile.getID()); } }
/** * Update all formatter settings with the settings of the specified profile. * @param profile The profile to write to the preference store */ private void writeToPreferenceStore(Profile profile, IScopeContext context) { final Map<String, String> profileOptions= profile.getSettings(); for (int i= 0; i < fKeySets.length; i++) { updatePreferences(context.getNode(fKeySets[i].getNodeName()), fKeySets[i].getKeys(), profileOptions); } final IEclipsePreferences uiPrefs= context.getNode(JavaUI.ID_PLUGIN); if (uiPrefs.getInt(fProfileVersionKey, 0) != fProfileVersioner.getCurrentVersion()) { uiPrefs.putInt(fProfileVersionKey, fProfileVersioner.getCurrentVersion()); } if (context.getName() == InstanceScope.SCOPE) { uiPrefs.put(fProfileKey, profile.getID()); } else if (context.getName() == ProjectScope.SCOPE && !profile.isSharedProfile()) { uiPrefs.put(fProfileKey, profile.getID()); } }
if (profile.getVersion() > fProfileVersioner.getCurrentVersion()) { final String title= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_too_new_title; final String message= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_too_new_message;
if (profile.getVersion() > fProfileVersioner.getCurrentVersion()) { final String title= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_too_new_title; final String message= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_too_new_message;