if (stringPattern instanceof RegexStringPattern) {
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
RegexStringPatternDialog dialog = new RegexStringPatternDialog((RegexStringPattern) stringPattern,
_catalog, _windowContext);
dialog.setVisible(true);
}
});
} else if (stringPattern instanceof SimpleStringPattern) {
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
SimpleStringPatternDialog dialog = new SimpleStringPatternDialog(
(SimpleStringPattern) stringPattern, _catalog, _windowContext);
dialog.setVisible(true);
}
});
} else {
editButton.setEnabled(false);
}