public RenameAction() {
super(NbBundle.getMessage(QueryNode.class, "QueryNode.actions.rename"));
}
public void actionPerformed(ActionEvent e) {
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
NotifyDescriptor.InputLine question = new NotifyDescriptor.InputLine(
NbBundle.getMessage(QueryNode.class, "QueryNode.actions.rename.text"),
NbBundle.getMessage(QueryNode.class, "QueryNode.actions.rename.title"));
question.setInputText(query.getName());
if (DialogDisplayer.getDefault().notify(question) == NotifyDescriptor.OK_OPTION) {
String input = question.getInputText();
if (input != null && !input.isEmpty()) {
filterController.rename(query, input);
}
}
}