Example usage for org.springframework.ide.eclipse.core SpringCorePreferences putString

List of usage examples for org.springframework.ide.eclipse.core SpringCorePreferences putString

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.core SpringCorePreferences putString.

Prototype

public void putString(String key, String value) 

Source Link

Usage

From source file:org.eclipse.virgo.ide.jdt.internal.core.util.ClasspathUtils.java

/**
 * Stores the configured source attachments paths in the projects settings area.
 * @param project the java project to store the preferences for
 * @param containerSuggestion the configured classpath container entries
 *///from www.  j  a v a  2s .  c o  m
public static void storeSourceAttachments(IJavaProject project, IClasspathContainer containerSuggestion) {
    SpringCorePreferences prefs = SpringCorePreferences.getProjectPreferences(project.getProject(),
            JdtCorePlugin.PLUGIN_ID);
    for (IClasspathEntry entry : containerSuggestion.getClasspathEntries()) {
        IPath path = entry.getPath();
        IPath sourcePath = entry.getSourceAttachmentPath();
        if (sourcePath != null) {
            prefs.putString("source.attachment-" + path.lastSegment().toString(), sourcePath.toString());
        }
    }
}