Search in sources :

Example 96 with IPreferencesService

use of org.eclipse.core.runtime.preferences.IPreferencesService in project titan.EclipsePlug-ins by eclipse.

the class LicenseValidator method getResolvedLicenseFilePath.

/**
 * Calculates and returns the path of the license file resolved to be
 * directly usable in the actual environment.
 *
 * @param force
 *                weather to update the value if it already exist or
 *                not.
 * @return the resolved license file path
 */
public static String getResolvedLicenseFilePath(final boolean force) {
    if (!License.isLicenseNeeded()) {
        return "";
    }
    final IPreferencesService preferenceService = Platform.getPreferencesService();
    final boolean reportDebugInformation = preferenceService.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, false, null);
    if (force || resolvedLicenseFilePath.length() == 0) {
        final String licensePath = preferenceService.getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.LICENSE_FILE_PATH, "", null);
        resolvedLicenseFilePath = PathConverter.convert(licensePath, reportDebugInformation, TITANDebugConsole.getConsole());
    }
    return resolvedLicenseFilePath;
}
Also used : IPreferencesService(org.eclipse.core.runtime.preferences.IPreferencesService)

Aggregations

IPreferencesService (org.eclipse.core.runtime.preferences.IPreferencesService)96 IFile (org.eclipse.core.resources.IFile)26 ArrayList (java.util.ArrayList)15 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)15 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)14 IProject (org.eclipse.core.resources.IProject)13 CoreException (org.eclipse.core.runtime.CoreException)13 Module (org.eclipse.titan.designer.AST.Module)11 ProjectSourceParser (org.eclipse.titan.designer.parsers.ProjectSourceParser)11 List (java.util.List)10 File (java.io.File)8 TextSelection (org.eclipse.jface.text.TextSelection)8 Path (org.eclipse.core.runtime.Path)6 IContainer (org.eclipse.core.resources.IContainer)5 IMarker (org.eclipse.core.resources.IMarker)5 IPath (org.eclipse.core.runtime.IPath)5 SubMonitor (org.eclipse.core.runtime.SubMonitor)5 RefactoringStatus (org.eclipse.ltk.core.refactoring.RefactoringStatus)5 IOException (java.io.IOException)4 IStatus (org.eclipse.core.runtime.IStatus)4