*
* @return control panel.
*/
private JComponent buildControlPanel()
{
BBFormBuilder builder = new BBFormBuilder("5dlu, p, 5dlu");
builder.appendRelatedComponentsGapRow();
builder.setLeadingColumnOffset(1);
builder.nextLine();
// Grouping
Action actGroup = new AbstractAction()
{
private ActionLabel selection;
public void actionPerformed(ActionEvent e)
{
if (selection == e.getSource()) return;
if (selection != null) selection.setSelected(false);
onGroupingChange(e.getID());
selection = (ActionLabel)e.getSource();
}
};
ActionLabel albFlat = new ActionLabel(actGroup,
Strings.message("search.groupping.flat"), SearchResultsListModel.GROUP_FLAT);
ActionLabel albKind = new ActionLabel(actGroup,
Strings.message("search.groupping.kind"), SearchResultsListModel.GROUP_KIND);
ActionLabel albDate = new ActionLabel(actGroup,
Strings.message("search.groupping.date"), SearchResultsListModel.GROUP_DATE);
albKind.setSelected(true);
// Filtering
Action actFiltering = new AbstractAction()
{
private ActionLabel selection;
public void actionPerformed(ActionEvent e)
{
if (selection == e.getSource()) return;
if (selection != null) selection.setSelected(false);
onFilteringChange(e.getID());
selection = (ActionLabel)e.getSource();
}
};
ActionLabel albAnyDate = new ActionLabel(actFiltering,
Strings.message("search.when.any.date"),
ResultsList.DATE_ANY);
ActionLabel albToday = new ActionLabel(actFiltering,
Strings.message("search.when.today"),
ResultsList.DATE_TODAY);
ActionLabel albYesterday =new ActionLabel(actFiltering,
Strings.message("search.when.since.yesterday"),
ResultsList.DATE_YESTERDAY);
ActionLabel albThisWeek = new ActionLabel(actFiltering,
Strings.message("search.when.this.week"),
ResultsList.DATE_WEEK);
ActionLabel albThisMonth = new ActionLabel(actFiltering,
Strings.message("search.when.this.month"),
ResultsList.DATE_MONTH);
ActionLabel albThisYear = new ActionLabel(actFiltering,
Strings.message("search.when.this.year"),
ResultsList.DATE_YEAR);
albAnyDate.setSelected(true);
builder.append(smallLabel(Strings.message("search.groupping")));
builder.nextLine();
builder.append(albFlat);
builder.nextLine();
builder.append(albKind);
builder.nextLine();
builder.append(albDate);
// builder.nextLine();
builder.appendUnrelatedComponentsGapRow(2);
builder.setLeadingColumnOffset(0);
builder.append(new JLabel(), 3);
// builder.append(new JPopupMenu.Separator(), 3);
builder.setLeadingColumnOffset(1);
builder.append(smallLabel(Strings.message("search.when")));
builder.nextLine();
builder.append(albAnyDate);
builder.nextLine();
builder.append(albToday);
builder.nextLine();
builder.append(albYesterday);
builder.nextLine();
builder.append(albThisWeek);
builder.nextLine();
builder.append(albThisMonth);
builder.nextLine();
builder.append(albThisYear);
builder.nextLine();
return builder.getPanel();
}