Class EclipseJavaFormatterSettings
java.lang.Object
de.funfried.netbeans.plugins.external.formatter.java.eclipse.EclipseJavaFormatterSettings
Utility class for Eclipse specific settings.
- Author:
- bahlef
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Property key which defines the active profile of the Eclipse configuration file.static final String
Property key which defines the location of the Eclipse formatter configuration file.static final String
Property key which defines the line feed setting for the Eclipse formatter.static final String
Constant value of the Eclipse project specific formatter configuration file name.static final String
Property key which defines the source level setting for the Eclipse formatter.static final String
Property key which defines whether or not to use Eclipse project specific formatter configuration if available. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getEclipseFormatterFile
(Preferences preferences, Document document) Returns the Eclipse formatter file for the givenDocument
from the givenPreferences
.static boolean
isProjectSetting
(String filename) Returnstrue
if the givenfilename
ends withorg.eclipse.jdt.core.prefs
.static boolean
isWorkspaceMechanicFile
(String filename) Returnstrue
if the givenfilename
ends with the workspace mechanic file extension epf.static boolean
isXMLConfigurationFile
(String filename) Returnstrue
if the givenfilename
ends with the XML file extension.
-
Field Details
-
ACTIVE_PROFILE
Property key which defines the active profile of the Eclipse configuration file.- See Also:
-
CONFIG_FILE_LOCATION
Property key which defines the location of the Eclipse formatter configuration file.- See Also:
-
USE_PROJECT_PREFS
Property key which defines whether or not to use Eclipse project specific formatter configuration if available.- Since:
- 1.10
- See Also:
-
PROJECT_PREF_FILE
Constant value of the Eclipse project specific formatter configuration file name.- Since:
- 1.10
- See Also:
-
LINEFEED
Property key which defines the line feed setting for the Eclipse formatter.- Since:
- 1.10
- See Also:
-
SOURCELEVEL
Property key which defines the source level setting for the Eclipse formatter.- Since:
- 1.10
- See Also:
-
-
Method Details
-
getEclipseFormatterFile
Returns the Eclipse formatter file for the givenDocument
from the givenPreferences
. IfUSE_PROJECT_PREFS
istrue
in the givenPreferences
, it will be automatically checked if there is a project specific formatter configuration file available.- Parameters:
preferences
- thePreferences
where to load fromdocument
- theDocument
- Returns:
- the Eclipse formatter file for the given
Document
from the givenPreferences
. IfUSE_PROJECT_PREFS
istrue
in the givenPreferences
, it will be automatically checked if there is a project specific formatter configuration file available
-
isWorkspaceMechanicFile
Returnstrue
if the givenfilename
ends with the workspace mechanic file extension epf.- Parameters:
filename
- the filename to check- Returns:
true
if the givenfilename
ends with the workspace mechanic file extension epf, otherwisefalse
-
isXMLConfigurationFile
Returnstrue
if the givenfilename
ends with the XML file extension.- Parameters:
filename
- the filename to check- Returns:
true
if the givenfilename
ends with the XML file extension, otherwisefalse
-
isProjectSetting
Returnstrue
if the givenfilename
ends withorg.eclipse.jdt.core.prefs
.- Parameters:
filename
- the filename to check- Returns:
true
if the givenfilename
ends withorg.eclipse.jdt.core.prefs
, otherwisefalse
-