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 * ID for serialization. 023 */ 024 private static final long serialVersionUID = 8150522730544683751L; 025 026 /** 027 * Create a new MenuSheetSeparator with a tag. 028 * 029 * @param sTag the tag to associate with this MenuSheetSeparator 030 */ 031 public MenuSheetSeparator(String sTag) { 032 super(null, sTag); 033 } 034 035 /** 036 * Create a new MenuSheetSeparator. 037 */ 038 public MenuSheetSeparator() { 039 this(null); 040 } 041 042 /** 043 * @override Never 044 * 045 * @return true to indicate that this is a separator. 046 */ 047 public final boolean isSeparator() { 048 return true; 049 } 050 051 /** 052 * @override Never 053 * 054 * @return <code>null</code>, as separators do not need a peer. 055 */ 056 public final JMenuItem getPeer() { 057 return null; 058 } 059 060 /** 061 * @override Never 062 * 063 * @return <code>null</code>, as separators do not need a peer. 064 */ 065 public final JMenu getMenuPeer() { 066 return null; 067 } 068 }