Skip to content
Snippets Groups Projects
Commit dd8668d4 authored by Ondřej Hrdlička's avatar Ondřej Hrdlička
Browse files

Revert "Removed statistics filtering from toolbar"

This reverts commit f39fc17e.
parent 894f94e8
No related branches found
No related tags found
2 merge requests!52Final project MR,!45Activating most of the app
Pipeline #
package cz.muni.fi.pv168.project.ui.main.toolbar; package cz.muni.fi.pv168.project.ui.main.toolbar;
import cz.muni.fi.pv168.project.ui.action.TabActions; import cz.muni.fi.pv168.project.ui.action.TabActions;
import org.jdatepicker.JDatePicker;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.Box;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JToolBar; import javax.swing.JToolBar;
import java.awt.Font; import java.awt.Font;
import java.awt.event.ActionListener;
public class CategoriesStatisticsToolBar { public class CategoriesStatisticsToolBar {
private final JToolBar toolbar; private final JToolBar toolbar;
private final JDatePicker showStatisticsFrom;
private final JDatePicker showStatisticsTo;
public CategoriesStatisticsToolBar(TabActions tabActions) { public CategoriesStatisticsToolBar(TabActions tabActions) {
toolbar = new JToolBar(JToolBar.HORIZONTAL); toolbar = new JToolBar(JToolBar.HORIZONTAL);
toolbar.setFloatable(false); toolbar.setFloatable(false);
showStatisticsFrom = new JDatePicker();
showStatisticsTo = new JDatePicker();
JLabel fromText = new JLabel("From"); JLabel fromText = new JLabel("From");
fromText.setFont(fromText.getFont().deriveFont(Font.BOLD)); fromText.setFont(fromText.getFont().deriveFont(Font.BOLD));
...@@ -24,9 +33,26 @@ public class CategoriesStatisticsToolBar { ...@@ -24,9 +33,26 @@ public class CategoriesStatisticsToolBar {
for (Action action : tabActions.getLeftSideActions()) { for (Action action : tabActions.getLeftSideActions()) {
toolbar.add(action); toolbar.add(action);
} }
toolbar.add(Box.createHorizontalGlue());
toolbar.add(fromText);
toolbar.add(Box.createHorizontalStrut(5));
toolbar.add(showStatisticsFrom);
toolbar.add(Box.createHorizontalStrut(5));
toolbar.add(toText);
toolbar.add(Box.createHorizontalStrut(5));
toolbar.add(showStatisticsTo);
} }
public JToolBar getToolBar() { public JToolBar getToolBar() {
return toolbar; return toolbar;
} }
public void addFromDateActionListener(ActionListener l) {
showStatisticsFrom.addActionListener(l);
}
public void addToDateActionListener(ActionListener l) {
showStatisticsTo.addActionListener(l);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment