/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
public void actionPerformed(ActionEvent e) {
JTextPane localTextPane = textPane;
if (localTextPane == null) {
JTextComponent textComponent = getTextComponent(e);
if (textComponent instanceof JTextPane) {
localTextPane = (JTextPane) textComponent;
}
}
Element localElement = element;
if ((localTextPane != null) && (localElement == null)) {
localElement = localTextPane.getStyledDocument().getCharacterElement(
localTextPane.getSelectionStart());
}
String value = null;
String[] tmpPossibleValues = null;
if ((possibleValues != null) && (possibleValues.length > 0)) {
tmpPossibleValues = possibleValues;
}
if (textProvider != null) {
Collection<String> texts = textProvider.getTexts();
if ((texts != null) && (texts.size() > 0)) {
value = texts.iterator().next();
if (tmpPossibleValues == null) {
tmpPossibleValues = new String[texts.size()];
tmpPossibleValues = texts.toArray(tmpPossibleValues);
}
}
}
if (value == null) {
value = defaultValue;
}
if (tmpPossibleValues != null) {
value = Utilities.askForValue(
(localTextPane != null) ? localTextPane.getParent() : null,
question,
tmpPossibleValues, onlyList, value, checker);
} else {
value = Utilities.askForValue(
(localTextPane != null) ? localTextPane.getParent() : null,
question, value, checker);
}
if ((value != null) && (!value.isEmpty())) {
StringBuilder newText = new StringBuilder();
if (prefix != null) {