01: /*
02: * @(#)DockableFrameUI.java
03: *
04: * Copyright 2002 JIDE Software Inc. All rights reserved.
05: */
06: package com.jidesoft.plaf;
07:
08: import com.jidesoft.swing.JideTabbedPane;
09:
10: import javax.swing.plaf.TabbedPaneUI;
11: import java.awt.*;
12:
13: /**
14: * ComponentUI for JideTabbedPane.
15: */
16: public abstract class JideTabbedPaneUI extends TabbedPaneUI {
17: /**
18: * Gets the tab panel for the JideTabbedPane. The tab panel contains all the tabs and the tabbed pane buttons (close, scroll left/right, list buttons).
19: * Sometimes you have to use this tab panel. For example, if you want to add a mouse listener to get double click event on tabs, you must use this tab panel to add
20: * mouse listener. In addition, as the tab panel is part of the TabbedPaneUI which is recreated when updateUI is called (which usually happens after switching L&F), you should
21: * override updateUI method in JideTabbedPane to add mouse listener so that it will get added again after updateUI.
22: *
23: * @return the tab panel.
24: */
25: abstract public Component getTabPanel();
26:
27: /**
28: * Edits the tab at the index.
29: *
30: * @param tabIndex the tab index.
31: * @return true if editing started. Otherwise false if the tab is already in editing mode when this method is called.
32: */
33: abstract public boolean editTabAt(int tabIndex);
34:
35: /**
36: * Checks if the tab is being edited.
37: *
38: * @return true or false.
39: */
40: abstract public boolean isTabEditing();
41:
42: /**
43: * Stops the editing and commits the change.
44: */
45: abstract public void stopTabEditing();
46:
47: /**
48: * Cancels the editing and discards the change.
49: */
50: abstract public void cancelTabEditing();
51:
52: /**
53: * Gets the tab index that is editing, if any. -1 if no tab is being edited.
54: *
55: * @return the tab index or -1.
56: */
57: abstract public int getEditingTabIndex();
58:
59: /**
60: * Scroll the selected tab visible in case the tab is outside of the viewport. This method is called by {@link JideTabbedPane#scrollSelectedTabToVisible(boolean)} method.
61: *
62: * @param scrollLeft true to scroll the first tab visible first then scroll left to make
63: * the selected tab visible. This will get a more consistent result.
64: * If false, it will simple scroll the selected tab visible. Sometimes the
65: * tab will appear as the first visible tab or the last visible tab depending on
66: * the previous viewport position.
67: */
68: abstract public void ensureActiveTabIsVisible(boolean scrollLeft);
69:
70: }
|