private AppEngineSupportConfigurable(FrameworkSupportModel model) {
      super(AppEngineSupportProvider.this, model);
      mySdkEditor = new AppEngineSdkEditor(model.getProject());
      mySdkPanel.add(
          LabeledComponent.create(mySdkEditor.getMainComponent(), "Google App Engine SDK:"),
          BorderLayout.CENTER);
      PersistenceApiComboboxUtil.setComboboxModel(myPersistenceApiComboBox, true);
      if (model.isFrameworkSelected(JPA_PROVIDER_ID)) {
        myPersistenceApiComboBox.setSelectedItem(PersistenceApi.JPA.getDisplayName());
      }
      model.addFrameworkListener(this);

      myErrorLabel = new HyperlinkLabel();
      myErrorLabel.setIcon(AllIcons.RunConfigurations.ConfigurationWarning);
      myErrorLabel.setVisible(false);
      myErrorLabel.setHyperlinkTarget(AppEngineSdkUtil.APP_ENGINE_DOWNLOAD_URL);
      myErrorPanel.add(BorderLayout.CENTER, myErrorLabel);

      final Component component = mySdkEditor.getComboBox().getEditor().getEditorComponent();
      if (component instanceof JTextComponent) {
        ((JTextComponent) component)
            .getDocument()
            .addDocumentListener(
                new DocumentAdapter() {
                  @Override
                  protected void textChanged(DocumentEvent e) {
                    checkSdk();
                  }
                });
      }
      checkSdk();
    }
Ejemplo n.º 2
0
  protected void attachTo(Component jc) {
    if (extListener != null && extListener.accept(jc)) {
      extListener.startListeningTo(jc, extNotifier);
      listenedTo.add(jc);
      if (wizardPage.getMapKeyFor(jc) != null) {
        wizardPage.maybeUpdateMap(jc);
      }
      return;
    }
    if (isProbablyAContainer(jc)) {
      attachToHierarchyOf((Container) jc);
    } else if (jc instanceof JList) {
      listenedTo.add(jc);
      ((JList) jc).addListSelectionListener(this);
    } else if (jc instanceof JComboBox) {
      ((JComboBox) jc).addActionListener(this);
    } else if (jc instanceof JTree) {
      listenedTo.add(jc);
      ((JTree) jc).getSelectionModel().addTreeSelectionListener(this);
    } else if (jc instanceof JToggleButton) {
      ((AbstractButton) jc).addItemListener(this);
    } else if (jc
        instanceof JFormattedTextField) { // JFormattedTextField must be tested before JTextCompoent
      jc.addPropertyChangeListener("value", this);
    } else if (jc instanceof JTextComponent) {
      listenedTo.add(jc);
      ((JTextComponent) jc).getDocument().addDocumentListener(this);
    } else if (jc instanceof JColorChooser) {
      listenedTo.add(jc);
      ((JColorChooser) jc).getSelectionModel().addChangeListener(this);
    } else if (jc instanceof JSpinner) {
      ((JSpinner) jc).addChangeListener(this);
    } else if (jc instanceof JSlider) {
      ((JSlider) jc).addChangeListener(this);
    } else if (jc instanceof JTable) {
      listenedTo.add(jc);
      ((JTable) jc).getSelectionModel().addListSelectionListener(this);
    } else {
      if (logger.isLoggable(Level.FINE)) {
        logger.fine(
            "Don't know how to listen to a "
                + // NOI18N
                jc.getClass().getName());
      }
    }

    if (accept(jc) && !(jc instanceof JPanel)) {
      jc.addPropertyChangeListener("name", this);
      if (wizardPage.getMapKeyFor(jc) != null) {
        wizardPage.maybeUpdateMap(jc);
      }
    }

    if (logger.isLoggable(Level.FINE) && accept(jc)) {
      logger.fine("Begin listening to " + jc); // NOI18N
    }
  }