Example usage for com.jgoodies.binding PresentationModel PresentationModel

List of usage examples for com.jgoodies.binding PresentationModel PresentationModel

Introduction

In this page you can find the example usage for com.jgoodies.binding PresentationModel PresentationModel.

Prototype

public PresentationModel(ValueModel beanChannel) 

Source Link

Document

Constructs a PresentationModel on the given bean channel.

Usage

From source file:com.eviware.soapui.impl.wsdl.support.wss.entries.SignatureEntry.java

License:EUPL

@Override
protected JComponent buildUI() {
    SimpleBindingForm form = new SimpleBindingForm(new PresentationModel<SignatureEntry>(this));
    form.addSpace(5);/*from  w w w. j  av a  2s  .  c o m*/
    wssContainerListener = new InternalWssContainerListener();
    getWssContainer().addWssContainerListener(wssContainerListener);

    form.appendComboBox("crypto", "Keystore",
            new KeystoresComboBoxModel(getWssContainer(), getWssContainer().getCryptoByName(crypto), true),
            "Selects the Keystore containing the key to use for signing").addItemListener(new ItemListener() {

                public void itemStateChanged(ItemEvent e) {
                    keyAliasComboBoxModel.update(getWssContainer().getCryptoByName(crypto));
                }
            });

    keyAliasComboBoxModel = new KeyAliasComboBoxModel(getWssContainer().getCryptoByName(crypto));
    form.appendComboBox("username", "Alias", keyAliasComboBoxModel,
            "The alias for the key to use for encryption");

    form.appendPasswordField("password", "Password", "The certificate password");

    form.appendComboBox("keyIdentifierType", "Key Identifier Type", new Integer[] { 1, 2, 3, 4, 8 },
            "Sets which key identifier to use").setRenderer(new KeyIdentifierTypeRenderer());
    form.appendComboBox("signatureAlgorithm", "Signature Algorithm", new String[] { DEFAULT_OPTION,
            WSConstants.RSA, WSConstants.DSA, XMLSignature.ALGO_ID_MAC_HMAC_SHA1,
            XMLSignature.ALGO_ID_MAC_HMAC_SHA256, XMLSignature.ALGO_ID_MAC_HMAC_SHA384,
            XMLSignature.ALGO_ID_MAC_HMAC_SHA512, XMLSignature.ALGO_ID_MAC_HMAC_RIPEMD160,
            XMLSignature.ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5, XMLSignature.ALGO_ID_SIGNATURE_ECDSA_SHA1,
            XMLSignature.ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5, XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1,
            XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA256, XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA384,
            XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA512, XMLSignature.ALGO_ID_SIGNATURE_RSA_RIPEMD160 },
            "Set the name of the signature encryption algorithm to use");
    form.appendComboBox("signatureCanonicalization", "Signature Canonicalization",
            new String[] { DEFAULT_OPTION, WSConstants.C14N_OMIT_COMMENTS, WSConstants.C14N_WITH_COMMENTS,
                    WSConstants.C14N_EXCL_OMIT_COMMENTS, WSConstants.C14N_EXCL_WITH_COMMENTS },
            "Set the canonicalization method to use.");

    form.appendComboBox("digestAlgorithm", "Digest Algorithm",
            new String[] { DEFAULT_OPTION, MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5,
                    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256,
                    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA384, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA512,
                    MessageDigestAlgorithm.ALGO_ID_DIGEST_RIPEMD160 },
            "Set the digest algorithm to use");

    form.appendCheckBox("useSingleCert", "Use Single Certificate", "Use single certificate for signing");

    form.append("Parts", new WSPartsTable(parts, this));

    return new JScrollPane(form.getPanel());
}

From source file:com.eviware.soapui.impl.wsdl.support.wss.entries.TimestampEntry.java

License:EUPL

@Override
protected JComponent buildUI() {
    SimpleBindingForm form = new SimpleBindingForm(new PresentationModel<TimestampEntry>(this));
    form.addSpace(5);/*from   w w  w.j  a va2s . c  om*/
    form.appendTextField("timeToLive", "Time To Live", "Sets the TimeToLive value for the Timestamp Token");
    form.appendCheckBox("strictTimestamp", "Millisecond Precision",
            "Sets precision of timestamp to milliseconds");

    return form.getPanel();
}

From source file:com.eviware.soapui.impl.wsdl.support.wss.entries.UsernameEntry.java

License:EUPL

@Override
protected JComponent buildUI() {
    SimpleBindingForm form = new SimpleBindingForm(new PresentationModel<UsernameEntry>(this));
    form.addSpace(5);//from  ww w  .  j  a v a 2s.co  m
    form.appendTextField("username", "Username", "The username for this token");
    form.appendPasswordField("password", "Password", "The password for this token");

    form.appendCheckBox("addNonce", "Add Nonce", "Adds a nonce");
    form.appendCheckBox("addCreated", "Add Created", "Adds a created");

    form.appendComboBox("passwordType", "Password Type",
            new String[] { PASSWORD_TEXT, PASSWORD_DIGEST, PASSWORD_DIGEST_EXT },
            "The password type to generate");

    return form.getPanel();
}

From source file:com.eviware.soapui.support.editor.inspectors.aut.RequestAuthenticationInspector.java

License:Open Source License

public JComponent getComponent() {
    if (mainPanel == null) {
        mainPanel = new JPanel(new BorderLayout());

        form = new SimpleBindingForm(new PresentationModel<AbstractHttpRequest<?>>(request));
        form.addSpace(5);//from ww  w. j  av a2s  . c om
        form.appendComboBox("authType", "Authentication Type",
                new String[] { AuthType.GLOBAL_HTTP_SETTINGS.toString(), AuthType.PREEMPTIVE.toString(),
                        AuthType.SPNEGO_KERBEROS.toString(), AuthType.NTLM.toString() },
                "");
        form.appendTextField("username", "Username", "The username to use for HTTP Authentication");
        form.appendPasswordField("password", "Password", "The password to use for HTTP Authentication");
        form.appendTextField("domain", "Domain", "The domain to use for Authentication(NTLM/Kerberos)");

        if (request instanceof WsdlRequest) {
            StringList outgoingNames = new StringList(
                    request.getOperation().getInterface().getProject().getWssContainer().getOutgoingWssNames());
            outgoingNames.add("");
            StringList incomingNames = new StringList(
                    request.getOperation().getInterface().getProject().getWssContainer().getIncomingWssNames());
            incomingNames.add("");

            form.addSpace(5);
            form.appendComboBox("outgoingWss", "Outgoing WSS", outgoingNames.toStringArray(),
                    "The outgoing WS-Security configuration to use");
            form.appendComboBox("incomingWss", "Incoming WSS", incomingNames.toStringArray(),
                    "The incoming WS-Security configuration to use");
        }

        form.addSpace(5);

        mainPanel.add(new JScrollPane(form.getPanel()), BorderLayout.CENTER);
    }

    return mainPanel;
}

From source file:com.eviware.soapui.support.editor.inspectors.aut.RequestAutInspector.java

License:Open Source License

public JComponent getComponent() {
    if (mainPanel == null) {
        mainPanel = new JPanel(new BorderLayout());

        form = new SimpleBindingForm(new PresentationModel<AbstractHttpRequest<?>>(request));
        form.addSpace(5);//from  w w w  .  ja  v  a2  s .co m
        form.appendComboBox("authType", "Authorisation Type",
                new String[] { AuthType.GLOBAL_HTTP_SETTINGS.toString(), AuthType.PREEMPTIVE.toString(),
                        AuthType.NTLM_KERBEROS.toString() },
                "");
        form.appendTextField("username", "Username", "The username to use for HTTP Authentication");
        form.appendPasswordField("password", "Password", "The password to use for HTTP Authentication");
        form.appendTextField("domain", "Domain", "The domain to use for Authentication(NTLM/Kerberos)");

        if (request instanceof WsdlRequest) {
            StringList outgoingNames = new StringList(
                    request.getOperation().getInterface().getProject().getWssContainer().getOutgoingWssNames());
            outgoingNames.add("");
            StringList incomingNames = new StringList(
                    request.getOperation().getInterface().getProject().getWssContainer().getIncomingWssNames());
            incomingNames.add("");

            form.addSpace(5);
            form.appendComboBox("outgoingWss", "Outgoing WSS", outgoingNames.toStringArray(),
                    "The outgoing WS-Security configuration to use");
            form.appendComboBox("incomingWss", "Incoming WSS", incomingNames.toStringArray(),
                    "The incoming WS-Security configuration to use");
        }

        form.addSpace(5);

        mainPanel.add(new JScrollPane(form.getPanel()), BorderLayout.CENTER);
    }

    return mainPanel;
}

From source file:com.eviware.soapui.support.editor.inspectors.auth.BasicAuthenticationForm.java

License:EUPL

@Override
protected JPanel buildUI() {
    SimpleBindingForm basicAuthenticationForm = new SimpleBindingForm(new PresentationModel<T>(request));
    populateBasicForm(basicAuthenticationForm);

    JPanel panel = basicAuthenticationForm.getPanel();
    setBorderAndBackgroundColorOnPanel(panel);

    return panel;
}

From source file:com.eviware.soapui.support.editor.inspectors.auth.OAuth2Form.java

License:EUPL

@Override
protected JPanel buildUI() {
    oAuth2Form = new SimpleBindingForm(new PresentationModel<OAuth2Profile>(profile));
    addOAuth2Panel(oAuth2Form);/*from w w w  .  j  ava 2 s.  com*/
    statusChangeManager.register();

    if (profile.getAccessTokenStatus() != OAuth2Profile.AccessTokenStatus.RETRIEVAL_CANCELED) {
        profile.resetAccessTokenStatusToStartingStatus();
    }
    setAccessTokenStatusFeedback(profile.getAccessTokenStatus());
    return formPanel;
}

From source file:com.eviware.soapui.support.editor.inspectors.auth.OAuth2GetAccessTokenForm.java

License:EUPL

private SimpleBindingForm createSimpleBindingForm(OAuth2Profile profile) {
    PresentationModel presentationModel = new PresentationModel<OAuth2Profile>(profile);
    String columnsSpecs = GET_ACCESS_TOKEN_FORM_LAYOUT;
    Border border = BorderFactory.createLineBorder(CARD_BORDER_COLOR, 1);
    return new SimpleBindingForm(presentationModel, columnsSpecs, border);
}

From source file:com.eviware.soapui.support.editor.inspectors.jms.header.AbstractJMSHeaderInspector.java

License:EUPL

public JComponent getComponent() {
    if (mainPanel == null) {
        mainPanel = new JPanel(new BorderLayout());
        form = new SimpleBindingForm(
                new PresentationModel<AbstractHttpRequest<?>>(jmsContainer.getJMSHeaderConfig()));
        buildContent(form);/*from w  w w . j  a va 2s  .c om*/
        mainPanel.add(new JScrollPane(form.getPanel()), BorderLayout.CENTER);
    }
    return mainPanel;
}

From source file:com.eviware.soapui.support.editor.inspectors.wsa.AbstractWsaInspector.java

License:EUPL

public JComponent getComponent() {
    if (mainPanel == null) {
        mainPanel = new JPanel(new BorderLayout());
        form = new SimpleBindingForm(
                new PresentationModel<AbstractHttpRequest<?>>(wsaContainer.getWsaConfig()));
        buildContent(form);/*from w  w  w.j  a  v a2  s.com*/
        mainPanel.add(new JScrollPane(form.getPanel()), BorderLayout.CENTER);
    }
    return mainPanel;
}