📄 generatewizardselecttablecard.java
字号:
package org.dbgen.view;import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;import org.dbgen.*;import org.dbgen.gui.*;/** * This class was generated by a SmartGuide. * */public class GenerateWizardSelectTableCard extends JPanel implements org.dbgen.gui.WizardCard, ListSelectionListener, ActionListener { JList fieldTableList = null; Project fieldCurrentProject = null; JButton fieldSelectAllButton = null; /** * GenerateWizardSelectTableCard constructor comment. */ public GenerateWizardSelectTableCard() { super(); initialize(); } /** * This method was created by a SmartGuide. * @param event ActionEvent */ public void actionPerformed(ActionEvent event) { getTableList().setSelectionInterval(0, getTableList().getModel().getSize()-1); return; } /** * cardShown method comment. */ public void cardShown(org.dbgen.gui.Wizard wizard) { /* Update table list */ Project project = DbGenPro.mainWindow.getProjectView().getProject(); setCurrentProject(project); java.util.Vector readyTables = project.getReadyTables(); if (readyTables.size() > 0) { getTableList().setListData(readyTables); wizard.setMessage("Select at least one table and click NEXT button."); } else { getTableList().setListData(new java.util.Vector()); /* empty list */ wizard.setMessage("There is no good tables definitions.\n" + "Please make sure you have checked primary keys\n" + "of the tables and use valid class/table names."); } } /** * enableFinishButton method comment. */ public boolean enableFinishButton() { return false; } /** * enableNextButton method comment. */ public boolean enableNextButton() { return getTableList().getSelectedIndices().length > 0; } /** * getCardName method comment. */ public String getCardName() { return "Select Tables"; } /** * Gets the currentProject property (org.dbgen.Project) value. * @return The currentProject property value. * @see #setCurrentProject */ public Project getCurrentProject() { /* Returns the currentProject property value. */ if (fieldCurrentProject == null) { try { fieldCurrentProject = new Project(); } catch (Throwable exception) { System.err.println("Exception creating currentProject property."); } }; return fieldCurrentProject; } /** * Gets the selectAllButton property (javax.swing.JButton) value. * @return The selectAllButton property value. */ public JButton getSelectAllButton() { /* Returns the selectAllButton property value. */ if (fieldSelectAllButton == null) { try { fieldSelectAllButton = new JButton("Select All Tables"); } catch (Throwable exception) { System.err.println("Exception creating selectAllButton property."); } }; return fieldSelectAllButton; } /** * Gets the tableList property (javax.swing.JList) value. * @return The tableList property value. */ public JList getTableList() { /* Returns the tableList property value. */ if (fieldTableList == null) { try { fieldTableList = new JList(); fieldTableList.addListSelectionListener(this); } catch (Throwable exception) { System.err.println("Exception creating tableList property."); } }; return fieldTableList; } /** * This method was created by a SmartGuide. */ public void initialize() { GridBagConstraints gbc = new GridBagConstraints(); Insets insets = new Insets(2, 2, 2, 2); int row = 1; setLayout(new GridBagLayout()); Util.addgbc2(this, new JLabel("Please select the tables below:"), gbc, row, 1, 1, 1, 1f, 0f, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, insets); Util.addgbc2(this, getSelectAllButton(), gbc, row++, 2, 1, 1, 0f, 0f, GridBagConstraints.NONE, GridBagConstraints.EAST, insets); Util.addgbc2(this, new JScrollPane(getTableList()), gbc, row++, 1, 2, 1, 1f, 1f, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, insets); getSelectAllButton().addActionListener(this); return; } /** * proceedNext method comment. */ public boolean proceedNext() { return true; } /** * Sets the currentProject property (org.dbgen.Project) value. * @param currentProject The new value for the property. * @see #getCurrentProject */ public void setCurrentProject(Project currentProject) { /* Get the old property value for fire property change event. */ Project oldValue = fieldCurrentProject; /* Set the currentProject property (attribute) to the new value. */ fieldCurrentProject = currentProject; /* Fire (signal/notify) the currentProject property change event. */ firePropertyChange("currentProject", oldValue, currentProject); return; } /** * This method was created by a SmartGuide. * @param event javax.swing.event.ListSelectionEvent */ public void valueChanged(ListSelectionEvent event) { Wizard.findWizard(this).updateSensitivities(); return; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -