|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.modules.gui.commonswing.EncodingComboBoxModel
public class EncodingComboBoxModel
A model for the 'encoding' combo box. This combobox model presents a selection for all available string encodings.
Field Summary | |
---|---|
static String |
AVAILABLE_ENCODINGS
The property that defines which encodings are available in the export dialogs. |
static String |
AVAILABLE_ENCODINGS_ALL
The encodings available properties value for all properties. |
static String |
AVAILABLE_ENCODINGS_FILE
The encodings available properties value for properties defined in the properties file. |
static String |
AVAILABLE_ENCODINGS_NONE
The encodings available properties value for no properties defined. |
static String |
BUNDLE_NAME
|
static String |
ENCODINGS_DEFINITION_FILE
The name of the properties file used to define the available encodings. |
static String |
ENCODINGS_DEFINITION_FILE_DEFAULT
The default name for the encoding properties file. |
Constructor Summary | |
---|---|
EncodingComboBoxModel(Locale locale)
Creates a new model. |
Method Summary | |
---|---|
boolean |
addEncoding(String name,
String description)
Adds an encoding. |
void |
addEncodingUnchecked(String name,
String description)
Adds an encoding to the model without checking its validity. |
void |
addListDataListener(ListDataListener l)
Adds a listener to the list that's notified each time a change to the data model occurs. |
static EncodingComboBoxModel |
createDefaultModel(Locale locale)
Creates a default model containing a selection of encodings. |
static EncodingComboBoxModel |
createDefaultModel(Locale locale,
boolean includeNull)
|
void |
ensureEncodingAvailable(String encoding)
Make sure, that this encoding is defined and selectable in the combobox model. |
static String |
getAvailableEncodings()
Defines the loader settings for the available encodings shown to the user. |
String |
getDescription(int index)
Returns a description. |
Object |
getElementAt(int index)
Returns the value at the specified index. |
String |
getEncoding(int index)
Returns an encoding. |
static String |
getEncodingsDefinitionFile()
Defines the loader settings for the available encodings shown to the user. |
String |
getSelectedEncoding()
Returns the selected encoding. |
int |
getSelectedIndex()
Returns the selected index. |
Object |
getSelectedItem()
Returns the selected item. |
int |
getSize()
Returns the length of the list. |
int |
indexOf(String encoding)
Returns the index of an encoding. |
void |
removeEncoding(String name)
|
void |
removeListDataListener(ListDataListener l)
Removes a listener from the list that's notified each time a change to the data model occurs. |
void |
setSelectedEncoding(String encoding)
|
void |
setSelectedIndex(int index)
Defines the selected index for this encoding model. |
void |
setSelectedItem(Object anItem)
Set the selected item. |
void |
sort()
Sorts the encodings. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String AVAILABLE_ENCODINGS
public static final String AVAILABLE_ENCODINGS_ALL
public static final String AVAILABLE_ENCODINGS_FILE
public static final String AVAILABLE_ENCODINGS_NONE
public static final String ENCODINGS_DEFINITION_FILE
public static final String ENCODINGS_DEFINITION_FILE_DEFAULT
public static final String BUNDLE_NAME
Constructor Detail |
---|
public EncodingComboBoxModel(Locale locale)
locale
- Method Detail |
---|
public boolean addEncoding(String name, String description)
name
- the name.description
- the description.
true
if the encoding is valid and added to the model, false
otherwise.public void addEncodingUnchecked(String name, String description)
name
- the name.description
- the description.public void removeEncoding(String name)
public void ensureEncodingAvailable(String encoding)
encoding
- the encoding that should be verified.public void sort()
public void setSelectedItem(Object anItem)
ListDataListener
s that the contents have changed.
setSelectedItem
in interface ComboBoxModel
anItem
- the list object to select or null
to clear the selectionpublic int getSelectedIndex()
public void setSelectedIndex(int index)
index
- the selected index or -1 to clear the selection.
IllegalArgumentException
- if the given index is invalid.public String getSelectedEncoding()
public Object getSelectedItem()
getSelectedItem
in interface ComboBoxModel
null
if there is no selectionpublic int getSize()
getSize
in interface ListModel
public Object getElementAt(int index)
getElementAt
in interface ListModel
index
- the requested index
index
public void addListDataListener(ListDataListener l)
addListDataListener
in interface ListModel
l
- the ListDataListener
to be addedpublic void removeListDataListener(ListDataListener l)
removeListDataListener
in interface ListModel
l
- the ListDataListener
to be removedpublic static EncodingComboBoxModel createDefaultModel(Locale locale)
public static EncodingComboBoxModel createDefaultModel(Locale locale, boolean includeNull)
public int indexOf(String encoding)
encoding
- the encoding (name).
public String getEncoding(int index)
index
- the index.
public String getDescription(int index)
index
- the index.
public static String getEncodingsDefinitionFile()
public static String getAvailableEncodings()
public void setSelectedEncoding(String encoding)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |