예제 #1
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)));
    }
예제 #2
0
  protected Component buildToolbar() {
    JXToolBar toolbar = UISupport.createToolbar();

    addMediaTypeCombo(toolbar);
    toolbar.addSeparator();

    addPostQueryCheckBox(toolbar);

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

    return toolbar;
  }
  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;
  }
  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;
  }
  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;
  }