001 package sale; 002 003 import javax.swing.*; 004 005 /** 006 * A separator in a MenuSheet. 007 * 008 * <p>Separators are horizontal lines that are displayed in pop up menus to divide them 009 * into sections. Separators will not be displayed in JMenuBar representations of 010 * MenuSheets.</p> 011 * 012 * @see MenuSheetObject 013 * @see MenuSheet 014 * 015 * @author Steffen Zschaler 016 * @version 2.0 20/05/1999 017 * @since v2.0 018 */ 019 public class MenuSheetSeparator extends MenuSheetObject { 020 021 /** 022 * Create a new MenuSheetSeparator with a tag. 023 * 024 * @param sTag the tag to associate with this MenuSheetSeparator 025 */ 026 public MenuSheetSeparator(String sTag) { 027 super(null, sTag); 028 } 029 030 /** 031 * Create a new MenuSheetSeparator. 032 */ 033 public MenuSheetSeparator() { 034 this(null); 035 } 036 037 /** 038 * @override Never 039 * 040 * @return true to indicate that this is a separator. 041 */ 042 public final boolean isSeparator() { 043 return true; 044 } 045 046 /** 047 * @override Never 048 * 049 * @return <code>null</code>, as separators do not need a peer. 050 */ 051 public final JMenuItem getPeer() { 052 return null; 053 } 054 055 /** 056 * @override Never 057 * 058 * @return <code>null</code>, as separators do not need a peer. 059 */ 060 public final JMenu getMenuPeer() { 061 return null; 062 } 063 }