View Javadoc

1   package com.explosion.expf.menusandtools.menu.segmented;
2   
3   import java.awt.Component;
4   
5   import com.explosion.expf.menusandtools.menu.InvalidOrUnknownSegmentException;
6   
7   /* =============================================================================
8    *       
9    *     Copyright 2004 Stephen Cowx
10   *
11   *     Licensed under the Apache License, Version 2.0 (the "License");
12   *     you may not use this file except in compliance with the License.
13   *     You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   *     Unless required by applicable law or agreed to in writing, software
18   *     distributed under the License is distributed on an "AS IS" BASIS,
19   *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   *     See the License for the specific language governing permissions and
21   *     limitations under the License.
22   * 
23   * =============================================================================
24   */
25  
26  
27  /***
28   * @author Stephen Cowx
29   */
30  
31  public interface ExpSegmentedMenu
32  {
33    /***
34     * Creates a new segment in this menu
35     */
36    public ExpMenuSegment createNewSegment(int relativePositionOfSegmentOnMenu) throws Exception;
37  
38    /***
39     * adds an item to the specified segment
40     */
41    public void addElementToSegment(ExpMenuSegment segment, Component item)  throws InvalidOrUnknownSegmentException;
42    
43    /***
44     * Removes all the elements except the separator from this menu 
45     * @param segment
46     * @param item
47     * @throws InvalidOrUnknownSegmentException
48     */
49    public void removeSegment(ExpMenuSegment segment) throws InvalidOrUnknownSegmentException;
50    
51  }
52