Ejemplo n.º 1
0
 private void edit_ScriptActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_edit_ScriptActionPerformed
   EditModeLabel.setVisible(true);
   scriptText.setEnabled(true);
   checkEdit = true;
   indexName.setEnabled(false);
 } // GEN-LAST:event_edit_ScriptActionPerformed
Ejemplo n.º 2
0
  /** Creates new form CreateIndex */
  public CreatIndex() {
    initComponents();
    show_addedColumnBox.setVisible(false);
    scriptText.setEnabled(false);
    show_columnName.removeAllItems();
    show_columnName.setEnabled(false);
    EditModeLabel.setVisible(false);
    addColumn.setVisible(false);
    AutoCompleteDecorator.decorate(list_table_name);
    saveScript.setEnabled(false);

    scriptText.setDisabledTextColor(Color.BLACK);
    show_addedColumnBox.setDisabledTextColor(Color.BLACK);
  }
Ejemplo n.º 3
0
 private void cancelbtnActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_cancelbtnActionPerformed
   columnNames.clear();
   indexName.setText("");
   scriptText.setText("");
   show_addedColumnBox.setText("");
   checkUnique.setSelected(false);
   choice = 0;
   checkMultipleColumns.setSelected(false);
   checkEdit = false;
   addColumn.setVisible(false);
   show_addedColumnBox.setVisible(false);
   retriveTableFromDB();
   show_columnName.removeAllItems();
   scriptText.setEnabled(false);
   EditModeLabel.setVisible(false);
   indexName.setEnabled(true);
   checkEmpty = false;
   refresh.setEnabled(true);
   show_columnName.removeAllItems();
   list_table_name.setSelectedIndex(0);
   show_script.setEnabled(true);
 } // GEN-LAST:event_cancelbtnActionPerformed
Ejemplo n.º 4
0
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    createIndex = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    indexName = new javax.swing.JTextField();
    checkUnique = new javax.swing.JCheckBox();
    jLabel3 = new javax.swing.JLabel();
    list_table_name = new javax.swing.JComboBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    scriptText = new javax.swing.JTextArea();
    jLabel4 = new javax.swing.JLabel();
    show_columnName = new javax.swing.JComboBox();
    checkMultipleColumns = new javax.swing.JCheckBox();
    show_script = new javax.swing.JButton();
    edit_Script = new javax.swing.JButton();
    refresh = new javax.swing.JButton();
    EditModeLabel = new javax.swing.JLabel();
    addColumn = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    show_addedColumnBox = new javax.swing.JTextArea();
    cancelbtn = new javax.swing.JButton();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    saveScript = new javax.swing.JButton();

    setFocusCycleRoot(true);
    setPreferredSize(new java.awt.Dimension(600, 500));
    addAncestorListener(
        new javax.swing.event.AncestorListener() {
          public void ancestorMoved(javax.swing.event.AncestorEvent evt) {}

          public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            formAncestorAdded(evt);
          }

          public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {}
        });

    createIndex.setText("Create");
    createIndex.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            createIndexActionPerformed(evt);
          }
        });
    createIndex.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            createIndexKeyPressed(evt);
          }
        });

    jLabel2.setText("Index Name:  ");

    checkUnique.setText("Unique");
    checkUnique.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkUniqueActionPerformed(evt);
          }
        });

    jLabel3.setText("Table Name:  ");

    list_table_name.setModel(
        new javax.swing.DefaultComboBoxModel(new String[] {"--Please Select One--"}));
    list_table_name.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            list_table_nameActionPerformed(evt);
          }
        });

    scriptText.setColumns(20);
    scriptText.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
    scriptText.setRows(5);
    jScrollPane1.setViewportView(scriptText);

    jLabel4.setText("Columns:");

    show_columnName.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"--Please select at least one column--", "Add more columns"}));

    checkMultipleColumns.setText("Multiple Columns");
    checkMultipleColumns.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkMultipleColumnsActionPerformed(evt);
          }
        });

    show_script.setText("Show Script");
    show_script.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            show_scriptActionPerformed(evt);
          }
        });
    show_script.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            show_scriptKeyPressed(evt);
          }
        });

    edit_Script.setText("Edit Script");
    edit_Script.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            edit_ScriptActionPerformed(evt);
          }
        });
    edit_Script.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            edit_ScriptKeyPressed(evt);
          }
        });

    refresh.setIcon(thisController.refreshIcon(15));
    refresh.setMaximumSize(new java.awt.Dimension(15, 15));
    refresh.setMinimumSize(new java.awt.Dimension(15, 15));
    refresh.setPreferredSize(new java.awt.Dimension(15, 15));
    refresh.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            refreshActionPerformed(evt);
          }
        });
    refresh.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            refreshKeyPressed(evt);
          }
        });

    EditModeLabel.setText("~~User in Edit Mode~~");

    addColumn.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    addColumn.setText("+");
    addColumn.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addColumnActionPerformed(evt);
          }
        });
    addColumn.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            addColumnKeyPressed(evt);
          }
        });

    show_addedColumnBox.setEditable(false);
    show_addedColumnBox.setColumns(20);
    show_addedColumnBox.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
    show_addedColumnBox.setRows(5);
    jScrollPane2.setViewportView(show_addedColumnBox);

    cancelbtn.setText("Cancel");
    cancelbtn.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelbtnActionPerformed(evt);
          }
        });
    cancelbtn.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            cancelbtnKeyPressed(evt);
          }
        });

    jLabel5.setText("*To remove column,select Edit Script");

    jLabel6.setText("Added columns");

    saveScript.setText("Save Script");
    saveScript.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveScriptActionPerformed(evt);
          }
        });
    saveScript.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            saveScriptKeyPressed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(16, 16, 16)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createParallelGroup(
                                        javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(104, 104, 104)
                                            .addComponent(EditModeLabel)
                                            .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(cancelbtn)
                                            .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement
                                                    .UNRELATED)
                                            .addComponent(createIndex))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(
                                                        layout
                                                            .createSequentialGroup()
                                                            .addGap(4, 4, 4)
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addComponent(jLabel2)
                                                                    .addComponent(jLabel4)
                                                                    .addComponent(jLabel3))
                                                            .addGap(34, 34, 34)
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addComponent(
                                                                                indexName,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                90,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addGap(40, 40, 40)
                                                                            .addComponent(
                                                                                checkUnique))
                                                                    .addComponent(
                                                                        list_table_name,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE,
                                                                        145,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE)
                                                                    .addComponent(
                                                                        show_columnName,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE,
                                                                        209,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE))
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addGap(17, 17, 17)
                                                                            .addComponent(
                                                                                checkMultipleColumns))
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addGap(18, 18, 18)
                                                                            .addComponent(
                                                                                refresh,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                23,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addPreferredGap(
                                                                                javax.swing
                                                                                    .LayoutStyle
                                                                                    .ComponentPlacement
                                                                                    .RELATED)
                                                                            .addComponent(
                                                                                addColumn))))
                                                    .addComponent(
                                                        jLabel5,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        262,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGap(13, 13, 13)))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                show_script,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                97,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                edit_Script,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                saveScript,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane1)))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jScrollPane2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                95,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel6)
                                    .addGap(50, 50, 50)))));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(46, 46, 46)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(
                                indexName,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(checkUnique)
                            .addComponent(checkMultipleColumns))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(
                                list_table_name,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(21, 21, 21)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(addColumn)
                                    .addComponent(jLabel6))
                            .addComponent(
                                refresh,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                23,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(
                                layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel4)
                                    .addComponent(
                                        show_columnName,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                jScrollPane2,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                jScrollPane1,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                104,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(EditModeLabel)
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(createIndex)
                                                    .addComponent(cancelbtn))))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(show_script)
                                    .addGap(11, 11, 11)
                                    .addComponent(edit_Script)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(saveScript)))
                    .addGap(18, 18, 18)
                    .addComponent(
                        jLabel5,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        28,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(159, Short.MAX_VALUE)));
  } // </editor-fold>//GEN-END:initComponents