protected Object openDialogBox(Control cellEditorWindow) {
      ValueDialog vd = new ValueDialog(cellEditorWindow.getShell());
      vd.setValue((DatabaseQuerySettingsStructure.DataMapping) this.getValue());
      vd.open();

      return this.getValue();
    }
예제 #2
0
 /**
  * Prompt the user for a value
  *
  * @param component The component to use as parent for the prompting dialog
  * @param description The description of the value being prompted for
  * @return True if the value was configured
  */
 public boolean showValueDialog(final JComponent component, String description) {
   ValueDialog dialog = new ValueDialog(component, name, description);
   dialog.setTitle(name);
   dialog.setLocationRelativeTo(null);
   EventQueue.invokeLater(
       new Runnable() {
         @Override
         public void run() {
           JComponent focusComponent = component;
           if (focusComponent instanceof JSpinner)
             focusComponent =
                 ((JSpinner.DefaultEditor) ((JSpinner) component).getEditor()).getTextField();
           focusComponent.requestFocusInWindow();
         }
       });
   dialog.setVisible(true);
   return dialog.okPressed;
 }