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.support.editor.inspectors.wsrm.AbstractWsrmInspector.java

License:EUPL

public JComponent getComponent() {
    if (mainPanel == null) {
        mainPanel = new JPanel(new BorderLayout());
        form = new SimpleBindingForm(
                new PresentationModel<AbstractHttpRequest<?>>(wsrmContainer.getWsrmConfig()));
        buildContent(form);//from   ww w  .j a  v  a  2 s . c  o  m
        mainPanel.add(new JScrollPane(form.getPanel()), BorderLayout.CENTER);
    }
    return mainPanel;
}

From source file:com.mrfeinberg.proxyprefs.ProxyPrefsDialog.java

License:Apache License

public ProxyPrefsDialog(final Frame parent, final ProxyPreferences prefs) {
    super(parent, "HTTP Proxy Preferences", true);
    this.proxyPresentationModel = new PresentationModel<Object>(prefs);
    canceled = false;/*from w  w w . ja v a  2 s .  c  o  m*/
}

From source file:cz.cvut.promod.EPC2XHTMLExport.ui.ExporterSettingsController.java

License:MIT License

/**
 * The constructor creates the view component and registers as its listener, it also creates
 * the model component initializes the received actions.
 *
 * @param epcWorkspaceData - graph data/*from ww w  .j  a  va2s. c  o  m*/
 * @param actions          - actions related to this module, includes the export action
 * @param EPC2XHTML_EXPORT_ACTION_RES - resource identifier of the export action
 */
public ExporterSettingsController(final EPCWorkspaceData epcWorkspaceData,
        final Map<String, ProModAction> actions, final String EPC2XHTML_EXPORT_ACTION_RES) {

    this.EPC2XHTML_EXPORT_ACTION_RES = EPC2XHTML_EXPORT_ACTION_RES;

    model = new ExporterSettingsModel();
    view = new ExporterSettingsView();
    view.registerListener(this);
    workspace = epcWorkspaceData;

    presentationModel = new PresentationModel<ExporterSettingsModel>(model);

    initActions(actions);
}

From source file:eu.europa.ec.markt.dss.applet.view.ActivityView.java

License:Open Source License

/**
 * //from  w w w.j  a va  2  s . c  o m
 * The default constructor for ActivityView.
 * 
 * @param core
 * @param controller
 * @param model
 */
public ActivityView(final AppletCore core, final ActivityController controller, final ActivityModel model) {
    super(core, controller, model);

    this.presentationModel = new PresentationModel<ActivityModel>(getModel());
    final ValueModel activityValue = presentationModel.getModel(ActivityModel.PROPERTY_ACTIVITY);
    choice1 = ComponentFactory.createRadioButton(I18N_SIGN_DOCUMENT, activityValue, ActivityAction.SIGN);
    choice2 = ComponentFactory.createRadioButton(I18N_VERIFY_DOCUMENT, activityValue, ActivityAction.VERIFY);
    choice2.setName("validate");
    choice3 = ComponentFactory.createRadioButton(I18N_EXTEND_DOCUEMNT, activityValue, ActivityAction.EXTEND);
    choice4 = ComponentFactory.createRadioButton(I18N_EDIT_VALIDATION_POLICY, activityValue,
            ActivityAction.EDIT_VALIDATION_POLICY);
    button = ComponentFactory.createNextButton(true, new NextActionListener());
    button.setName("next");

    final AppletUsage appletUsage = getController().getParameter().getAppletUsage();
    switch (appletUsage) {
    case ALL: {
        choices.add(choice1);
        choices.add(choice2);
        choices.add(choice3);
        choices.add(choice4);
        break;
    }
    case EXTEND: {
        choices.add(choice3);
        break;
    }
    case SIGN:
        choices.add(choice1);
        break;
    case VERIFY: {
        choices.add(choice2);
        break;
    }
    case EDIT_VALIDATION_POLICY: {
        choices.add(choice4);
        break;
    }

    }

}

From source file:eu.europa.ec.markt.dss.applet.view.signature.CertificateView.java

License:Open Source License

/**
 * //from  w ww .  ja v  a  2 s .  c om
 * The default constructor for CertificateView.
 * 
 * @param core
 * @param controller
 * @param model
 */
public CertificateView(final AppletCore core, final SignatureWizardController controller,
        final SignatureModel model) {
    super(core, controller, model);

    presentationModel = new PresentationModel<SignatureModel>(getModel());

    final ValueModel listValueModel = presentationModel.getModel(SignatureModel.PROPERTY_PRIVATE_KEYS);
    final ValueModel privateKeyValueModel = presentationModel
            .getModel(SignatureModel.PROPERTY_SELECTED_PRIVATE_KEY);
    selectionList = new SelectionInList<DSSPrivateKeyEntry>(listValueModel, privateKeyValueModel);

    certificateList = ComponentFactory.createList(selectionList, new CertificateListCellRenderer());
    refreshButton = ComponentFactory.createRefreshButton(true, new RefreshActionListener());

}

From source file:eu.europa.ec.markt.dss.applet.view.signature.PersonalDataView.java

License:Open Source License

/**
 * The default constructor for PersonalDataView.
 * //from ww  w. j  a  va 2  s  .  c om
 * @param core
 * @param controller
 * @param model
 */
public PersonalDataView(final AppletCore core, final SignatureWizardController controller,
        final SignatureModel model) {
    super(core, controller, model);

    this.presentationModel = new PresentationModel<SignatureModel>(getModel());

    // Initialize value models

    final ValueModel claimedCheck = presentationModel.getModel(SignatureModel.PROPERTY_CLAIMED_CHECK);
    final ValueModel claimedRole = presentationModel.getModel(SignatureModel.PROPERTY_CLAIMED_ROLE);
    final ValueModel tslSignatureCheck = presentationModel
            .getModel(SignatureModel.PROPERTY_TSL_SIGNATURE_CHECK);
    final ValueModel policyCheck = presentationModel.getModel(SignatureModel.PROPERTY_SIGNATURE_POLICY_CHECK);
    final ValueModel policyID = presentationModel.getModel(SignatureModel.PROPERTY_POLICY_ID);
    final ValueModel policyAlgo = presentationModel.getModel(SignatureModel.PROPERTY_POLICY_ALGO);
    final ValueModel policyHashValue = presentationModel.getModel(SignatureModel.PROPERTY_POLICY_VALUE);

    // Initialize components
    claimedCheckBox = ComponentFactory.createCheckBox(claimedCheck, I18N_CLAIMED_ROLE);
    tslSignatureCheckBox = ComponentFactory.createCheckBox(tslSignatureCheck, I18N_TSL_SIGNATURE);
    policyCheckBox = ComponentFactory.createCheckBox(policyCheck, I18N_SIGNATURE_POLICY);

    explicitPanel = ComponentFactory.createPanel();

    policyIDInput = ComponentFactory.createTextField(policyID, false);
    policyAlgoInput = ComponentFactory.createTextField(policyAlgo, false);
    policyHashValueInput = ComponentFactory.createTextField(policyHashValue, false);

    claimedRoleInput = ComponentFactory.createTextField(claimedRole, false);

}

From source file:eu.europa.ec.markt.dss.applet.view.signature.SignatureDigestAlgorithmView.java

License:Open Source License

/**
 * /*from   w w w .ja  va  2  s  .  c  om*/
 * The default constructor for SignatureDigestAlgorithmView.
 * 
 * @param core
 * @param controller
 * @param model
 */
public SignatureDigestAlgorithmView(AppletCore core, SignatureWizardController controller,
        SignatureModel model) {
    super(core, controller, model);

    this.presentationModel = new PresentationModel<SignatureModel>(getModel());
    signatureDigestAlgorithmValue = presentationModel
            .getModel(SignatureModel.PROPERTY_SIGNATURE_DIGEST_ALGORITHM);
    final SelectionInList<DigestAlgorithm> algorithms = new SelectionInList<DigestAlgorithm>(
            signatureDigestAlgorithms, signatureDigestAlgorithmValue);
    signatureAlgorithmComboBox = ComponentFactory.createComboBox(algorithms);
}

From source file:eu.europa.ec.markt.dss.applet.view.signature.TokenView.java

License:Open Source License

/**
 * //from   w w  w  .j  a v  a2 s .co m
 * The default constructor for TokenView.
 * 
 * @param core
 * @param controller
 * @param model
 */
public TokenView(final AppletCore core, final SignatureWizardController controller,
        final SignatureModel model) {
    super(core, controller, model);

    presentationModel = new PresentationModel<SignatureModel>(getModel());

    final ValueModel tokenValue = presentationModel.getModel(SignatureModel.PROPERTY_TOKEN_TYPE);

    pkcs11Button = ComponentFactory.createRadioButton(I18N_TOKEN_PKCS11, tokenValue, SignatureTokenType.PKCS11);
    pkcs12Button = ComponentFactory.createRadioButton(I18N_TOKEN_PKCS12, tokenValue, SignatureTokenType.PKCS12);
    msCapiButton = ComponentFactory.createRadioButton(I18N_TOKEN_MSCAPI, tokenValue, SignatureTokenType.MSCAPI);
    moccaButton = ComponentFactory.createRadioButton(I18N_TOKEN_MOCCA, tokenValue, SignatureTokenType.MOCCA);

}

From source file:eu.europa.ec.markt.dss.applet.view.validation.ValidationView.java

License:Open Source License

/**
 * The default constructor for ValidationView.
 *
 * @param core//from w  ww .j av a2 s  .  co m
 * @param controller
 * @param model
 */
public ValidationView(final AppletCore core, final ValidationWizardController controller,
        final ValidationModel model) {
    super(core, controller, model);

    selectFileA = ComponentFactory.createFileChooser(I18N_BROWSE_SIGNED, true, new SelectFileAEventListener());
    selectFileA.setName("fileA");
    selectFileB = ComponentFactory.createFileChooser(I18N_BROWSE_ORIGINAL, true,
            new SelectFileBEventListener());
    selectFileB.setName("fileB");
    clear = ComponentFactory.createClearButton(true, new ClearEventListener());
    clear.setName("clear");
    fileA = ComponentFactory.createLabel(I18N_NO_FILE_SELECTED);
    fileB = ComponentFactory.createLabel(I18N_NO_FILE_SELECTED);

    PresentationModel<ValidationModel> presentationModel = new PresentationModel<ValidationModel>(getModel());
    AbstractValueModel validationLegacyChosen = presentationModel
            .getModel(getModel().CHANGE_PROPERTY_VALIDATION_LEGACY_CHOSEN);

    validationLegacy = ComponentFactory.createRadioButton(I18_VALIDATION_LEGACY, validationLegacyChosen,
            Boolean.TRUE);
    validationLegacy.setName("validationLegacy");
    validation102853 = ComponentFactory.createRadioButton(I18_VALIDATION_102853, validationLegacyChosen,
            Boolean.FALSE);
    validation102853.setName("validation");

    AbstractValueModel validationDefaultChosen = presentationModel
            .getModel(getModel().CHANGE_PROPERTY_DEFAULT_POLICY);

    defaultValidation = ComponentFactory.createRadioButton(I18N_DEFAULT_VALIDATION_102853,
            validationDefaultChosen, Boolean.TRUE);
    defaultValidation.setName("defaultValidation");
    customValidation = ComponentFactory.createRadioButton(I18N_CUSTOM_VALIDATION_102853,
            validationDefaultChosen, Boolean.FALSE);
    customValidation.setName("customValidation");

    filePolicyLabel = ComponentFactory.createLabel(I18N_NO_FILE_SELECTED);
    selectFilePolicy = ComponentFactory.createFileChooser(I18N_BROWSE_VALIDATION_POLICY, true,
            new SelectPolicyFileEventListener());
    selectFilePolicy.setName("selectFilePolicy");
    activeOrDisableCustomFile();

}

From source file:eu.europa.esig.dss.applet.view.ActivityView.java

License:Open Source License

/**
 *
 * The default constructor for ActivityView.
 *
 * @param core//from   w w  w.ja  va  2s.c o m
 * @param controller
 * @param model
 */
public ActivityView(final AppletCore core, final ActivityController controller, final ActivityModel model) {
    super(core, controller, model);

    this.presentationModel = new PresentationModel<ActivityModel>(getModel());
    final ValueModel activityValue = presentationModel.getModel(ActivityModel.PROPERTY_ACTIVITY);
    choice1 = ComponentFactory.createRadioButton(I18N_SIGN_DOCUMENT, activityValue, ActivityAction.SIGN);
    choice2 = ComponentFactory.createRadioButton(I18N_EDIT_VALIDATION_POLICY, activityValue,
            ActivityAction.EDIT_VALIDATION_POLICY);
    button = ComponentFactory.createNextButton(true, new NextActionListener());
    button.setName("next");

    final AppletUsage appletUsage = getController().getParameter().getAppletUsage();
    switch (appletUsage) {
    case ALL: {
        choices.add(choice1);
        choices.add(choice2);
        break;
    }
    case SIGN:
        choices.add(choice1);
        break;
    case EDIT_VALIDATION_POLICY: {
        choices.add(choice2);
        break;
    }

    }

}