package org.autoplot.util;

import java.awt.Component;
import java.util.Collections;
import org.das2.util.StringSchemeEditor;

/**
 * wraps a DataSetSelector (address bar) to provide its functionality.
 * @author jbf
 */
public class DataSetSelectorStringSchemeEditor extends javax.swing.JPanel implements StringSchemeEditor {

    /**
     * Creates new form DataSetSelectorStringSchemeEditor
     */
    public DataSetSelectorStringSchemeEditor() {
        initComponents();
        org.autoplot.bookmarks.Util.loadRecent( "recent", dataSetSelector1, Collections.emptyList() );
    }

    /**
     * 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() {

        dataSetSelector1 = new org.autoplot.datasource.DataSetSelector();

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dataSetSelector1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dataSetSelector1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.autoplot.datasource.DataSetSelector dataSetSelector1;
    // End of variables declaration//GEN-END:variables

    @Override
    public void setValue(String v) {
        this.dataSetSelector1.setValue(v);
    }

    @Override
    public String getValue() {
        return this.dataSetSelector1.getValue();
    }

    @Override
    public Component getComponent() {
        return this;
    }

    @Override
    public void setContext(Object o) {
        
    }
}