Skip to content
Snippets Groups Projects
Commit 776b908c authored by brinn's avatar brinn
Browse files

[BIS-149/SP-237] Display settings for custom web UIs.

Replace DisplaySettings.clone() by a copy constructor as GWT cannot cope with clone().

SVN: 26346
parent 274a1a60
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ public class DisplaySettingsProvider
settings = person.getDisplaySettings();
displaySettingsMap.put(person.getUserId(), settings);
}
settings = settings.clone();
settings = new DisplaySettings(settings);
settings.clearCustomWebAppSettings();
return settings;
}
......
......@@ -34,10 +34,14 @@ import java.util.Map;
*
* @author Franz-Josef Elmer
*/
public class DisplaySettings implements Serializable, Cloneable
public class DisplaySettings implements Serializable
{
private static final long serialVersionUID = 1L;
//
// NOTE: if you add new fields to this class, you also need to add it to the copy constructor!
//
private Map<String, List<ColumnSetting>> columnSettings =
new HashMap<String, List<ColumnSetting>>();
......@@ -74,6 +78,31 @@ public class DisplaySettings implements Serializable, Cloneable
private Map<String, Map<String, String>> customWebAppDisplaySettings;
public DisplaySettings()
{
}
/**
* Copy constructor (shallow copy).
*/
public DisplaySettings(DisplaySettings other)
{
this.columnSettings = other.columnSettings;
this.technologySpecificSettings = other.technologySpecificSettings;
this.tabSettings = other.tabSettings;
this.dropDownSettings = other.dropDownSettings;
this.useWildcardSearchMode = other.useWildcardSearchMode;
this.debugging = other.debugging;
this.lastHistoryTokenOrNull = other.lastHistoryTokenOrNull;
this.ignoreLastHistoryToken = other.ignoreLastHistoryToken;
this.realNumberFormatingParameters = other.realNumberFormatingParameters;
this.panelCollapsedSettings = other.panelCollapsedSettings;
this.panelSizeSettings = other.panelSizeSettings;
this.visits = other.visits;
this.portletConfigurations = other.portletConfigurations;
this.customWebAppDisplaySettings = other.customWebAppDisplaySettings;
}
/** @deprecated Should be used only by DisplaySettingsManager. */
@Deprecated
public Map<String, Serializable> getTechnologySpecificSettings()
......@@ -357,15 +386,4 @@ public class DisplaySettings implements Serializable, Cloneable
customWebAppDisplaySettings = null;
}
@Override
public DisplaySettings clone()
{
try
{
return (DisplaySettings) super.clone();
} catch (CloneNotSupportedException ex)
{
throw new Error(ex);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment