Beispiel #1
0
  protected void initWSDL(StringToStringMap values, WsdlInterface iface) {
    boolean cached = iface.isCached();
    if (useCached != null) useCached.setEnabled(cached);

    if (!values.containsKey(CACHED_WSDL)) values.put(CACHED_WSDL, Boolean.toString(cached));

    if (values.getBoolean(CACHED_WSDL) || !values.hasValue(WSDL))
      values.put(WSDL, PathUtils.expandPath(iface.getDefinition(), iface));
  }
  protected XFormDialog buildDialog(Interface modelItem) {
    XFormDialogBuilder builder = XFormFactory.createDialogBuilder("JBossWS Artifacts");

    XForm mainForm = builder.createForm("Basic");
    addWSDLFields(mainForm, modelItem);

    mainForm.addTextField(
        OUTPUT, "The root directory for all emitted files.", XForm.FieldType.PROJECT_FOLDER);
    mainForm.addTextField(MAPPING, "mapping file to generate", XForm.FieldType.PROJECT_FILE);
    mainForm.addCheckBox(UNWRAP, "unwrap doc-literal operations");

    mainForm.addNameSpaceTable(NAMESPACE_MAPPING, modelItem);

    mainForm.addSeparator("webservices.xml generation options");
    ejbLinkField =
        mainForm.addTextField(
            EJB_LINK,
            "The ejb-jar.xml ejb-link for Stateless Session Bean endpoints",
            XForm.FieldType.TEXT);
    ejbLinkField.addFormFieldListener(
        new XFormFieldListener() {
          public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
            servletLinkField.setEnabled(newValue.length() == 0);
            appendField.setEnabled(newValue.length() > 0);
          }
        });

    servletLinkField =
        mainForm.addTextField(
            SERVLET_LINK,
            "The web.xml servlet-link that is used by Java Service Endpoints (WAR)",
            XForm.FieldType.TEXT);
    servletLinkField.addFormFieldListener(
        new XFormFieldListener() {
          public void valueChanged(XFormField sourceField, String newValue, String oldValue) {
            ejbLinkField.setEnabled(newValue.length() == 0);
            appendField.setEnabled(newValue.length() > 0);
          }
        });

    appendField = mainForm.addCheckBox(APPEND, "append to existing file");
    appendField.setEnabled(false);
    buildArgsForm(builder, false, "wstools");

    ActionList actions = buildDefaultActions(HelpUrls.WSTOOLS_HELP_URL, modelItem);
    actions.addAction(
        new JBossWSShowConfigFileAction(
            "JBossWS Wsdl2Java", "Contents of generated wsconfig.xml file", modelItem));
    return builder.buildDialog(
        actions,
        "Specify arguments for JBossWS wstools wsdl2java functionality",
        UISupport.TOOL_ICON);
  }
Beispiel #3
0
  protected void addWSDLFields(XForm mainForm, T modelItem) {
    if (!fixedWSDL) {
      XFormTextField tf = mainForm.addTextField(WSDL, "url to wsdl", XForm.FieldType.URL);

      if (modelItem instanceof Interface) {
        useCached = mainForm.addCheckBox(CACHED_WSDL, null);
        useCached.addComponentEnabler(tf, "false");
      }
    } else {
      if (modelItem instanceof Interface) {
        useCached = mainForm.addCheckBox(CACHED_WSDL, null);
      }
    }
  }
  @Override
  protected StringToStringMap initValues(Interface modelItem, Object param) {
    StringToStringMap values = super.initValues(modelItem, param);

    boolean hasEjbLink = values.get(EJB_LINK, "").length() > 0;
    boolean hasServletLink = values.get(SERVLET_LINK, "").length() > 0;

    if (!hasEjbLink && !hasServletLink) {
      ejbLinkField.setEnabled(true);
      servletLinkField.setEnabled(true);
    } else {
      ejbLinkField.setEnabled(hasEjbLink && !hasServletLink);
      servletLinkField.setEnabled(hasServletLink && !hasEjbLink);

      if (hasEjbLink && hasServletLink) values.put(SERVLET_LINK, "");
    }

    appendField.setEnabled(hasEjbLink || hasServletLink);

    return values;
  }
Beispiel #5
0
 public void setFormFieldProperty(String name, Object value) {
   for (XFormField field : components.values()) {
     field.setProperty(name, value);
   }
 }
Beispiel #6
0
 public String getComponentValue(String name) {
   XFormField component = getComponent(name);
   return component == null ? null : component.getValue();
 }
Beispiel #7
0
 public void setComponentValue(String label, String value) {
   XFormField component = getComponent(label);
   if (component != null) component.setValue(value);
 }