private static Element createProfileElement(Profile profile, Document document, IProfileVersioner profileVersioner) { final Element element= document.createElement(XML_NODE_PROFILE); element.setAttribute(XML_ATTRIBUTE_NAME, profile.getName()); element.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profile.getVersion())); element.setAttribute(XML_ATTRIBUTE_PROFILE_KIND, profileVersioner.getProfileKind()); final Iterator<String> keyIter= profile.getSettings().keySet().iterator(); while (keyIter.hasNext()) { final String key= keyIter.next(); final String value= profile.getSettings().get(key); if (value != null) { final Element setting= document.createElement(XML_NODE_SETTING); setting.setAttribute(XML_ATTRIBUTE_ID, key); setting.setAttribute(XML_ATTRIBUTE_VALUE, value); element.appendChild(setting); } else { JavaPlugin.logErrorMessage("ProfileStore: Profile does not contain value for key " + key); //$NON-NLS-1$ } } return element; }
private static Element createProfileElement(Profile profile, Document document, IProfileVersioner profileVersioner) { final Element element= document.createElement(XML_NODE_PROFILE); element.setAttribute(XML_ATTRIBUTE_NAME, profile.getName()); element.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profile.getVersion())); element.setAttribute(XML_ATTRIBUTE_PROFILE_KIND, profileVersioner.getProfileKind()); final Iterator keyIter= profile.getSettings().keySet().iterator(); while (keyIter.hasNext()) { final String key= (String)keyIter.next(); final String value= (String)profile.getSettings().get(key); if (value != null) { final Element setting= document.createElement(XML_NODE_SETTING); setting.setAttribute(XML_ATTRIBUTE_ID, key); setting.setAttribute(XML_ATTRIBUTE_VALUE, value); element.appendChild(setting); } else { JavaPlugin.logErrorMessage("ProfileStore: Profile does not contain value for key " + key); //$NON-NLS-1$ } } return element; }
private static Element createProfileElement(Profile profile, Document document, IProfileVersioner profileVersioner) { final Element element= document.createElement(XML_NODE_PROFILE); element.setAttribute(XML_ATTRIBUTE_NAME, profile.getName()); element.setAttribute(XML_ATTRIBUTE_VERSION, Integer.toString(profile.getVersion())); element.setAttribute(XML_ATTRIBUTE_PROFILE_KIND, profileVersioner.getProfileKind()); final Iterator<String> keyIter= profile.getSettings().keySet().iterator(); while (keyIter.hasNext()) { final String key= keyIter.next(); final String value= profile.getSettings().get(key); if (value != null) { final Element setting= document.createElement(XML_NODE_SETTING); setting.setAttribute(XML_ATTRIBUTE_ID, key); setting.setAttribute(XML_ATTRIBUTE_VALUE, value); element.appendChild(setting); } else { JavaPlugin.logErrorMessage("ProfileStore: Profile does not contain value for key " + key); //$NON-NLS-1$ } } return element; }
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; }
@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(); }
SharedProfile shared= new SharedProfile(name, map, fProfileVersioner.getCurrentVersion(), fProfileVersioner.getProfileKind()); shared.setManager(this); fProfiles.put(shared.getID(), shared);
SharedProfile shared= new SharedProfile(name, map, fProfileVersioner.getCurrentVersion(), fProfileVersioner.getProfileKind()); shared.setManager(this); fProfiles.put(shared.getID(), shared);
addAll(context.getNode(fKeySets[i].getNodeName()), allOptions); CustomProfile profile= new CustomProfile("tmp", allOptions, version, fProfileVersioner.getProfileKind()); //$NON-NLS-1$ fProfileVersioner.update(profile); return profile.getSettings();
addAll(context.getNode(fKeySets[i].getNodeName()), allOptions); CustomProfile profile= new CustomProfile("tmp", allOptions, version, fProfileVersioner.getProfileKind()); //$NON-NLS-1$ fProfileVersioner.update(profile); return profile.getSettings();
addAll(context.getNode(fKeySets[i].getNodeName()), allOptions); CustomProfile profile= new CustomProfile("tmp", allOptions, version, fProfileVersioner.getProfileKind()); //$NON-NLS-1$ fProfileVersioner.update(profile); return profile.getSettings();
private void saveButtonPressed() { Profile selected= new CustomProfile(fProfileNameField.getText(), new HashMap(fWorkingValues), fProfile.getVersion(), fProfileManager.getProfileVersioner().getProfileKind());
private void saveButtonPressed() { Profile selected= new CustomProfile(fProfileNameField.getText(), new HashMap<>(fWorkingValues), fProfile.getVersion(), fProfileManager.getProfileVersioner().getProfileKind());
private void saveButtonPressed() { Profile selected= new CustomProfile(fProfileNameField.getText(), new HashMap<>(fWorkingValues), fProfile.getVersion(), fProfileManager.getProfileVersioner().getProfileKind());
final CustomProfile profile= (CustomProfile)iter.next(); if (!fProfileVersioner.getProfileKind().equals(profile.getKind())) { final String title= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_title; final String message= Messages.format(FormatterMessages.ProfileConfigurationBlock_load_profile_wrong_profile_message, new String[] { fProfileVersioner.getProfileKind(), profile.getKind() }); MessageDialog.openError(fComposite.getShell(), title, message);
final CustomProfile profile= (CustomProfile)iter.next(); if (!fProfileVersioner.getProfileKind().equals(profile.getKind())) { final String title= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_title; final String message= Messages.format(FormatterMessages.ProfileConfigurationBlock_load_profile_wrong_profile_message, new String[] { fProfileVersioner.getProfileKind(), profile.getKind() }); MessageDialog.openError(fComposite.getShell(), title, message);
if (!fProfileVersioner.getProfileKind().equals(profile.getKind())) { final String title= FormatterMessages.CodingStyleConfigurationBlock_load_profile_error_title; final String message= Messages.format(FormatterMessages.ProfileConfigurationBlock_load_profile_wrong_profile_message, new String[] {fProfileVersioner.getProfileKind(), profile.getKind()}); MessageDialog.openError(fComposite.getShell(), title, message); return;