Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes

de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences Class Reference

this class realize the axbench files preferences handle. One instance for one eclipse session. More...

List of all members.

Public Types

enum  FilePreferencesTypes { SIMPLE_PREFERENCES = ( "SIMPLE_PREFERENCES" ) }
 

this enum class defines the possible preferences types.

More...
enum  SimpleFilePreferences { AUTHORKEY = ( new QualifiedName( "Author", "mainauthor" ), true, true, Text.class, false ), VERSION = ( new QualifiedName( "Version", "0.8.0" ), true, false, Text.class, false ), FILESIZE = ( new QualifiedName( "Size", "-1" ), true, false, Text.class, true ) }
 

this enum class defines the simple file preferences, which are saved inside the simpleFilePreferences map and are displayed by the general tab propertie. -->new QualifiedName(qualifier,default value), this is saved inside the preferences file

More...

Public Member Functions

Object getSimpleFilePreferencesValue (IFile file, QualifiedName name)
void initializeDefaultPreferences (IProject project, FilePreferencesTypes type)
 reads in all axl files from the project and initialize the default values.
void initializeDefaultPreferencesForFile (IFile file, FilePreferencesTypes type)
 initialize the file preferences for one file with the default values.
boolean readInFilesPreferencesFromProject (IProject project, IFile searchedfile)
 reads in all preferences for the specified file, if the project don't have a preferencesFile this method will create a default one and save it. If the searchedfile isn't inside the (currently) simpleFilesPreferences map default values will be established and the preferences will be saved.
boolean saveFilePreferences (IProject project)
 saves the file preferences. 1.project name -------------- 2.SIMPLE_PREFERENCES 3.file relative path 4.content ++++++++++++++ 5.file releative path 6.type 7. ....
boolean setSimpleFilePreferencesValue (IFile file, QualifiedName qualifier, Object value)
 to set a value inside the file preferences key.

Static Public Member Functions

static AXBenchFilesPreferences getInstance ()

Static Public Attributes

static int modi = 1
static final String preferencesFileName = "de.fraunhofer.isst.axbench.axbenchfiles.prefs"
 the file where all preferences of all axbench files inside workspace will be saved

Private Member Functions

void correctOldProblems (IFile searchedfile)
 this method realizes the correction of old errors and new file preferences. (relevant for files where the filepref. already exists)
void deleteFilePreferencesFile (IProject project)
 deletes the file preferences file.
String getFilePreferencesPath (IProject project)
void lookForFileAndHandle (IProject project)
 checks if the file exists, if not it creates the folder and the file.

Static Private Attributes

static AXBenchFilesPreferences axBenchFilesPreferencesInstance = null
static LinkedHashMap< IFile,
LinkedHashMap< QualifiedName,
Object > > 
simpleFilesPreferences = null

Detailed Description

this class realize the axbench files preferences handle. One instance for one eclipse session.

Author:
skaegebein
Version:
0.9.0
Since:
0.9.0

Member Enumeration Documentation

this enum class defines the possible preferences types.

Author:
skaegebein
Version:
0.9.0
Since:
0.9.0
Enumerator:
SIMPLE_PREFERENCES 

this preferences will be saved as an ArrayList<QualifiedName>

this enum class defines the simple file preferences, which are saved inside the simpleFilePreferences map and are displayed by the general tab propertie. -->new QualifiedName(qualifier,default value), this is saved inside the preferences file

Author:
skaegebein
Version:
0.9.0
Since:
0.9.0
Enumerator:
AUTHORKEY 

qualifier for the author name

VERSION 

qualifier for the axbench version

FILESIZE 

qualifier for the actual file size (dynamic!)


Member Function Documentation

void de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.correctOldProblems ( IFile  searchedfile  )  [private]

this method realizes the correction of old errors and new file preferences. (relevant for files where the filepref. already exists)

void de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.deleteFilePreferencesFile ( IProject  project  )  [private]

deletes the file preferences file.

String de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.getFilePreferencesPath ( IProject  project  )  [private]
Parameters:
file 
Returns:
the file preference path
static AXBenchFilesPreferences de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.getInstance (  )  [static]
Returns:
the instance
Object de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.getSimpleFilePreferencesValue ( IFile  file,
QualifiedName  name 
)
Parameters:
file 
name 
Returns:
the value of the defined QualifiedName or null if it doesn't exists
void de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.initializeDefaultPreferences ( IProject  project,
FilePreferencesTypes  type 
)

reads in all axl files from the project and initialize the default values.

Parameters:
file 
type 
void de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.initializeDefaultPreferencesForFile ( IFile  file,
FilePreferencesTypes  type 
)

initialize the file preferences for one file with the default values.

Parameters:
file 
type 
void de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.lookForFileAndHandle ( IProject  project  )  [private]

checks if the file exists, if not it creates the folder and the file.

Parameters:
file 
boolean de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.readInFilesPreferencesFromProject ( IProject  project,
IFile  searchedfile 
)

reads in all preferences for the specified file, if the project don't have a preferencesFile this method will create a default one and save it. If the searchedfile isn't inside the (currently) simpleFilesPreferences map default values will be established and the preferences will be saved.

Parameters:
file 
searchedfile 

< later it has to be removed!

boolean de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.saveFilePreferences ( IProject  project  ) 

saves the file preferences. 1.project name -------------- 2.SIMPLE_PREFERENCES 3.file relative path 4.content ++++++++++++++ 5.file releative path 6.type 7. ....

Parameters:
file 
Returns:
boolean de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.setSimpleFilePreferencesValue ( IFile  file,
QualifiedName  qualifier,
Object  value 
)

to set a value inside the file preferences key.

Parameters:
file 
qualifier e.g. SimpleFilePreferences.AUTHORKEY.getQualifier()
value 
Returns:

Member Data Documentation

0 - changes are saved immediately after a value was manipulated 1 - changes are saved by clicking the confirm button

final String de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.preferencesFileName = "de.fraunhofer.isst.axbench.axbenchfiles.prefs" [static]

the file where all preferences of all axbench files inside workspace will be saved

LinkedHashMap<IFile, LinkedHashMap<QualifiedName, Object> > de.fraunhofer.isst.axbench.utilities.AXBenchFilesPreferences.simpleFilesPreferences = null [static, private]