Search in sources :

Example 6 with JAutoToggleButton

use of org.freeplane.core.ui.components.JAutoToggleButton in project freeplane by freeplane.

the class FilterController method createFilterToolbar.

private JToolBar createFilterToolbar() {
    final JToolBar filterToolbar = new FreeplaneToolBar("filter_toolbar", SwingConstants.HORIZONTAL);
    filterToolbar.setVisible(ResourceController.getResourceController().getBooleanProperty("filter_toolbar_visible"));
    Controller controller = Controller.getCurrentController();
    FrameController frameController = (FrameController) controller.getViewController();
    UIComponentVisibilityDispatcher.install(frameController, filterToolbar, "filter_toolbar_visible");
    final JButton undoBtn = new JButton(controller.getAction("UndoFilterAction"));
    final JButton redoBtn = new JButton(controller.getAction("RedoFilterAction"));
    final JToggleButton showAncestorsBox = new JAutoToggleButton(controller.getAction("ShowAncestorsAction"), showAncestors);
    showAncestorsBox.setSelected(showAncestors.isSelected());
    final JToggleButton showDescendantsBox = new JAutoToggleButton(controller.getAction("ShowDescendantsAction"), showDescendants);
    final JToggleButton applyToVisibleBox = new JAutoToggleButton(controller.getAction("ApplyToVisibleAction"), applyToVisibleNodeOnly);
    final JButton btnEdit = new JButton(controller.getAction("EditFilterAction"));
    activeFilterConditionComboBox = new JComboBox(getFilterConditions());
    final JButton applyBtn = new JButton(controller.getAction("ReapplyFilterAction"));
    final JButton filterSelectedBtn = new JButton(controller.getAction("ApplySelectedViewConditionAction"));
    final JButton noFilteringBtn = new JButton(controller.getAction("ApplyNoFilteringAction"));
    final JButton applyFindPreviousBtn = new JButton(controller.getAction("QuickFindAction.BACK"));
    final JButton applyFindNextBtn = new JButton(controller.getAction("QuickFindAction.FORWARD"));
    final JButton applyQuickFilterBtn = new JButton(controller.getAction("QuickFilterAction"));
    final JButton applyQuickSelectBtn = new JButton(controller.getAction("QuickFindAllAction"));
    final JToggleButton applyQuickHighlightBtn = new JAutoToggleButton(controller.getAction("QuickHighlightAction"));
    filterToolbar.addSeparator();
    filterToolbar.add(undoBtn);
    filterToolbar.add(redoBtn);
    filterToolbar.add(showAncestorsBox);
    filterToolbar.add(showDescendantsBox);
    filterToolbar.add(applyToVisibleBox);
    filterToolbar.add(activeFilterConditionComboBox);
    filterToolbar.add(applyBtn);
    filterToolbar.add(filterSelectedBtn);
    filterToolbar.add(noFilteringBtn);
    filterToolbar.add(btnEdit);
    filterToolbar.addSeparator();
    filterToolbar.add(quickEditor);
    filterToolbar.add(applyFindPreviousBtn);
    filterToolbar.add(applyFindNextBtn);
    filterToolbar.add(applyQuickSelectBtn);
    filterToolbar.add(applyQuickFilterBtn);
    filterToolbar.add(applyQuickHighlightBtn);
    final DefaultConditionRenderer toolbarConditionRenderer = new DefaultConditionRenderer(TextUtils.getText("filter_no_filtering"), false);
    activeFilterConditionComboBox.setRenderer(toolbarConditionRenderer);
    return filterToolbar;
}
Also used : JAutoToggleButton(org.freeplane.core.ui.components.JAutoToggleButton) DefaultConditionRenderer(org.freeplane.features.filter.condition.DefaultConditionRenderer) JToggleButton(javax.swing.JToggleButton) JComboBox(javax.swing.JComboBox) FreeplaneToolBar(org.freeplane.core.ui.components.FreeplaneToolBar) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar) Controller(org.freeplane.features.mode.Controller) ResourceController(org.freeplane.core.resources.ResourceController) FrameController(org.freeplane.features.ui.FrameController) ModeController(org.freeplane.features.mode.ModeController) FrameController(org.freeplane.features.ui.FrameController)

Aggregations

JAutoToggleButton (org.freeplane.core.ui.components.JAutoToggleButton)6 JButton (javax.swing.JButton)3 JToggleButton (javax.swing.JToggleButton)3 AFreeplaneAction (org.freeplane.core.ui.AFreeplaneAction)2 FreeplaneToolBar (org.freeplane.core.ui.components.FreeplaneToolBar)2 EntryAccessor (org.freeplane.core.ui.menubuilders.generic.EntryAccessor)2 Component (java.awt.Component)1 Container (java.awt.Container)1 AbstractButton (javax.swing.AbstractButton)1 JComboBox (javax.swing.JComboBox)1 JToolBar (javax.swing.JToolBar)1 Separator (javax.swing.JToolBar.Separator)1 ResourceController (org.freeplane.core.resources.ResourceController)1 Entry (org.freeplane.core.ui.menubuilders.generic.Entry)1 JToolbarComponentBuilder (org.freeplane.core.ui.menubuilders.menu.JToolbarComponentBuilder)1 DefaultConditionRenderer (org.freeplane.features.filter.condition.DefaultConditionRenderer)1 Controller (org.freeplane.features.mode.Controller)1 ModeController (org.freeplane.features.mode.ModeController)1 FrameController (org.freeplane.features.ui.FrameController)1 Test (org.junit.Test)1