Package com.eviware.x.impl.swing

Examples of com.eviware.x.impl.swing.JComboBoxFormField


    @Override
    public void actionPerformed( ActionEvent arg0 )
    {
      XFormDialog dialog = ADialogBuilder.buildDialog( AddParameterActionDialog.class );
      JComboBoxFormField chooser = ( JComboBoxFormField )dialog.getFormField( AddParameterActionDialog.TYPE );
      chooser.setOptions( typeMap.keySet().toArray( new String[0] ) );
      if( dialog.show() )
      {
        model.addNewType( typeMap.get( chooser.getValue() ), dialog.getValue( AddParameterActionDialog.VALUE ) );
      }
    }
View Full Code Here


    addAndCopy.setDialog( dialog );

    final JTextFieldFormField labelField = ( JTextFieldFormField )dialog.getFormField( AddParameterDialog.LABEL );
    labelField.getComponent().setColumns( 30 );
    labelField.setEnabled( false );
    JComboBoxFormField nameField = ( JComboBoxFormField )dialog.getFormField( AddParameterDialog.NAME );
    enablePathField( false );
    nameField.addFormFieldListener( new XFormFieldListener()
    {

      @Override
      public void valueChanged( XFormField sourceField, String newValue, String oldValue )
      {
        if( !newValue.equals( CHOOSE_TEST_PROPERTY ) )
        {
          labelField.setEnabled( true );
          enablePathField( true );
        }
        else
        {
          labelField.setEnabled( false );
          enablePathField( false );
        }

      }
    } );
    ArrayList<String> options = new ArrayList<String>();
    options.add( CHOOSE_TEST_PROPERTY );
    options.addAll( properties.keySet() );
    nameField.setOptions( options.toArray( new String[0] ) );

    ( ( JFormDialog )dialog ).getDialog().setResizable( false );

    return dialog;
  }
View Full Code Here

    {
      if( dialog != null )
      {
        ( ( SwingXFormDialog )dialog ).setReturnValue( XFormDialog.CANCEL_OPTION );

        JComboBoxFormField nameField = ( JComboBoxFormField )dialog.getFormField( AddParameterDialog.NAME );
        nameField.setSelectedOptions( new Object[] { nameField.getOptions()[0] } );
        dialog.setValue( AddParameterDialog.LABEL, "" );
        pathPane.setText( "" );

        dialog.setVisible( false );
      }
View Full Code Here

      else
      {
        if( model.addParameter( dialog.getValue( AddParameterDialog.LABEL ),
            dialog.getValue( AddParameterDialog.NAME ), pathPane.getText() ) )
        {
          JComboBoxFormField nameField = ( JComboBoxFormField )dialog.getFormField( AddParameterDialog.NAME );
          nameField.setSelectedOptions( new Object[] { nameField.getOptions()[0] } );
          dialog.setValue( AddParameterDialog.LABEL, "" );
          pathPane.setText( "" );
        }
        else
          UISupport.showErrorMessage( "Label have to be unique!" );
View Full Code Here

        }

        @Override
        public void actionPerformed(ActionEvent arg0) {
            XFormDialog dialog = ADialogBuilder.buildDialog(AddParameterActionDialog.class);
            JComboBoxFormField chooser = (JComboBoxFormField) dialog.getFormField(AddParameterActionDialog.TYPE);
            chooser.setOptions(typeMap.keySet().toArray(new String[0]));
            if (dialog.show()) {
                model.addNewType(typeMap.get(chooser.getValue()), dialog.getValue(AddParameterActionDialog.VALUE));
            }
        }
View Full Code Here

        addAndCopy.setDialog(dialog);

        final JTextFieldFormField labelField = (JTextFieldFormField) dialog.getFormField(AddParameterDialog.LABEL);
        labelField.getComponent().setColumns(30);
        labelField.setEnabled(false);
        JComboBoxFormField nameField = (JComboBoxFormField) dialog.getFormField(AddParameterDialog.NAME);
        enablePathField(false);
        nameField.addFormFieldListener(new XFormFieldListener() {

            @Override
            public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
                if (!newValue.equals(CHOOSE_TEST_PROPERTY)) {
                    labelField.setEnabled(true);
                    enablePathField(true);
                } else {
                    labelField.setEnabled(false);
                    enablePathField(false);
                }

            }
        });
        ArrayList<String> options = new ArrayList<String>();
        options.add(CHOOSE_TEST_PROPERTY);
        options.addAll(properties.keySet());
        nameField.setOptions(options.toArray(new String[0]));

        ((JFormDialog) dialog).getDialog().setResizable(false);

        return dialog;
    }
View Full Code Here

        @Override
        public void actionPerformed(ActionEvent e) {
            if (dialog != null) {
                ((SwingXFormDialog) dialog).setReturnValue(XFormDialog.CANCEL_OPTION);

                JComboBoxFormField nameField = (JComboBoxFormField) dialog.getFormField(AddParameterDialog.NAME);
                nameField.setSelectedOptions(new Object[]{nameField.getOptions()[0]});
                dialog.setValue(AddParameterDialog.LABEL, "");
                pathPane.setText("");

                dialog.setVisible(false);
            }
View Full Code Here

                    || dialog.getValue(AddParameterDialog.LABEL).trim().length() == 0) {
                UISupport.showErrorMessage("Label is required!");
            } else {
                if (model.addParameter(dialog.getValue(AddParameterDialog.LABEL),
                        dialog.getValue(AddParameterDialog.NAME), pathPane.getText())) {
                    JComboBoxFormField nameField = (JComboBoxFormField) dialog.getFormField(AddParameterDialog.NAME);
                    nameField.setSelectedOptions(new Object[]{nameField.getOptions()[0]});
                    dialog.setValue(AddParameterDialog.LABEL, "");
                    pathPane.setText("");
                } else {
                    UISupport.showErrorMessage("Label have to be unique!");
                }
View Full Code Here

        }
        request.setSelectedAuthProfileAndAuthType(profileName, authTypeEnum);
    }

    private void setAuthTypeComboBoxOptions(XFormDialog dialog, List<String> options) {
        JComboBoxFormField authTypesComboBox = (JComboBoxFormField) dialog.getFormField(AuthorizationTypeForm.AUTHORIZATION_TYPE);
        authTypesComboBox.setOptions(options.toArray(new String[options.size()]));
        authTypesComboBox.addFormFieldListener(new XFormFieldListener() {
            @Override
            public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
                setProfileNameAndHintTextVisibility(newValue);
            }
        });
View Full Code Here

TOP

Related Classes of com.eviware.x.impl.swing.JComboBoxFormField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.