コード例 #1
0
  public WsdlRunTestCaseStepDesktopPanel(WsdlRunTestCaseTestStep modelItem) {
    super(modelItem);

    project = getModelItem().getTestCase().getTestSuite().getProject();

    getModelItem().addPropertyChangeListener(WsdlRunTestCaseTestStep.TARGET_TESTCASE, this);
    WsdlTestCase targetTestCase = getModelItem().getTargetTestCase();
    if (targetTestCase != null) {
      targetTestCase.addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
      targetTestCase.getTestSuite().addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
    }

    buildUI();
    setEnabledState();

    if (modelItem.getTargetTestCase() == null) {
      SwingUtilities.invokeLater(
          new Runnable() {

            public void run() {
              optionsAction.actionPerformed(null);
            }
          });
    }

    setPreferredSize(new Dimension(400, 600));
  }
コード例 #2
0
  public void propertyChange(PropertyChangeEvent evt) {
    super.propertyChange(evt);

    if (evt.getPropertyName().equals(WsdlRunTestCaseTestStep.TARGET_TESTCASE)) {
      WsdlTestCase targetTestCase = (WsdlTestCase) evt.getOldValue();
      if (targetTestCase != null) {
        targetTestCase.removePropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
        targetTestCase
            .getTestSuite()
            .removePropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
      }

      targetTestCase = (WsdlTestCase) evt.getNewValue();
      if (targetTestCase != null) {
        targetTestCase.addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
        targetTestCase.getTestSuite().addPropertyChangeListener(WsdlTestCase.NAME_PROPERTY, this);
      }
    }

    setEnabledState();
    titledBorder.setTitle(createTitleForBorder());
    repaint();
  }