Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder


  public SimpleForm getForm()
  {
    if( editorForm == null )
    {
      ButtonBarBuilder builder = new ButtonBarBuilder();
      editorFontTextField = new JTextField( 20 );
      editorFontTextField.setEnabled( false );
      builder.addFixed( editorFontTextField );
      builder.addRelatedGap();
      builder.addFixed( new JButton( new AbstractAction( "Select Font.." )
      {
        public void actionPerformed( ActionEvent e )
        {
          Font font = JFontChooser.showDialog( UISupport.getMainFrame(), "Select XML Editor Font",
              Font.decode( editorFontTextField.getText() ) );

          if( font != null )
            editorFontTextField.setText( encodeFont( font ) );
        }
      } ) );

      editorForm = new SimpleForm();
      editorForm.addSpace( 5 );
      editorForm.append( "Editor Font", builder.getPanel() );
      editorForm.appendSeparator();
      editorForm.appendCheckBox( XML_LINE_NUMBERS, "Show line numbers in XML editors by default", true );
      editorForm.appendCheckBox( GROOVY_LINE_NUMBERS, "Show line numbers in Groovy editors by default", true );
      editorForm.appendSeparator();
      editorForm.appendCheckBox( NO_RESIZE_REQUEST_EDITOR, "Disables automatic resizing of Request editors", true );
View Full Code Here


    querySplit.setDividerLocation( 0.3 );
  }

  private JPanel createToolbar()
  {
    ButtonBarBuilder builder = new ButtonBarBuilder();

    JButton runButton = UISupport.createToolbarButton( new RunAction() );
    builder.addFixed( runButton );
    builder.addRelatedGap();
    JButton declareNsButton = UISupport.createToolbarButton( new DeclareNSAction() );
    builder.addFixed( declareNsButton );
    builder.setBorder( BorderFactory.createEmptyBorder( 3, 3, 3, 3 ) );
    return builder.getPanel();
  }
View Full Code Here

  public FileFormField( String tooltip, FieldType type )
  {
    super( new JPanel() );
    this.type = type;

    ButtonBarBuilder builder = new ButtonBarBuilder( getComponent() );
    textField = new JUndoableTextField( 30 );
    textField.setToolTipText( tooltip );
    builder.addGriddedGrowing( textField );
    builder.addRelatedGap();
    selectDirectoryButton = new JButton( new SelectDirectoryAction() );
    builder.addFixed( selectDirectoryButton );

    textField.getDocument().addDocumentListener( new DocumentListenerAdapter()
    {

      @Override
View Full Code Here

    options.add( optionsPanel );
    options.add( radios );
    options.setBorder( BorderFactory.createEmptyBorder( 0, 8, 0, 8 ) );

    // create buttons
    ButtonBarBuilder builder = new ButtonBarBuilder();
    findButton = new JButton( new FindAction() );
    builder.addFixed( findButton );
    builder.addRelatedGap();
    replaceButton = new JButton( new ReplaceAction() );
    builder.addFixed( replaceButton );
    builder.addRelatedGap();
    replaceAllButton = new JButton( new ReplaceAllAction() );
    builder.addFixed( replaceAllButton );
    builder.addUnrelatedGap();
    builder.addFixed( new JButton( new CloseAction() ) );
    builder.setBorder( BorderFactory.createEmptyBorder( 8, 8, 8, 8 ) );

    // tie it up!
    panel.add( inputPanel, BorderLayout.NORTH );
    panel.add( options, BorderLayout.CENTER );
    panel.add( builder.getPanel(), BorderLayout.SOUTH );

    dialog.getContentPane().add( panel );
    dialog.pack();
    UISupport.initDialogActions( dialog, null, findButton );
  }
View Full Code Here

  public JComponent getConfigurationPanel()
  {
    if( configPanel == null )
    {
      ButtonBarBuilder builder = new ButtonBarBuilder();

      testDelayField = new JTextField( 5 );
      UISupport.setPreferredHeight( testDelayField, 18 );
      testDelayField.setHorizontalAlignment( JTextField.RIGHT );
      testDelayField.setText( String.valueOf( testDelay ) );
      testDelayField.setToolTipText( "Sets the delay between each test run in milliseconds" );
      testDelayField.getDocument().addDocumentListener( new ConfigDocumentListener() );

      builder.addFixed( new JLabel( "Test Delay" ) );
      builder.addRelatedGap();

      builder.addFixed( testDelayField );
      builder.addRelatedGap();

      randomFactorField = new JTextField( 4 );
      UISupport.setPreferredHeight( randomFactorField, 18 );
      randomFactorField.setHorizontalAlignment( JTextField.RIGHT );
      randomFactorField.setText( String.valueOf( randomFactor ) );
      randomFactorField
          .setToolTipText( "Specifies the relative amount of randomization for delay (0 = no random, 1 = all random)" );
      randomFactorField.getDocument().addDocumentListener( new ConfigDocumentListener() );

      builder.addFixed( new JLabel( "Random" ) );
      builder.addRelatedGap();
      builder.addFixed( randomFactorField );

      configPanel = builder.getPanel();
    }

    return configPanel;
  }
View Full Code Here

  public JComponent getConfigurationPanel()
  {
    if( configPanel == null )
    {
      ButtonBarBuilder builder = new ButtonBarBuilder();

      startThreadCountSpinnerNumberModel = new SpinnerNumberModel( startThreadCount, 1, 10000, 1 );
      startThreadCountSpinner = new JSpinner( startThreadCountSpinnerNumberModel );
      UISupport.setPreferredHeight( startThreadCountSpinner, 18 );
      startThreadCountSpinner.setToolTipText( "Sets the initial thread-count" );
      startThreadCountSpinnerNumberModel.addChangeListener( new ChangeListener()
      {

        public void stateChanged( ChangeEvent e )
        {
          startThreadCount = startThreadCountSpinnerNumberModel.getNumber().intValue();
          notifyConfigurationChanged();
        }
      } );

      builder.addFixed( new JLabel( "Start Threads" ) );
      builder.addRelatedGap();

      builder.addFixed( startThreadCountSpinner );
      builder.addRelatedGap();

      endThreadCountSpinnerNumberModel = new SpinnerNumberModel( endThreadCount, 1, 10000, 1 );
      endThreadCountSpinner = new JSpinner( endThreadCountSpinnerNumberModel );
      UISupport.setPreferredHeight( endThreadCountSpinner, 18 );
      endThreadCountSpinner.setToolTipText( "Sets the final thread-count" );
      endThreadCountSpinnerNumberModel.addChangeListener( new ChangeListener()
      {

        public void stateChanged( ChangeEvent e )
        {
          endThreadCount = endThreadCountSpinnerNumberModel.getNumber().intValue();
          notifyConfigurationChanged();
        }
      } );

      builder.addFixed( new JLabel( "End Threads" ) );
      builder.addRelatedGap();
      builder.addFixed( endThreadCountSpinner );

      configPanel = builder.getPanel();

      stateDependantComponents.add( startThreadCountSpinner );
      stateDependantComponents.add( endThreadCountSpinner );
    }
View Full Code Here

    splitPane.setDividerLocation( 150 );
    splitPane.setBorder( BorderFactory.createEmptyBorder( 0, 1, 0, 1 ) );

    contentPanel.add( splitPane, BorderLayout.CENTER );

    ButtonBarBuilder builder = new ButtonBarBuilder();

    ShowOnlineHelpAction showOnlineHelpAction = new ShowOnlineHelpAction( HelpUrls.XPATHASSERTIONEDITOR_HELP_URL );
    builder.addFixed( UISupport.createToolbarButton( showOnlineHelpAction ) );
    builder.addGlue();

    JButton okButton = new JButton( new OkAction() );
    builder.addFixed( okButton );
    builder.addRelatedGap();
    builder.addFixed( new JButton( new CancelAction() ) );

    builder.setBorder( BorderFactory.createEmptyBorder( 1, 5, 5, 5 ) );

    contentPanel.add( builder.getPanel(), BorderLayout.SOUTH );

    configurationDialog.setContentPane( contentPanel );
    configurationDialog.setSize( 800, 500 );
    configurationDialog.setModal( true );
    UISupport.initDialogActions( configurationDialog, showOnlineHelpAction, okButton );
View Full Code Here

      return showOnlineHelpAction;
    }

    private Component buildStatusBar()
    {
      ButtonBarBuilder builder = new ButtonBarBuilder();

      showOnlineHelpAction = new ShowOnlineHelpAction( HelpUrls.GROOVYASSERTION_HELP_URL );
      builder.addFixed( UISupport.createToolbarButton( showOnlineHelpAction ) );
      builder.addGlue();
      okButton = new JButton( new OkAction() );
      builder.addFixed( okButton );
      builder.addRelatedGap();
      builder.addFixed( new JButton( new CancelAction() ) );
      builder.setBorder( BorderFactory.createEmptyBorder( 0, 3, 3, 3 ) );
      return builder.getPanel();
    }
View Full Code Here

  public JComponent getConfigurationPanel()
  {
    if( configPanel == null )
    {
      ButtonBarBuilder builder = new ButtonBarBuilder();

      intervalField = new JTextField( 4 );
      UISupport.setPreferredHeight( intervalField, 18 );
      intervalField.setHorizontalAlignment( JTextField.RIGHT );
      intervalField.setText( String.valueOf( interval / 1000 ) );
      intervalField.setToolTipText( "Sets the interval between variances in seconds" );
      intervalField.getDocument().addDocumentListener( new DocumentListenerAdapter()
      {

        public void update( Document doc )
        {
          try
          {
            interval = Long.parseLong( intervalField.getText() ) * 1000;
            notifyConfigurationChanged();
          }
          catch( NumberFormatException e )
          {
          }
        }
      } );

      builder.addFixed( new JLabel( "Interval" ) );
      builder.addRelatedGap();

      builder.addFixed( intervalField );
      builder.addRelatedGap();

      varianceField = new JTextField( 3 );
      UISupport.setPreferredHeight( varianceField, 18 );
      varianceField.setHorizontalAlignment( JTextField.RIGHT );
      varianceField.setText( String.valueOf( variance ) );
      varianceField.setToolTipText( "Specifies the relative magnitude of a variance" );
      varianceField.getDocument().addDocumentListener( new DocumentListenerAdapter()
      {

        public void update( Document doc )
        {
          try
          {
            variance = Float.parseFloat( varianceField.getText() );
            notifyConfigurationChanged();
          }
          catch( NumberFormatException e )
          {
          }
        }
      } );

      builder.addFixed( new JLabel( "Variance" ) );
      builder.addRelatedGap();
      builder.addFixed( varianceField );
      builder.addRelatedGap();

      infoLabel = new JLabel();
      builder.addFixed( infoLabel );

      configPanel = builder.getPanel();

      stateDependantComponents.add( intervalField );
      stateDependantComponents.add( varianceField );
    }

View Full Code Here

    splitPane.setDividerLocation( 150 );
    splitPane.setBorder( BorderFactory.createEmptyBorder( 0, 1, 0, 1 ) );

    contentPanel.add( splitPane, BorderLayout.CENTER );

    ButtonBarBuilder builder = new ButtonBarBuilder();

    ShowOnlineHelpAction showOnlineHelpAction = new ShowOnlineHelpAction( HelpUrls.XQUERYASSERTIONEDITOR_HELP_URL );
    builder.addFixed( UISupport.createToolbarButton( showOnlineHelpAction ) );
    builder.addGlue();

    JButton okButton = new JButton( new OkAction() );
    builder.addFixed( okButton );
    builder.addRelatedGap();
    builder.addFixed( new JButton( new CancelAction() ) );

    builder.setBorder( BorderFactory.createEmptyBorder( 1, 5, 5, 5 ) );

    contentPanel.add( builder.getPanel(), BorderLayout.SOUTH );

    configurationDialog.setContentPane( contentPanel );
    configurationDialog.setSize( 600, 500 );
    configurationDialog.setModal( true );
    UISupport.initDialogActions( configurationDialog, showOnlineHelpAction, okButton );
View Full Code Here

TOP

Related Classes of com.jgoodies.forms.builder.ButtonBarBuilder

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.