if (dictionary instanceof DatastoreDictionary) {
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Injector injector = _injectorBuilder.with(DatastoreDictionary.class, dictionary).createInjector();
DatastoreDictionaryDialog dialog = injector.getInstance(DatastoreDictionaryDialog.class);
dialog.open();
}
});
} else if (dictionary instanceof TextFileDictionary) {
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Injector injector = _injectorBuilder.with(TextFileDictionary.class, dictionary).createInjector();
TextFileDictionaryDialog dialog = injector.getInstance(TextFileDictionaryDialog.class);
dialog.open();
}
});
} else if (dictionary instanceof SimpleDictionary) {
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Injector injector = _injectorBuilder.with(SimpleDictionary.class, dictionary).createInjector();
SimpleDictionaryDialog dialog = injector.getInstance(SimpleDictionaryDialog.class);
dialog.open();
}
});
} else {
editButton.setEnabled(false);
}