Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder


  private JTextField textField;
  private AbstractWsdlModelItem<?> modelItem;

  public FileFormComponent( String tooltip )
  {
    ButtonBarBuilder builder = new ButtonBarBuilder( this );
    textField = new JTextField( 30 );
    textField.setToolTipText( tooltip );
    builder.addGriddedGrowing( textField );
    builder.addRelatedGap();
    builder.addFixed( new JButton( new SelectFileAction() ) );
  }
View Full Code Here


    caretLabel.setBorder( BorderFactory.createCompoundBorder(
        BorderFactory.createMatteBorder( 0, 1, 0, 0, Color.LIGHT_GRAY ),
        BorderFactory.createMatteBorder( 0, 1, 0, 0, Color.WHITE ) ) );

    ButtonBarBuilder builder = new ButtonBarBuilder( this );
    builder.addGriddedGrowing( infoLabel );
    builder.addStrut( Sizes.pixel( 2 ) );

    statusPanel = new JPanel( new BorderLayout() );
    statusPanel.setPreferredSize( new Dimension( 60, 16 ) );

    statusPanel.setBorder( BorderFactory.createCompoundBorder(
        BorderFactory.createMatteBorder( 0, 1, 0, 0, Color.LIGHT_GRAY ),
        BorderFactory.createMatteBorder( 0, 1, 0, 0, Color.WHITE ) ) );

    builder.addFixed( statusPanel );
    builder.addFixed( caretLabel );
    builder.getPanel();
  }
View Full Code Here

    requestHostFilterCombo = UISupport.setFixedSize( new JComboBox( requestFilterModel ), comboBoxSize );

    // toolbar.addFixed( new JLabel( "<html><b>Filter:</b></html>"));
    // toolbar.addUnrelatedGap();

    ButtonBarBuilder toolbar = new ButtonBarBuilder();

    toolbar.addFixed( new JLabel( "Request Host" ) );
    toolbar.addRelatedGap();
    toolbar.addFixed( requestHostFilterCombo );
    toolbar.addUnrelatedGap();

    requestHostFilterCombo.addItemListener( new ItemListener()
    {
      public void itemStateChanged( ItemEvent e )
      {
        int ix = requestHostFilterCombo.getSelectedIndex();
        if( ix == -1 )
          return;

        requestHostFilter.setAcceptNull( ix == 0 );

        if( ix == 0 )
          requestHostFilter.setPattern( ".*", 0 );
        else
          requestHostFilter.setPattern( requestHostFilterCombo.getSelectedItem().toString(), 0 );

        updateRowCountLabel();
      }
    } );

    toolbar.addFixed( new JLabel( "Target Host" ) );
    toolbar.addRelatedGap();
    targetHostFilterCombo = UISupport.setFixedSize( new JComboBox( targetHostFilterModel ), comboBoxSize );
    toolbar.addFixed( targetHostFilterCombo );
    toolbar.addUnrelatedGap();

    targetHostFilterCombo.addItemListener( new ItemListener()
    {
      public void itemStateChanged( ItemEvent e )
      {
        int ix = targetHostFilterCombo.getSelectedIndex();
        if( ix == -1 )
          return;

        targetHostFilter.setAcceptNull( ix == 0 );

        if( ix == 0 )
          targetHostFilter.setPattern( ".*", 0 );
        else
          targetHostFilter.setPattern( targetHostFilterCombo.getSelectedItem().toString(), 0 );

        updateRowCountLabel();
      }
    } );

    String[] interfaceNames = ModelSupport.getNames( new String[] { ALL_FILTER_OPTION },
        ModelSupport.getChildren( getProject(), WsdlInterface.class ) );

    toolbar.addFixed( new JLabel( "Interface" ) );
    toolbar.addRelatedGap();
    interfaceFilterCombo = UISupport.setFixedSize( new JComboBox( interfaceNames ), comboBoxSize );
    toolbar.addFixed( interfaceFilterCombo );
    toolbar.addUnrelatedGap();

    operationFilterModel = new DefaultComboBoxModel( new String[] { ALL_FILTER_OPTION } );
    interfaceFilterCombo.addItemListener( new ItemListener()
    {
      public void itemStateChanged( ItemEvent e )
      {
        String item = ( String )interfaceFilterCombo.getSelectedItem();
        operationFilterModel.removeAllElements();

        if( item == null || getProject().getInterfaceByName( item ) == null )
        {
          operationFilterModel.addElement( ALL_FILTER_OPTION );
          interfaceFilter.setPattern( ".*", 0 );
        }
        else if( getProject().getInterfaceByName( item ) != null )
        {
          WsdlInterface iface = ( WsdlInterface )getProject().getInterfaceByName( item );
          String[] operationNames = ModelSupport.getNames( new String[] { ALL_FILTER_OPTION },
              iface.getOperationList() );
          for( String s : operationNames )
            operationFilterModel.addElement( s );

          interfaceFilter.setPattern( iface.getName(), 0 );
        }
      }
    } );

    toolbar.addFixed( new JLabel( "Operation" ) );
    toolbar.addRelatedGap();
    operationFilterCombo = UISupport.setFixedSize( new JComboBox( operationFilterModel ), comboBoxSize );
    toolbar.addFixed( operationFilterCombo );

    operationFilterCombo.addItemListener( new ItemListener()
    {
      public void itemStateChanged( ItemEvent e )
      {
        int ix = operationFilterCombo.getSelectedIndex();
        if( ix == -1 )
        {
          operationFilter.setPattern( ".*", 0 );
          updateRowCountLabel();
          return;
        }

        operationFilter.setAcceptNull( ix == 0 );

        if( ix == 0 )
          operationFilter.setPattern( ".*", 0 );
        else
          operationFilter.setPattern( operationFilterCombo.getSelectedItem().toString(), 0 );

        updateRowCountLabel();
      }
    } );

    toolbar.setBorder( BorderFactory.createEmptyBorder( 3, 2, 3, 0 ) );
    return toolbar.getPanel();
  }
View Full Code Here

    return legend;
  }

  private void buildLegend()
  {
    ButtonBarBuilder builder = new ButtonBarBuilder();

    builder.addFixed( new JLabel( "ThreadCount", createLegendIcon( THREADCOUNT_COLOR ), JLabel.LEFT ) );
    builder.addUnrelatedGap();
    builder.addFixed( new JLabel( "Total", createLegendIcon( TOTAL_COLOR ), JLabel.LEFT ) );
    builder.setBorder( BorderFactory.createEmptyBorder( 3, 3, 3, 3 ) );

    legend = builder.getPanel();
  }
View Full Code Here

  private JPanel createExpectedResultField()
  {
    JPanel panel = UISupport.createEmptyPanel( 3, 3, 3, 3 );

    ButtonBarBuilder builder = new ButtonBarBuilder();
    builder.addFixed( new JLabel( "<html><b>Expected Result - Describe the expected outcome</b></html>" ) );
    panel.add( builder.getPanel(), BorderLayout.NORTH );

    expectedResultField = new JUndoableTextArea( getModelItem().getExpectedResult() );
    expectedResultField.getDocument().addDocumentListener( new DocumentListenerAdapter()
    {
      @Override
View Full Code Here

  private ButtonBarBuilder builder;
  private JButton defaultButton;

  public JButtonBar()
  {
    builder = new ButtonBarBuilder( this );
  }
View Full Code Here

      progressBar.setSize( new Dimension( 120, 20 ) );
      progressBar.setStringPainted( true );
      progressBar.setString( "Loading Definition.." );
      progressBar.setIndeterminate( true );

      ButtonBarBuilder builder = ButtonBarBuilder.createLeftToRightBuilder();
      builder.addGlue();
      builder.addFixed( progressBar );
      builder.addGlue();
      builder.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );

      partTabs.addTab( "Loading.. ", builder.getPanel() );
      return true;
    }
View Full Code Here

    getContentPane().add( progressLabel, BorderLayout.NORTH );
    getContentPane().add( panel, BorderLayout.CENTER );

    if( allowCancel )
    {
      ButtonBarBuilder builder = ButtonBarBuilder.createLeftToRightBuilder();
      builder.addGlue();
      cancelButton = new JButton( new CancelAction() );
      builder.addFixed( cancelButton );
      builder.addGlue();
      builder.setBorder( BorderFactory.createEmptyBorder( 0, 10, 10, 10 ) );
      getContentPane().add( builder.getPanel(), BorderLayout.SOUTH );
    }

    pack();
  }
View Full Code Here

      JLabel label = new JLabel( description );
      label.setBorder( BorderFactory.createEmptyBorder( 10, 10, 0, 10 ) );
      getContentPane().add( label, BorderLayout.NORTH );
      getContentPane().add( buildContent(), BorderLayout.CENTER );

      ButtonBarBuilder builder = ButtonBarBuilder.createLeftToRightBuilder();
      builder.addGlue();
      JButton closeButton = new JButton( new CloseAction() );
      builder.addFixed( closeButton );

      builder.setBorder( BorderFactory.createEmptyBorder( 0, 10, 10, 10 ) );
      getContentPane().add( builder.getPanel(), BorderLayout.SOUTH );

      pack();

      UISupport.initDialogActions( this, null, closeButton );
    }
View Full Code Here

    if( showLog )
      getContentPane().add( buildLog(), BorderLayout.CENTER );

    if( allowCancel )
    {
      ButtonBarBuilder builder = ButtonBarBuilder.createLeftToRightBuilder();
      builder.addGlue();
      cancelButton = new JButton( new CancelAction() );
      builder.addFixed( cancelButton );
      builder.addUnrelatedGap();

      if( showLog )
      {
        closeButton = new JButton( new CloseAction() );
        builder.addFixed( closeButton );
      }

      builder.addGlue();

      builder.setBorder( BorderFactory.createEmptyBorder( 0, 10, 10, 10 ) );
      getContentPane().add( builder.getPanel(), BorderLayout.SOUTH );
    }
    else if( showLog )
    {
      ButtonBarBuilder builder = ButtonBarBuilder.createLeftToRightBuilder();
      builder.addGlue();

      closeButton = new JButton( new CloseAction() );
      builder.addFixed( closeButton );
      builder.addGlue();

      builder.setBorder( BorderFactory.createEmptyBorder( 0, 10, 10, 10 ) );
      getContentPane().add( builder.getPanel(), BorderLayout.SOUTH );
    }

    pack();
  }
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.