private void initEvents() {
resetButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
for (Query query : filterModel.getQueries()) {
controller.remove(query);
}
// uiModel.setSelectedQuery(null);
controller.selectVisible(null);
controller.filterVisible(null);
((FiltersExplorer) libraryTree).setup(manager, filterModel, uiModel);
}
});
filterButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//selectButton.setSelected(false);
if (uiModel.getSelectedQuery() != null && filterButton.isSelected()) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.filterVisible(uiModel.getSelectedRoot());
} else {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.filterVisible(null);
}
}
});
selectButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//filterButton.setSelected(false);
if (uiModel.getSelectedQuery() != null && selectButton.isSelected()) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.selectVisible(uiModel.getSelectedRoot());
} else {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.selectVisible(null);
}
}
});
exportColumnButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (uiModel.getSelectedQuery() != null) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
NotifyDescriptor.InputLine question = new NotifyDescriptor.InputLine(
NbBundle.getMessage(FiltersPanel.class, "FiltersPanel.exportColumn.input"),
NbBundle.getMessage(FiltersPanel.class, "FiltersPanel.exportColumn.input.title"));
if (DialogDisplayer.getDefault().notify(question) == NotifyDescriptor.OK_OPTION) {
String input = question.getInputText();
if (input != null && !input.isEmpty()) {
controller.exportToColumn(input, uiModel.getSelectedRoot());
}
}
}
}
});
exportWorkspaceButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (uiModel.getSelectedQuery() != null) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.exportToNewWorkspace(uiModel.getSelectedRoot());
}
}
});
exportLabelVisible.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (uiModel.getSelectedQuery() != null) {
FilterController controller = Lookup.getDefault().lookup(FilterController.class);
controller.exportToLabelVisible(uiModel.getSelectedRoot());
}
}
});
/*autoRefreshButton.addActionListener(new ActionListener() {