Package net.infonode.docking.util
Class StringViewMap
java.lang.Object
net.infonode.docking.util.AbstractViewMap
net.infonode.docking.util.StringViewMap
- All Implemented Interfaces:
ViewFactoryManager
,ViewSerializer
A map of views that handles view serialization by assigning a string id to each view.
The id is unique for each view in the map. To guarantee serialization compatibility a view id must remain constant.
- Since:
- IDW 1.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.StringViewMap
(View[] views) Utility constructor that creates a map with a number of views. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a view to the map.void
Adds a view to the map.Returns the view with a specific id.protected Object
void
removeView
(String id) Removes a view with a specific id from the map.protected void
writeViewId
(Object id, ObjectOutputStream out) Methods inherited from class net.infonode.docking.util.AbstractViewMap
addView, contains, getView, getViewAtIndex, getViewCount, getViewFactories, readView, removeView, writeView
-
Constructor Details
-
StringViewMap
public StringViewMap()Constructor. -
StringViewMap
Utility constructor that creates a map with a number of views. A view gets it's title as id.- Parameters:
views
- the views to add to the map
-
-
Method Details
-
addView
Adds a view to the map. The view title is used as id.- Parameters:
view
- the view
-
addView
Adds a view to the map.- Parameters:
id
- the view idview
- the view
-
removeView
Removes a view with a specific id from the map.- Parameters:
id
- the view id
-
getView
Returns the view with a specific id.- Parameters:
id
- the view id- Returns:
- the view with the id
-
writeViewId
- Specified by:
writeViewId
in classAbstractViewMap
- Throws:
IOException
-
readViewId
- Specified by:
readViewId
in classAbstractViewMap
- Throws:
IOException
-