Kbase 17916: Apptivity - Enabling and Disabling Tabs on a Window
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/05/1998 |
|
Apptivity - Enabling and Disabling Tabs on a Window
Enabling/Disabling tabs is accomplished via methods on the TabBorder
object. To get the TabBorder object use the tabBorder() method on
abTabbedPanel (actually on its base class of TabView).
There are two version of the setDisabled() method:
TabBorder.setDisabled(int index, boolean enabled) // use a 0 relative
index
TabBorder.setDisabled(String label, boolean enabled) // use label text
of the table
and there are two version of the isDisabled() method:
TabBorder.isDisabled(int index) // use a 0 relative index
TabBorder.isDisabled(String label) // use label text of the table
For more information refer to the indius reference material for the
TabBorder class.
For example add the following code to the project-name.java file, a
the end of the init() method.
TabBorder tabb = new TabBorder();
tabb = m_Window1.tabBorder();
tabb.setDisabled(1, true); // disables the 2nd tab
You could then have a button on the first form (Form1) that enables
the tab:
abTabbedPanel m_tab = new abTabbedPanel();
TabBorder tabb = new TabBorder();
m_tab = getParentTabbedPanel();
tabb = m_tab.tabBorder();
tabb.setDisabled(1, false); // enable the tab