mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-157844 Json Settings: com.intellij:app:DateTimeFormatter
GitOrigin-RevId: 8d69c25b84650c80311d1e1abbcd662db590bed2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
414364dec1
commit
ebf4e95153
@@ -1,17 +1,14 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.util.text;
|
||||
|
||||
import com.intellij.configurationStore.XmlSerializer;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.SettingsCategory;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -19,7 +16,7 @@ import java.time.format.DateTimeFormatter;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@State(name = "DateTimeFormatter", storages = @Storage("ui-datetime.xml"), category = SettingsCategory.SYSTEM)
|
||||
public final class DateTimeFormatManager implements PersistentStateComponent<Element> {
|
||||
public final class DateTimeFormatManager implements PersistentStateComponent<DateTimeFormatManager> {
|
||||
private static final String DEFAULT_DATE_FORMAT = "dd MMM yyyy";
|
||||
|
||||
private boolean myOverrideSystemDateFormat = false;
|
||||
@@ -28,14 +25,13 @@ public final class DateTimeFormatManager implements PersistentStateComponent<Ele
|
||||
private boolean myPrettyFormattingAllowed = true;
|
||||
|
||||
@Override
|
||||
public @Nullable Element getState() {
|
||||
return XmlSerializer.serialize(this);
|
||||
public DateTimeFormatManager getState() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadState(@NotNull Element state) {
|
||||
var loaded = XmlSerializer.deserialize(state, DateTimeFormatManager.class);
|
||||
XmlSerializerUtil.copyBean(loaded, this);
|
||||
public void loadState(@NotNull DateTimeFormatManager state) {
|
||||
XmlSerializerUtil.copyBean(state, this);
|
||||
resetFormats();
|
||||
}
|
||||
|
||||
|
||||
@@ -7719,7 +7719,29 @@
|
||||
"scope": "app",
|
||||
"pluginId": "com.intellij",
|
||||
"classFqn": "com.intellij.util.text.DateTimeFormatManager",
|
||||
"storage": "ui-datetime.xml"
|
||||
"storage": "ui-datetime.xml",
|
||||
"properties": [
|
||||
{
|
||||
"name": "dateFormatPattern",
|
||||
"type": "String",
|
||||
"javaType": "java.lang.String"
|
||||
},
|
||||
{
|
||||
"name": "overrideSystemDateFormat",
|
||||
"type": "Boolean",
|
||||
"javaType": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "prettyFormattingAllowed",
|
||||
"type": "Boolean",
|
||||
"javaType": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "use24HourTime",
|
||||
"type": "Boolean",
|
||||
"javaType": "boolean"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Vcs.Log.Big.Repositories",
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
"com.intellij.database:app:SqlFoldingSettings.*",
|
||||
"com.intellij:app:BaseRefactoringSettings.*",
|
||||
"com.intellij:app:ConsoleFoldingSettings.*",
|
||||
"com.intellij:app:DateTimeFormatter.*",
|
||||
"com.intellij:app:EditorSettings.custom_soft_wrap_indent",
|
||||
"com.intellij:app:EditorSettings.insert_parentheses_automatically",
|
||||
"com.intellij:app:EditorSettings.is_ensure_newline_at_eof",
|
||||
|
||||
Reference in New Issue
Block a user