org.jvnet.lafwidget.menu
Class MenuSearchWidget

java.lang.Object
  extended by org.jvnet.lafwidget.LafWidgetAdapter
      extended by org.jvnet.lafwidget.menu.MenuSearchWidget
All Implemented Interfaces:
LafWidget, Resettable

public class MenuSearchWidget
extends LafWidgetAdapter
implements Resettable

Adds menu search panel to menu bars.

Author:
Kirill Grouchnikov

Field Summary
protected  javax.swing.JMenuBar jmb
          The associated menu bar.
protected  java.beans.PropertyChangeListener propertyListener
          Listens on changes to the component orientation.
 
Fields inherited from class org.jvnet.lafwidget.LafWidgetAdapter
jcomp
 
Fields inherited from interface org.jvnet.lafwidget.LafWidget
ANIMATION_KIND, COMBO_BOX_AUTOCOMPLETION_MATCHER, COMBO_BOX_NO_AUTOCOMPLETION, COMBO_BOX_USE_MODEL_ONLY, COMPONENT_PREVIEW_PAINTER, IGNORE_GLOBAL_LOCALE, NO_LOCK_ICON, PASSWORD_STRENGTH_CHECKER, TABBED_PANE_PREVIEW_PAINTER, TEXT_EDIT_CONTEXT_MENU, TEXT_FLIP_SELECT_ON_ESCAPE, TEXT_SELECT_ON_FOCUS, TREE_AUTO_DND_SUPPORT
 
Constructor Summary
MenuSearchWidget()
           
 
Method Summary
static int getMenuItemCount(javax.swing.JMenuBar menuBar)
          Returns the number of menu items under the specified menu bar.
static void hideSearchPanels(boolean toRepaint)
          Hides search panels on all menu bars (both JFrames and JInternalFrames).
 void installListeners()
          Installs listeners for the associated component.
 void installUI()
          Installs UI on the associated component.
 boolean requiresCustomLafSupport()
          Returns indication whether this widget requires custom LAF support.
 void reset()
          Resets the state of this widget.
 void setComponent(javax.swing.JComponent jcomp)
          Associates a component with this widget.
static void showSearchPanels()
          Shows search panels on all menu bars (both JFrames and JInternalFrames).
protected static void showSearchPanels(java.awt.Component comp)
          Shows search panels on all descendant internal frames of the specified component.
 void uninstallListeners()
          Uninstalls listeners for the associated component.
 void uninstallUI()
          Uninstalls UI on the associated component.
 
Methods inherited from class org.jvnet.lafwidget.LafWidgetAdapter
installComponents, installDefaults, uninstallComponents, uninstallDefaults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jmb

protected javax.swing.JMenuBar jmb
The associated menu bar.


propertyListener

protected java.beans.PropertyChangeListener propertyListener
Listens on changes to the component orientation.

Constructor Detail

MenuSearchWidget

public MenuSearchWidget()
Method Detail

getMenuItemCount

public static int getMenuItemCount(javax.swing.JMenuBar menuBar)
Returns the number of menu items under the specified menu bar.

Parameters:
menuBar - The root menu bar.
Returns:
The number of menu items under the specified menu bar.

hideSearchPanels

public static void hideSearchPanels(boolean toRepaint)
Hides search panels on all menu bars (both JFrames and JInternalFrames).

Parameters:
toRepaint - Indication whether the relevant menu bars should be repainted.

showSearchPanels

protected static void showSearchPanels(java.awt.Component comp)
Shows search panels on all descendant internal frames of the specified component.

Parameters:
comp - A component.

showSearchPanels

public static void showSearchPanels()
Shows search panels on all menu bars (both JFrames and JInternalFrames).


setComponent

public void setComponent(javax.swing.JComponent jcomp)
Description copied from interface: LafWidget
Associates a component with this widget.

Specified by:
setComponent in interface LafWidget
Overrides:
setComponent in class LafWidgetAdapter
Parameters:
jcomp - Component.

installUI

public void installUI()
Description copied from interface: LafWidget
Installs UI on the associated component.

Specified by:
installUI in interface LafWidget
Overrides:
installUI in class LafWidgetAdapter

uninstallUI

public void uninstallUI()
Description copied from interface: LafWidget
Uninstalls UI on the associated component.

Specified by:
uninstallUI in interface LafWidget
Overrides:
uninstallUI in class LafWidgetAdapter

installListeners

public void installListeners()
Description copied from interface: LafWidget
Installs listeners for the associated component.

Specified by:
installListeners in interface LafWidget
Overrides:
installListeners in class LafWidgetAdapter

uninstallListeners

public void uninstallListeners()
Description copied from interface: LafWidget
Uninstalls listeners for the associated component.

Specified by:
uninstallListeners in interface LafWidget
Overrides:
uninstallListeners in class LafWidgetAdapter

reset

public void reset()
Description copied from interface: Resettable
Resets the state of this widget.

Specified by:
reset in interface Resettable

requiresCustomLafSupport

public boolean requiresCustomLafSupport()
Description copied from interface: LafWidget
Returns indication whether this widget requires custom LAF support. Some widgets such as TabOverviewDialogWidget or TabHoverPreviewWidget require custom implementation based on the internals of the specific LAF. Relevant functions in the base LafWidgetSupport support throw UnsupportedOperationException.

Specified by:
requiresCustomLafSupport in interface LafWidget
Returns:
true if this widget requires custom LAF support, false otherwise.