public EditPasteTableNameDlg(Frame owner, String destTableName) {
    super(owner, s_stringMgr.getString("EditPasteTableNameDlg.title"), true);
    _destTableName = destTableName;
    createUI();

    _btnOK.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            onOK();
          }
        });

    getRootPane().setDefaultButton(_btnOK);

    _btnCancel.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            onCancel();
          }
        });

    GUIUtils.enableCloseByEscape(this);

    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            _txtTableName.requestFocus();
          }
        });

    setSize(400, 200);
  }
Пример #2
0
 /**
  * Hide the dialog if one is shown
  *
  * @param _waitDialog the PleaseWaitDialog to close - can be null.
  */
 private void disposeWaitDialog() {
   if (!_prefs.getShowPleaseWaitDialog()) return;
   GUIUtils.processOnSwingEventThread(
       new Runnable() {
         public void run() {
           if (_waitDialog != null) {
             _waitDialog.dispose();
           }
         }
       });
 }
 @Override
 public void setSession(ISession session) {
   _session = session;
   GUIUtils.processOnSwingEventThread(
       new Runnable() {
         @Override
         public void run() {
           setEnabled(null != _session);
         }
       });
 }
Пример #4
0
 public void moveToFront(final JInternalFrame fr) {
   if (fr != null) {
     GUIUtils.processOnSwingEventThread(
         new Runnable() {
           public void run() {
             GUIUtils.moveToFront(fr);
           }
         });
   } else {
     s_log.debug("JInternalFrame == null");
   }
 }
Пример #5
0
    @Override
    public void sqlResultSetAvailable(
        ResultSetWrapper rs, final SQLExecutionInfo info, final IDataSetUpdateableTableModel model)
        throws DataSetException {

      final ResultSetDataSet rsds = new ResultSetDataSet();
      rsds.setResultSet(rs.getResultSet(), _dialectType);

      GUIUtils.processOnSwingEventThread(
          new Runnable() {
            public void run() {
              updateExplainTab(info, model, rsds);
            }
          });
    }
Пример #6
0
  /**
   * Initialize the dialog to ask the user to wait, because the query can take a while, but only if
   * the ObjectTreeTab is selected.
   *
   * @param stmt the Statement to cancel.
   */
  private void showWaitDialog(final Statement stmt) {

    if (!_prefs.getShowPleaseWaitDialog()) return;

    // Only do this if the object tree
    // (and hence this contents tab) is visible.
    if (objectTreeTabIsSelected()) {

      // Save off selections so that selection/focus can be restored
      // later.
      _treePanel.saveSelectedPaths();

      GUIUtils.processOnSwingEventThread(
          new Runnable() {
            public void run() {
              _waitDialog = new PleaseWaitDialog(stmt, _app);
              _waitDialog.showDialog(_app);
              // Restore the paths
              _treePanel.restoreSavedSelectedPaths();
            }
          });
    }
  }