Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 package org.apache.cayenne.modeler.dialog.db;
 import  com.jgoodies.forms.builder.PanelBuilder;
 import  com.jgoodies.forms.layout.CellConstraints;
 import  com.jgoodies.forms.layout.FormLayout;

Wizard for generating the database from the data map.
 public class DBGeneratorOptionsView extends JDialog {
     protected JTextArea sql;
     protected JButton generateButton;
     protected JButton cancelButton;
     protected JButton saveSqlButton;
     protected JCheckBox dropTables;
     protected JCheckBox createTables;
     protected JCheckBox createFK;
     protected JCheckBox createPK;
     protected JCheckBox dropPK;
     protected Component tables;
     protected JTabbedPane tabs;
     public DBGeneratorOptionsView(Component tables) {
         // create widgets
         this. = new JButton("Generate");
         this. = new JButton("Close");
         this. = new JButton("Save SQL");
         this. = new JCheckBox("Drop Tables");
         this. = new JCheckBox("Create Tables");
         this. = new JCheckBox("Create FK Support");
         this. = new JCheckBox("Create Primary Key Support");
         this. = new JCheckBox("Drop Primary Key Support");
         this. = tables;
         this. = new JTabbedPane(.);
         this. = new JTextArea();
         // assemble...
         JPanel optionsPane = new JPanel(new GridLayout(3, 2));
         optionsPane.add(new JLabel());
         JPanel sqlTextPanel = new JPanel(new BorderLayout());
         sqlTextPanel.add(new JScrollPane(
         CellConstraints cc = new CellConstraints();
         PanelBuilder builder = new PanelBuilder(new FormLayout(
                 "p, 3dlu, p, 9dlu, p, 3dlu, fill:40dlu:grow"));
         builder.addSeparator("Options"cc.xywh(1, 1, 1, 1));
        builder.add(optionsPanecc.xy(1, 3, "left,fill"));
        builder.addSeparator("Generated SQL"cc.xywh(1, 5, 1, 1));
        builder.add(sqlTextPanelcc.xy(1, 7));
        .addTab("SQL Options"builder.getPanel());
        .addTab("Tables"new JScrollPane(
        // we need the right preferred size so that dialog "pack()" produces decent
        // default size...
        .setPreferredSize(new Dimension(450, 350));
        JPanel buttons = new JPanel(new FlowLayout(.));
        Container contentPane = this.getContentPane();
        contentPane.setLayout(new BorderLayout());
    public JButton getCancelButton() {
        return ;
    public JTabbedPane getTabs() {
        return ;
    public JCheckBox getCreateFK() {
        return ;
    public JCheckBox getCreatePK() {
        return ;
    public JCheckBox getCreateTables() {
        return ;
    public JCheckBox getDropPK() {
        return ;
    public JCheckBox getDropTables() {
        return ;
    public JButton getGenerateButton() {
        return ;
    public JButton getSaveSqlButton() {
        return ;
    public JTextArea getSql() {
        return ;
New to GrepCode? Check out our FAQ X