Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.wizard.tab.CachingTab Class Reference

Inheritance diagram for org.objectweb.cjdbc.console.wizard.tab.CachingTab:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.console.wizard.tab.CachingTab:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CachingTab (WizardTabs tabs)
void itemStateChanged (ItemEvent e)

Public Attributes

JCheckBox metadataenable
JCheckBox parsingenable
JCheckBox resultenable
JSlider maxNbOfMetadata
JSlider maxNbOfField
JCheckBox backgroundParsing
JSlider maxNbOfEntries
JSlider resultMaxNbOfEntries
JSlider pendingTimeout
JComboBox granularity

Detailed Description

This tab defines the fields to fill for caching.

See also:
WizardTab
Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 51 of file CachingTab.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.wizard.tab.CachingTab.CachingTab WizardTabs  tabs  ) 
 

Creates a new CachingTab object

Parameters:
tabs 

Definition at line 69 of file CachingTab.java.

00070   {
00071     super(tabs, WizardConstants.TAB_CACHING);
00072 
00073     ///////////////////////////////////////////////////////////////////////////
00074     // metadatacache panel
00075     ///////////////////////////////////////////////////////////////////////////
00076 
00077     JPanel metadatacache = new JPanel();
00078     metadatacache.setBorder(BorderFactory.createTitledBorder(WizardTranslate
00079         .get("label.metadatacache")));
00080     metadatacache.setLayout(new GridBagLayout());
00081     GridBagConstraints metadatacacheconstraints = new GridBagConstraints();
00082     metadatacacheconstraints.fill = GridBagConstraints.HORIZONTAL;
00083     metadatacacheconstraints.weightx = 1.0;
00084 
00085     // enable
00086     metadatacacheconstraints.gridy = ++metadatacacheconstraints.gridy;
00087     metadatacacheconstraints.gridx = 0;
00088     metadatacache.add(new JLabel(WizardTranslate.get("label.enable")),
00089         metadatacacheconstraints);
00090     metadatacacheconstraints.gridx = 1;
00091     metadataenable = new JCheckBox();
00092     metadataenable.addItemListener(this);
00093     metadatacache.add(metadataenable, metadatacacheconstraints);
00094 
00095     // maxNbOfMetadata
00096     metadatacacheconstraints.gridy = ++metadatacacheconstraints.gridy;
00097     maxNbOfMetadata = new JSlider(JSlider.HORIZONTAL, 0, 200000, 10000);
00098     maxNbOfMetadata.setPaintTicks(true);
00099     maxNbOfMetadata.setPaintLabels(true);
00100     maxNbOfMetadata.setMajorTickSpacing(50000);
00101     maxNbOfMetadata.setEnabled(false);
00102     metadatacacheconstraints.gridx = 0;
00103     metadatacache.add(new JLabel(WizardTranslate.get("label.maxNbOfMetadata")),
00104         metadatacacheconstraints);
00105     metadatacacheconstraints.gridx = 1;
00106     metadatacache.add(maxNbOfMetadata, metadatacacheconstraints);
00107 
00108     // maxNbOfField
00109     metadatacacheconstraints.gridy = ++metadatacacheconstraints.gridy;
00110     maxNbOfField = new JSlider(JSlider.HORIZONTAL, 0, 1000, 0);
00111     maxNbOfField.setPaintTicks(true);
00112     maxNbOfField.setPaintLabels(true);
00113     maxNbOfField.setMajorTickSpacing(100);
00114     maxNbOfField.setEnabled(false);
00115     metadatacacheconstraints.gridx = 0;
00116     metadatacache.add(new JLabel(WizardTranslate.get("label.maxNbOfFields")),
00117         metadatacacheconstraints);
00118     metadatacacheconstraints.gridx = 1;
00119     metadatacache.add(maxNbOfField, metadatacacheconstraints);
00120 
00121     this.add(metadatacache, constraints);
00122     constraints.gridy = ++constraints.gridy;
00123 
00124     ///////////////////////////////////////////////////////////////////////////
00125     // parsingcache panel
00126     ///////////////////////////////////////////////////////////////////////////
00127 
00128     JPanel parsingcache = new JPanel();
00129     parsingcache.setBorder(BorderFactory.createTitledBorder(WizardTranslate
00130         .get("label.parsingcache")));
00131     parsingcache.setLayout(new GridBagLayout());
00132     GridBagConstraints parsingcacheconstraints = new GridBagConstraints();
00133     parsingcacheconstraints.fill = GridBagConstraints.HORIZONTAL;
00134     parsingcacheconstraints.weightx = 1.0;
00135 
00136     // enable
00137     parsingcacheconstraints.gridy = ++parsingcacheconstraints.gridy;
00138     parsingcacheconstraints.gridx = 0;
00139     parsingcache.add(new JLabel(WizardTranslate.get("label.enable")),
00140         parsingcacheconstraints);
00141     parsingcacheconstraints.gridx = 1;
00142     parsingenable = new JCheckBox();
00143     parsingenable.addItemListener(this);
00144     parsingcache.add(parsingenable, parsingcacheconstraints);
00145 
00146     // backgroundParsing
00147     parsingcacheconstraints.gridy = ++parsingcacheconstraints.gridy;
00148     parsingcacheconstraints.gridx = 0;
00149     parsingcache.add(
00150         new JLabel(WizardTranslate.get("label.backgroundParsing")),
00151         parsingcacheconstraints);
00152     parsingcacheconstraints.gridx = 1;
00153     backgroundParsing = new JCheckBox();
00154     backgroundParsing.addItemListener(this);
00155     backgroundParsing.setEnabled(false);
00156     parsingcache.add(backgroundParsing, parsingcacheconstraints);
00157 
00158     // maxNbOfEntries
00159     parsingcacheconstraints.gridy = ++parsingcacheconstraints.gridy;
00160     maxNbOfEntries = new JSlider(JSlider.HORIZONTAL, 0, 10000, 5000);
00161     maxNbOfEntries.setPaintTicks(true);
00162     maxNbOfEntries.setPaintLabels(true);
00163     maxNbOfEntries.setMajorTickSpacing(2500);
00164     maxNbOfEntries.setEnabled(false);
00165     parsingcacheconstraints.gridx = 0;
00166     parsingcache.add(new JLabel(WizardTranslate.get("label.maxNbOfEntries")),
00167         parsingcacheconstraints);
00168     parsingcacheconstraints.gridx = 1;
00169     parsingcache.add(maxNbOfEntries, parsingcacheconstraints);
00170 
00171     this.add(parsingcache, constraints);
00172     constraints.gridy = ++constraints.gridy;
00173 
00174     ///////////////////////////////////////////////////////////////////////////
00175     // resultcache panel
00176     ///////////////////////////////////////////////////////////////////////////
00177 
00178     JPanel resultcache = new JPanel();
00179     resultcache.setBorder(BorderFactory.createTitledBorder(WizardTranslate
00180         .get("label.resultcache")));
00181     resultcache.setLayout(new GridBagLayout());
00182     GridBagConstraints resultcacheconstraints = new GridBagConstraints();
00183     resultcacheconstraints.fill = GridBagConstraints.HORIZONTAL;
00184     resultcacheconstraints.weightx = 1.0;
00185 
00186     // enable
00187     resultcacheconstraints.gridy = ++resultcacheconstraints.gridy;
00188     resultcacheconstraints.gridx = 0;
00189     resultcache.add(new JLabel(WizardTranslate.get("label.enable")),
00190         resultcacheconstraints);
00191     resultcacheconstraints.gridx = 1;
00192     resultenable = new JCheckBox();
00193     resultenable.addItemListener(this);
00194     resultcache.add(resultenable, resultcacheconstraints);
00195 
00196     // granularity
00197     resultcacheconstraints.gridy = ++resultcacheconstraints.gridy;
00198     granularity = new JComboBox(WizardConstants.RESULT_CACHE_GRANULARITY);
00199     granularity.setSelectedIndex(0);
00200     granularity.addItemListener(this);
00201     granularity.setEnabled(false);
00202     resultcacheconstraints.gridx = 0;
00203     resultcache.add(new JLabel(WizardTranslate.get("label.granularity")),
00204         resultcacheconstraints);
00205     resultcacheconstraints.gridx = 1;
00206     resultcache.add(granularity, resultcacheconstraints);
00207 
00208     // maxNbOfEntries
00209     resultcacheconstraints.gridy = ++resultcacheconstraints.gridy;
00210     resultMaxNbOfEntries = new JSlider(JSlider.HORIZONTAL, 0, 1000000, 100000);
00211     resultMaxNbOfEntries.setPaintTicks(true);
00212     resultMaxNbOfEntries.setMajorTickSpacing(100000);
00213     resultMaxNbOfEntries.setEnabled(false);
00214     resultcacheconstraints.gridx = 0;
00215     resultcache.add(new JLabel(WizardTranslate.get("label.maxNbOfEntries")),
00216         resultcacheconstraints);
00217     resultcacheconstraints.gridx = 1;
00218     resultcache.add(resultMaxNbOfEntries, resultcacheconstraints);
00219 
00220     // pendingTimeout
00221     resultcacheconstraints.gridy = ++resultcacheconstraints.gridy;
00222     pendingTimeout = new JSlider(JSlider.HORIZONTAL, 0, 3600, 0);
00223     pendingTimeout.setPaintTicks(true);
00224     pendingTimeout.setPaintLabels(true);
00225     pendingTimeout.setMajorTickSpacing(600);
00226     pendingTimeout.setEnabled(false);
00227     resultcacheconstraints.gridx = 0;
00228     resultcache.add(new JLabel(WizardTranslate.get("label.pendingTimeout")),
00229         resultcacheconstraints);
00230     resultcacheconstraints.gridx = 1;
00231     resultcache.add(pendingTimeout, resultcacheconstraints);
00232 
00233     this.add(resultcache, constraints);
00234     constraints.gridy = ++constraints.gridy;
00235 
00236   }


Member Function Documentation

void org.objectweb.cjdbc.console.wizard.tab.CachingTab.itemStateChanged ItemEvent  e  ) 
 

See also:
java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)

Definition at line 241 of file CachingTab.java.

00242   {
00243     Object source = e.getSource();
00244     if (source == resultenable)
00245     {
00246       boolean enable = resultenable.getSelectedObjects() != null;
00247       granularity.setEnabled(enable);
00248       pendingTimeout.setEnabled(enable);
00249       resultMaxNbOfEntries.setEnabled(enable);
00250     }
00251     else if (source == parsingenable)
00252     {
00253       boolean enable = parsingenable.getSelectedObjects() != null;
00254       backgroundParsing.setEnabled(enable);
00255       maxNbOfEntries.setEnabled(enable);
00256     }
00257     else if (source == metadataenable)
00258     {
00259       boolean enable = metadataenable.getSelectedObjects() != null;
00260       maxNbOfMetadata.setEnabled(enable);
00261       maxNbOfField.setEnabled(enable);
00262     }
00263   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:22 2005 for C-JDBC by  doxygen 1.3.9.1