Runtime

org.eclipse.gmf.runtime.common.ui.dialogs
Class ShowRelatedElementsPresetHelper

java.lang.Object
  extended byorg.eclipse.gmf.runtime.common.ui.dialogs.ShowRelatedElementsPresetHelper

public class ShowRelatedElementsPresetHelper
extends java.lang.Object

Show Related Elements Presets helper. Includes methods for serializing and deserializing and also a converter interface for the serializer and deserializer.


Nested Class Summary
static interface ShowRelatedElementsPresetHelper.IConversionMethods
          Methods for the serializer and deserializer which should be implemented to convert the serialized String into an object and to convert the object into a serialzed String.
 
Field Summary
static java.lang.String KEY_SEPARATOR
          Key separator for serialzing
static java.lang.String VALUE_SEPARATOR
          Value separator for serialzing
 
Method Summary
static java.lang.String[] convertPresetsToString(java.util.List presets, ShowRelatedElementsPresetHelper.IConversionMethods conversionMethod)
          Convert the presets to a string array used for serializing
static ShowRelatedElementsPreset findPresetFromList(java.util.List list, java.lang.String name)
          Convenience method to find a preset from the list.
static java.util.List readPresets(java.lang.String nameToIgnore, java.lang.String[] settings, ShowRelatedElementsPresetHelper.IConversionMethods conversionMethod)
          Return a list of ShowRelatedElementsPreset objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SEPARATOR

public static final java.lang.String KEY_SEPARATOR
Key separator for serialzing

See Also:
Constant Field Values

VALUE_SEPARATOR

public static final java.lang.String VALUE_SEPARATOR
Value separator for serialzing

See Also:
Constant Field Values
Method Detail

findPresetFromList

public static ShowRelatedElementsPreset findPresetFromList(java.util.List list,
                                                           java.lang.String name)
Convenience method to find a preset from the list.

Parameters:
list - List of ShowRelatedElementsPreset objects.
name - name to match
Returns:
the first matching ShowRelatedElementsPreset.

readPresets

public static java.util.List readPresets(java.lang.String nameToIgnore,
                                         java.lang.String[] settings,
                                         ShowRelatedElementsPresetHelper.IConversionMethods conversionMethod)
Return a list of ShowRelatedElementsPreset objects.

Parameters:
nameToIgnore - ignore this name when reading in the presets. Can be null if you do not want to ignore anything and read everything in.
settings - string array of settings
conversionMethod - see the IConversionMethods class above
Returns:
List of the presets. Items in the List are ShowRelatedElementsPreset objects

convertPresetsToString

public static java.lang.String[] convertPresetsToString(java.util.List presets,
                                                        ShowRelatedElementsPresetHelper.IConversionMethods conversionMethod)
Convert the presets to a string array used for serializing

Parameters:
presets - List of ShowRelatedElementsPresets objects
conversionMethod - see the IConversionMethods class above
Returns:
String array that contains the data of the presets

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.