/* * Constellation - An open source and standard compliant SDI * http://www.constellation-sdi.org * * Copyright 2014 Geomatys. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.constellation.swing; import org.constellation.configuration.DataSourceType; import org.constellation.generic.database.Automatic; import javax.swing.*; import java.util.ResourceBundle; /** * * @author Guilhem Legal (Geomatys) */ public class JCswInternalEditPane extends JServiceEditionPane { /** * Creates new form JCswInternalEditPane */ public JCswInternalEditPane(final Automatic configuration) { initComponents(); } @Override public Automatic getConfiguration() { final String nulll = null; final Automatic configuration = new Automatic("internal", nulll); configuration.setProfile((String)guiProfileCombo.getSelectedItem()); return configuration; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel2 = new JLabel(); guiProfileCombo = new JComboBox(); ResourceBundle bundle = ResourceBundle.getBundle("org/constellation/swing/Bundle"); // NOI18N jLabel2.setText(bundle.getString("profil")); // NOI18N guiProfileCombo.setModel(new DefaultComboBoxModel(new String[] { "discovery", "transactional" })); guiProfileCombo.setEnabled(false); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2) .addGap(18, 18, 18) .addComponent(guiProfileCombo, 0, 310, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(guiProfileCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private JComboBox guiProfileCombo; private JLabel jLabel2; // End of variables declaration//GEN-END:variables @Override public DataSourceType getDatasourceType() { return DataSourceType.INTERNAL; } }