Package org.eclipse.ui.internal
Class LargeFileLimitsPreferenceHandler
java.lang.Object
org.eclipse.ui.internal.LargeFileLimitsPreferenceHandler
Parses the preference that specifies which editor should be used when opening a large file.
See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=577289-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An editor and file size pair.static class
static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Identifier of the preference page that allows the user to view and set file limit associations.static final String
Value of the preference that indicates a dialog should prompt the user to choose an editor, with which to open the large document. -
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
dispose()
static String[]
static long
static String[]
getEditorForInput
(IEditorInput editorInput) getFileLimitsForExtension
(String fileExtension) getLargeFilePreferenceValues
(String fileExtension) static boolean
static boolean
static boolean
isPromptPreferenceValue
(String editorId) static void
removeFileLimitsForExtension
(String fileExtension) static void
static void
setConfiguredExtensionTypes
(String[] extensionTypes) static void
setDefaultLimit
(long fileSize) static void
static void
setDisabledExtensionTypes
(String[] extensionTypes) static void
setFileLimitsForExtension
(String fileExtension, List<LargeFileLimitsPreferenceHandler.FileLimit> fileLimits)
-
Field Details
-
PROMPT_EDITOR_PREFERENCE_VALUE
Value of the preference that indicates a dialog should prompt the user to choose an editor, with which to open the large document.- See Also:
-
LARGE_FILE_ASSOCIATIONS_PREFERENCE_PAGE_ID
Identifier of the preference page that allows the user to view and set file limit associations.- See Also:
-
-
Constructor Details
-
LargeFileLimitsPreferenceHandler
public LargeFileLimitsPreferenceHandler() -
LargeFileLimitsPreferenceHandler
public LargeFileLimitsPreferenceHandler(LargeFileLimitsPreferenceHandler.PromptForEditor promptForEditor)
-
-
Method Details
-
dispose
public void dispose() -
setDefaults
public static void setDefaults() -
restoreDefaults
public static void restoreDefaults() -
isLargeDocumentLegacyPreferenceSet
public static boolean isLargeDocumentLegacyPreferenceSet() -
getDefaultLimit
public static long getDefaultLimit() -
isDefaultLimitEnabled
public static boolean isDefaultLimitEnabled() -
setDefaultLimit
public static void setDefaultLimit(long fileSize) -
disableDefaultLimit
public static void disableDefaultLimit() -
getConfiguredExtensionTypes
-
setConfiguredExtensionTypes
-
getDisabledExtensionTypes
-
setDisabledExtensionTypes
-
getFileLimitsForExtension
public static List<LargeFileLimitsPreferenceHandler.FileLimit> getFileLimitsForExtension(String fileExtension) -
removeFileLimitsForExtension
-
setFileLimitsForExtension
public static void setFileLimitsForExtension(String fileExtension, List<LargeFileLimitsPreferenceHandler.FileLimit> fileLimits) -
isPromptPreferenceValue
-
getEditorForInput
- Parameters:
editorInput
- the input for which to check- Returns:
null
if the user was prompted and didn't select an editor, empty optional if no preference is set to indicate an editor for large documents, or the editor ID specified by the preference or user for the given document type
-
getLargeFilePreferenceValues
public static List<LargeFileLimitsPreferenceHandler.FileLimit> getLargeFilePreferenceValues(String fileExtension)
-