コード例 #1
0
  @Override
  protected void insertButtons(JXToolBar toolbar) {
    toolbar.add(addToTestCaseButton);

    JPanel methodPanel = addMethodCombo();
    toolbar.addWithOnlyMinimumHeight(methodPanel);
  }
コード例 #2
0
ファイル: WSPartsTable.java プロジェクト: hborham/soapui
  private Component buildToolbar() {
    JXToolBar toolbar = UISupport.createSmallToolbar();

    toolbar.addFixed(UISupport.createToolbarButton(new AddPartAction()));
    removePartButton = UISupport.createToolbarButton(new RemovePartAction());
    toolbar.addFixed(removePartButton);

    return toolbar;
  }
コード例 #3
0
  private void addResourceAndQueryField(JXToolBar toolbar) {
    if (!(getRequest() instanceof RestTestRequestInterface)) {

      toolbar.addWithOnlyMinimumHeight(resourcePanel);

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

      toolbar.addWithOnlyMinimumHeight(queryPanel);
    }
  }
コード例 #4
0
ファイル: Navigator.java プロジェクト: Kondasamy/soapui
  private Component buildToolbar() {
    JXToolBar toolbar = UISupport.createSmallToolbar();

    JToggleButton toggleButton = new JToggleButton(new TogglePropertiesAction());
    toggleButton.setToolTipText("Toggles displaying of Test Properties in tree");
    toggleButton.setSize(10, 12);
    toolbar.addFixed(toggleButton);
    toolbar.addGlue();

    return toolbar;
  }
コード例 #5
0
  protected Component buildToolbar() {
    JXToolBar toolbar = UISupport.createToolbar();

    addMediaTypeCombo(toolbar);
    toolbar.addSeparator();

    addPostQueryCheckBox(toolbar);

    toolbar.setMinimumSize(new Dimension(50, 20));

    return toolbar;
  }
コード例 #6
0
    public SchemaTabs() {
      super();
      conflicts = new JPanel();
      conflicts.setLayout(new BorderLayout());
      auto = new JCheckBox("Auto-Resolve");
      auto.setToolTipText("Automatically modify inferred schema from received Responses");
      auto.setOpaque(false);
      UISupport.setFixedSize(auto, 120, 20);
      XmlBeansSettingsImpl settings = getRequest().getSettings();
      if (settings.isSet(AUTO_INFER_SCHEMAS)) {
        auto.setSelected(settings.getBoolean(AUTO_INFER_SCHEMAS));
      }
      auto.addItemListener(
          new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
              getRequest().getSettings().setBoolean(AUTO_INFER_SCHEMAS, auto.isSelected());
            }
          });
      resolveButton = new JButton("Resolve conflicts");
      resolveButton.setEnabled(false);
      resolveButton.setActionCommand("resolve");
      resolveButton.addActionListener(this);

      JXToolBar toolbar = UISupport.createToolbar();
      toolbar.addFixed(auto);
      toolbar.addFixed(resolveButton);

      log = new JLogList("Schema log");
      conflicts.add(toolbar, BorderLayout.NORTH);
      conflicts.add(log, BorderLayout.CENTER);
      addTab("Conflicts", conflicts);

      schemaList = new JList(InferredSchemaManager.getInferredSchema(service).getNamespaces());
      schemaList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      schemaList.addListSelectionListener(this);

      toolbar = UISupport.createToolbar();
      toolbar.addFixed(UISupport.createToolbarButton(new RemoveNamespaceAction()));

      JPanel listPanel = new JPanel();
      listPanel.setLayout(new BorderLayout());
      listPanel.add(toolbar, BorderLayout.NORTH);
      listPanel.add(new JScrollPane(schemaList), BorderLayout.CENTER);
      xsd = JXEditTextArea.createXmlEditor(false);
      xsd.setEditable(false);
      update();
      addTab(
          "Schemas", new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listPanel, new JScrollPane(xsd)));
    }
コード例 #7
0
  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;
  }
コード例 #8
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;
  }
コード例 #9
0
  protected void addPostQueryCheckBox(JXToolBar toolbar) {
    postQueryCheckBox = new JCheckBox("Post QueryString", httpRequest.isPostQueryString());
    postQueryCheckBox.setToolTipText("Controls if Query-parameters should be put in message body");
    postQueryCheckBox.setOpaque(false);
    postQueryCheckBox.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            httpRequest.setPostQueryString(postQueryCheckBox.isSelected());
            enableBodyComponents();
          }
        });

    postQueryCheckBox.setPreferredSize(new Dimension(130, 20));
    toolbar.addFixed(postQueryCheckBox);
  }
コード例 #10
0
  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;
  }
コード例 #11
0
  protected void addMediaTypeCombo(JXToolBar toolbar) {
    mediaTypeCombo = new JComboBox(getRequestMediaTypes());
    mediaTypeCombo.setPreferredSize(new Dimension(120, 20));
    mediaTypeCombo.setEnabled(httpRequest.hasRequestBody());
    mediaTypeCombo.setEditable(true);
    if (httpRequest.getMediaType() != null)
      mediaTypeCombo.setSelectedItem(httpRequest.getMediaType());

    mediaTypeCombo.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            httpRequest.setMediaType(String.valueOf(mediaTypeCombo.getSelectedItem()));
          }
        });

    toolbar.addLabeledFixed("Media Type", mediaTypeCombo);
  }
コード例 #12
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;
  }
コード例 #13
0
  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;
  }
コード例 #14
0
  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));
  }
コード例 #15
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;
  }
コード例 #16
0
 protected void insertButtons(JXToolBar toolbar) {
   toolbar.add(addAssertionButton);
   super.insertButtons(toolbar);
 }