xml.wsdlui/src/org/netbeans/modules/xml/wsdl/ui/wizard/BindingConfigurationEditorPanel.java
author Milutin Kristofic <mkristofic@netbeans.org>
Mon, 30 Jan 2017 14:30:54 +0100
changeset 1583 fe20f672a61a
parent 1208 d83ab9ebbbbb
permissions -rw-r--r--
Added Missing copyright information in source files
mkristofic@1583
     1
/*
mkristofic@1583
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
mkristofic@1583
     3
 *
mkristofic@1583
     4
 * Copyright 2009-2017 Oracle and/or its affiliates. All rights reserved.
mkristofic@1583
     5
 *
mkristofic@1583
     6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
mkristofic@1583
     7
 * Other names may be trademarks of their respective owners.
mkristofic@1583
     8
 *
mkristofic@1583
     9
 * The contents of this file are subject to the terms of either the GNU
mkristofic@1583
    10
 * General Public License Version 2 only ("GPL") or the Common
mkristofic@1583
    11
 * Development and Distribution License("CDDL") (collectively, the
mkristofic@1583
    12
 * "License"). You may not use this file except in compliance with the
mkristofic@1583
    13
 * License. You can obtain a copy of the License at
mkristofic@1583
    14
 * http://www.netbeans.org/cddl-gplv2.html
mkristofic@1583
    15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
mkristofic@1583
    16
 * specific language governing permissions and limitations under the
mkristofic@1583
    17
 * License.  When distributing the software, include this License Header
mkristofic@1583
    18
 * Notice in each file and include the License file at
mkristofic@1583
    19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
mkristofic@1583
    20
 * particular file as subject to the "Classpath" exception as provided
mkristofic@1583
    21
 * by Oracle in the GPL Version 2 section of the License file that
mkristofic@1583
    22
 * accompanied this code. If applicable, add the following below the
mkristofic@1583
    23
 * License Header, with the fields enclosed by brackets [] replaced by
mkristofic@1583
    24
 * your own identifying information:
mkristofic@1583
    25
 * "Portions Copyrighted [year] [name of copyright owner]"
mkristofic@1583
    26
 *
mkristofic@1583
    27
 * Contributor(s):
mkristofic@1583
    28
 *
mkristofic@1583
    29
 * The Original Software is NetBeans. The Initial Developer of the Original
mkristofic@1583
    30
 * Software is Sun Microsystems, Inc. Portions Copyright 2009-2010 Sun
mkristofic@1583
    31
 * Microsystems, Inc. All Rights Reserved.
mkristofic@1583
    32
 *
mkristofic@1583
    33
 * If you wish your version of this file to be governed by only the CDDL
mkristofic@1583
    34
 * or only the GPL Version 2, indicate your decision by adding
mkristofic@1583
    35
 * "[Contributor] elects to include this software in this distribution
mkristofic@1583
    36
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
mkristofic@1583
    37
 * single choice of license, a recipient has the option to distribute
mkristofic@1583
    38
 * your version of this file under either the CDDL, the GPL Version 2 or
mkristofic@1583
    39
 * to extend the choice of license to its licensees as provided above.
mkristofic@1583
    40
 * However, if you add GPL Version 2 code and therefore, elected the GPL
mkristofic@1583
    41
 * Version 2 license, then the option applies only if the new code is
mkristofic@1583
    42
 * made subject to such option by the copyright holder.
mkristofic@1583
    43
 */
skini@1208
    44
/*
skini@1208
    45
 * BindingConfigurationEditorPanel.java
skini@1208
    46
 *
skini@1208
    47
 * Created on June 2, 2008, 2:45 PM
skini@1208
    48
 */
skini@1208
    49
skini@1208
    50
package org.netbeans.modules.xml.wsdl.ui.wizard;
skini@1208
    51
skini@1208
    52
import java.awt.BorderLayout;
skini@1208
    53
import java.beans.PropertyChangeEvent;
skini@1208
    54
import java.beans.PropertyChangeListener;
skini@1208
    55
import javax.swing.JPanel;
skini@1208
    56
import javax.swing.SwingUtilities;
skini@1208
    57
import javax.xml.namespace.QName;
skini@1208
    58
import org.netbeans.modules.xml.wsdl.bindingsupport.configeditor.ConfigurationEditorProviderFactory;
skini@1208
    59
import org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementConfigurationEditorComponent;
skini@1208
    60
import org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementConfigurationEditorProvider;
skini@1208
    61
skini@1208
    62
/**
skini@1208
    63
 *
skini@1208
    64
 * @author  skini
skini@1208
    65
 */
skini@1208
    66
public class BindingConfigurationEditorPanel extends javax.swing.JPanel {
skini@1208
    67
skini@1208
    68
    /** Creates new form BindingConfigurationEditorPanel */
skini@1208
    69
    public BindingConfigurationEditorPanel() {
skini@1208
    70
        initComponents();
skini@1208
    71
        initGUI();
skini@1208
    72
    }
skini@1208
    73
skini@1208
    74
    /** This method is called from within the constructor to
skini@1208
    75
     * initialize the form.
skini@1208
    76
     * WARNING: Do NOT modify this code. The content of this method is
skini@1208
    77
     * always regenerated by the Form Editor.
skini@1208
    78
     */
skini@1208
    79
    @SuppressWarnings("unchecked")
skini@1208
    80
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
skini@1208
    81
    private void initComponents() {
skini@1208
    82
skini@1208
    83
        setName("Form"); // NOI18N
skini@1208
    84
        setLayout(new java.awt.BorderLayout());
skini@1208
    85
    }// </editor-fold>//GEN-END:initComponents
skini@1208
    86
skini@1208
    87
    private void initGUI() {
skini@1208
    88
        String namespace = "";
skini@1208
    89
        ExtensibilityElementConfigurationEditorProvider configurationProvider = ConfigurationEditorProviderFactory.getDefault().getConfigurationProvider(namespace);
skini@1208
    90
        QName qname = new QName(namespace, "address");
skini@1208
    91
        if (configurationProvider != null && configurationProvider.isConfigurationSupported(qname)) {
skini@1208
    92
            ExtensibilityElementConfigurationEditorComponent editorComponent = configurationProvider.getComponent(qname, null);
skini@1208
    93
            JPanel panel = editorComponent.getEditorPanel();
skini@1208
    94
            panel.addPropertyChangeListener(new PropertyChangeListener() {
skini@1208
    95
skini@1208
    96
                public void propertyChange(PropertyChangeEvent evt) {
skini@1208
    97
                    if (evt.getNewValue() instanceof String) {
skini@1208
    98
                        String message = (String) evt.getNewValue();
skini@1208
    99
                        if (evt.getPropertyName().equals(ExtensibilityElementConfigurationEditorComponent.PROPERTY_ERROR_EVT)) {
skini@1208
   100
                        } else if (evt.getPropertyName().equals(ExtensibilityElementConfigurationEditorComponent.PROPERTY_WARNING_EVT)) {
skini@1208
   101
skini@1208
   102
                        } else if (evt.getPropertyName().equals(ExtensibilityElementConfigurationEditorComponent.PROPERTY_CLEAR_MESSAGES_EVT)) {
skini@1208
   103
                        } else if (evt.getPropertyName().equals(ExtensibilityElementConfigurationEditorComponent.PROPERTY_NORMAL_MESSAGE_EVT)) {
skini@1208
   104
skini@1208
   105
                        }
skini@1208
   106
                    }
skini@1208
   107
                }
skini@1208
   108
            });
skini@1208
   109
            removeAll();                    
skini@1208
   110
            add(panel, BorderLayout.SOUTH);
skini@1208
   111
            setVisible(true);
skini@1208
   112
            setVisible(true);
skini@1208
   113
        } else {
skini@1208
   114
            setVisible(false);
skini@1208
   115
            setVisible(false);
skini@1208
   116
        }
skini@1208
   117
        SwingUtilities.getWindowAncestor(this).pack();
skini@1208
   118
    }
skini@1208
   119
skini@1208
   120
skini@1208
   121
    // Variables declaration - do not modify//GEN-BEGIN:variables
skini@1208
   122
    // End of variables declaration//GEN-END:variables
skini@1208
   123
skini@1208
   124
}