View Javadoc
1   /*
2    * Tethys: GUI Utilities
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.tethys.api.pane;
18  
19  import io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar.OceanusEventProvider;
20  import io.github.tonywasher.joceanus.tethys.api.base.TethysUIComponent;
21  import io.github.tonywasher.joceanus.tethys.api.base.TethysUIEvent;
22  
23  /**
24   * Tab Manager.
25   */
26  public interface TethysUITabPaneManager
27          extends OceanusEventProvider<TethysUIEvent>, TethysUIComponent {
28      /**
29       * Obtain selected tab.
30       *
31       * @return the selected tab
32       */
33      TethysUITabItem getSelectedTab();
34  
35      /**
36       * find Item by name.
37       *
38       * @param pName the name of the item
39       * @return the item (or null)
40       */
41      TethysUITabItem findItemByName(String pName);
42  
43      /**
44       * find visible Item by index.
45       *
46       * @param pIndex the index of the item
47       * @return the item (or null)
48       */
49      TethysUITabItem findItemByIndex(int pIndex);
50  
51      /**
52       * enable Item by name.
53       *
54       * @param pName    the name of the item
55       * @param pEnabled the enabled state
56       */
57      void enableItemByName(String pName,
58                            boolean pEnabled);
59  
60      /**
61       * Add tab item.
62       *
63       * @param pName the name
64       * @param pItem the item
65       * @return the new tab item
66       */
67      TethysUITabItem addTabItem(String pName,
68                                 TethysUIComponent pItem);
69  
70      /**
71       * Tab Iten.
72       */
73      interface TethysUITabItem {
74          /**
75           * Obtain the name.
76           *
77           * @return the name
78           */
79          String getName();
80  
81          /**
82           * Obtain the name.
83           *
84           * @return the name
85           */
86          Integer getId();
87  
88          /**
89           * Obtain the pane.
90           *
91           * @return the pane
92           */
93          TethysUITabPaneManager getPane();
94  
95          /**
96           * Is the item visible?
97           *
98           * @return true/false
99           */
100         boolean isVisible();
101 
102         /**
103          * Is the item enabled?
104          *
105          * @return true/false
106          */
107         boolean isEnabled();
108 
109         /**
110          * Set Enabled status.
111          *
112          * @param pEnabled true/false
113          */
114         void setEnabled(boolean pEnabled);
115 
116         /**
117          * Set Visible.
118          *
119          * @param pVisible true/false
120          */
121         void setVisible(boolean pVisible);
122 
123         /**
124          * Select item.
125          */
126         void selectItem();
127     }
128 }