private Component buildToolbar() {
    JXToolBar toolbar = UISupport.createToolbar();

    toolbar.add(UISupport.createToolbarButton(runAction = new RunAction()));
    toolbar.add(UISupport.createToolbarButton(cancelAction = new CancelRunTestCaseAction(), false));
    toolbar.add(UISupport.createToolbarButton(optionsAction = new OptionsAction()));
    toolbar.add(UISupport.createToolbarButton(openTestCaseAction = new OpenTestCaseAction()));

    toolbar.addGlue();
    toolbar.add(
        UISupport.createToolbarButton(new ShowOnlineHelpAction(HelpUrls.RUNTESTCASESTEP_HELP_URL)));

    return toolbar;
  }
Пример #2
0
  @Override
  protected void insertButtons(JXToolBar toolbar) {
    toolbar.add(addToTestCaseButton);

    JPanel methodPanel = addMethodCombo();
    toolbar.addWithOnlyMinimumHeight(methodPanel);
  }
  public JPanel getForm() {
    if (sensitiveInfoTableForm == null) {
      sensitiveInfoTableForm = new JPanel(new BorderLayout());

      JXToolBar toolbar = UISupport.createToolbar();

      toolbar.add(UISupport.createToolbarButton(new AddTokenAction()));
      toolbar.add(UISupport.createToolbarButton(new RemoveTokenAction()));

      tokenTable = JTableFactory.getInstance().makeJXTable(sensitiveInformationTableModel);
      tokenTable.setPreferredSize(new Dimension(200, 100));
      sensitiveInfoTableForm.add(toolbar, BorderLayout.NORTH);
      sensitiveInfoTableForm.add(new JScrollPane(tokenTable), BorderLayout.CENTER);
    }

    return sensitiveInfoTableForm;
  }
Пример #4
0
  private void addResourceAndQueryField(JXToolBar toolbar) {
    if (!(getRequest() instanceof RestTestRequestInterface)) {

      toolbar.addWithOnlyMinimumHeight(resourcePanel);

      toolbar.add(Box.createHorizontalStrut(4));

      toolbar.addWithOnlyMinimumHeight(queryPanel);
    }
  }
Пример #5
0
  public <T extends JComponent> T addFixed(T component) {
    if (!(component instanceof JButton)) UISupport.setPreferredHeight(component, 18);

    Dimension preferredSize = component.getPreferredSize();
    component.setMinimumSize(preferredSize);
    component.setMaximumSize(preferredSize);

    add(component);

    return component;
  }
  private JComponent buildScriptToolbar() {
    JXToolBar toolBar = UISupport.createToolbar();
    JButton runButton = UISupport.createToolbarButton(runScriptAction);
    toolBar.add(runButton);
    toolBar.add(Box.createHorizontalGlue());
    JLabel label =
        new JLabel(
            "<html>Script is invoked with <code>log</code>, <code>context</code>, "
                + "<code>requestContext</code>, <code>mockRequest</code> and <code>mockResponse</code> variables</html>");
    label.setToolTipText(label.getText());
    label.setMaximumSize(label.getPreferredSize());

    toolBar.add(label);
    toolBar.addUnrelatedGap();
    toolBar.addFixed(
        UISupport.createActionButton(
            new ShowOnlineHelpAction(mockResponse.getScriptHelpUrl()), true));

    return toolBar;
  }
Пример #7
0
  @Override
  protected Component buildContent() {
    JPanel mainPanel = new JPanel(new BorderLayout());
    JSplitPane splitPane =
        UISupport.createHorizontalSplit(buildCategoriesList(), buildAssertionsList());
    splitPane.setDividerLocation(220);
    getAssertionsTable().setSelectable(true);
    JXToolBar toolbar = UISupport.createSmallToolbar();
    hideDescCB = new JCheckBox("Hide descriptions");
    hideDescCB.setOpaque(false);
    hideDescCB.addItemListener(hideDescListener);
    hideDescCB.setSelected(
        SoapUI.getSettings().getBoolean(AssertionDescriptionSettings.SHOW_ASSERTION_DESCRIPTION));
    toolbar.add(new JLabel("Assertions"));
    toolbar.addGlue();
    toolbar.add(hideDescCB);

    mainPanel.add(toolbar, BorderLayout.NORTH);
    mainPanel.add(splitPane, BorderLayout.CENTER);
    return mainPanel;
  }
Пример #8
0
  private Component buildToolbar() {
    toolbar = UISupport.createSmallToolbar();

    if (holder instanceof MutableTestPropertyHolder) {
      removePropertyAction = new RemovePropertyAction();
      MutableTestPropertyHolder mutablePropertyHolder = (MutableTestPropertyHolder) holder;
      addPropertyAction =
          new AddParamAction(
              propertiesTable, mutablePropertyHolder, "Adds a property to the property list");
      movePropertyUpAction =
          new MovePropertyUpAction(
              propertiesTable, mutablePropertyHolder, "Moves selected property up one row");
      movePropertyDownAction =
          new MovePropertyDownAction(
              propertiesTable, mutablePropertyHolder, "Moves selected property down one row");

      JButton addPropertyButton = UISupport.createToolbarButton(addPropertyAction);
      toolbar.add(addPropertyButton);
      JButton removePropertyButton = UISupport.createToolbarButton(removePropertyAction);
      toolbar.add(removePropertyButton);

      toolbar.addRelatedGap();
      JButton movePropertyUpButton = UISupport.createToolbarButton(movePropertyUpAction);
      toolbar.add(movePropertyUpButton);
      JButton movePropertyDownButton = UISupport.createToolbarButton(movePropertyDownAction);
      toolbar.add(movePropertyDownButton);

      if (!(holder instanceof AMFRequestTestStep || holder instanceof JdbcRequestTestStep)) {
        toolbar.addRelatedGap();
        toolbar.add(UISupport.createToolbarButton(new SortPropertiesAction()));
        toolbar.addRelatedGap();
      }
    }

    JButton clearPropertiesButton = UISupport.createToolbarButton(new ClearPropertiesAction());
    toolbar.add(clearPropertiesButton);
    JButton loadPropertiesButton = UISupport.createToolbarButton(loadPropertiesAction);
    toolbar.add(loadPropertiesButton);
    toolbar.add(UISupport.createToolbarButton(new SavePropertiesAction()));

    return toolbar;
  }
Пример #9
0
  private JComponent buildToolbar() {
    configureAssertionAction = new ConfigureAssertionAction();
    removeAssertionAction = new RemoveAssertionAction();
    addLoadTestAssertionAction = new AddLoadTestAssertionAction();

    JXToolBar toolbar = UISupport.createSmallToolbar();

    JButton button = UISupport.createToolbarButton(addLoadTestAssertionAction);
    toolbar.addFixed(button);
    button = UISupport.createToolbarButton(removeAssertionAction);
    toolbar.addFixed(button);
    button = UISupport.createToolbarButton(configureAssertionAction);
    toolbar.addFixed(button);
    toolbar.addGlue();
    toolbar.add(new ShowOnlineHelpAction(HelpUrls.LOADTEST_ASSERTIONS_URL));

    return toolbar;
  }
Пример #10
0
 public void addGlue() {
   add(Box.createHorizontalGlue());
 }
  private void buildUI() {
    propertiesTable = createPropertyHolderTable();
    add(propertiesTable, BorderLayout.CENTER);

    JXToolBar toolbar = propertiesTable.getToolbar();

    toolbar.addRelatedGap();
    JButton reloadButton = UISupport.createToolbarButton(new ReloadPropertiesFromSourceAction());
    toolbar.add(reloadButton);

    toolbar.addSeparator();
    toolbar.add(new JLabel("Load from:"));
    sourceField =
        new JTextField(testStep.getSource(), 20) {
          @Override
          public String getToolTipText(MouseEvent event) {
            return testStep.getSource(true);
          }
        };
    sourceField.setToolTipText(
        "The filename/url or referring system-property to load properties from");
    sourceField
        .getDocument()
        .addDocumentListener(
            new DocumentListenerAdapter() {
              public void update(Document document) {
                if (updatingSource) {
                  return;
                }

                updatingSource = true;
                testStep.setSource(sourceField.getText());
                updatingSource = false;
              }
            });

    toolbar.addRelatedGap();
    toolbar.addFixed(sourceField);
    JButton setSourceButton = UISupport.createToolbarButton(new SetPropertiesSourceAction());
    toolbar.addRelatedGap();
    toolbar.add(setSourceButton);

    toolbar.addSeparator();
    toolbar.add(new JLabel("Save to:"));
    targetField =
        new JTextField(testStep.getTarget(), 20) {
          @Override
          public String getToolTipText(MouseEvent event) {
            return testStep.getTarget(true);
          }
        };

    targetField.setToolTipText(
        "The filename/url or referring system-property to save properties to");
    targetField
        .getDocument()
        .addDocumentListener(
            new DocumentListenerAdapter() {
              public void update(Document document) {
                if (updatingTarget) {
                  return;
                }

                updatingTarget = true;
                testStep.setTarget(targetField.getText());
                updatingTarget = false;
              }
            });

    toolbar.addRelatedGap();
    toolbar.addFixed(targetField);
    JButton setTargetButton = UISupport.createToolbarButton(new SetPropertiesTargetAction());
    toolbar.addRelatedGap();
    toolbar.add(setTargetButton);

    toolbar.add(Box.createHorizontalGlue());
    toolbar.addSeparator();
    toolbar.add(
        UISupport.createToolbarButton(
            new ShowOnlineHelpAction(HelpUrls.PROPERTIESSTEPEDITOR_HELP_URL)));

    componentEnabler.add(sourceField);
    componentEnabler.add(targetField);
    componentEnabler.add(setTargetButton);
    componentEnabler.add(setSourceButton);
    componentEnabler.add(propertiesTable);

    setPreferredSize(new Dimension(600, 400));
  }
 protected void insertButtons(JXToolBar toolbar) {
   toolbar.add(addAssertionButton);
   super.insertButtons(toolbar);
 }