package hozo.sparql.gui; import java.awt.BorderLayout; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.util.LinkedHashMap; import java.util.Map; import javax.swing.AbstractAction; import javax.swing.DefaultListModel; import javax.swing.InputMap; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.KeyStroke; import jp.ac.osaka_u.sanken.sparql.EndpointSettings; import jp.ac.osaka_u.sanken.util.CheckableList; import jp.ac.osaka_u.sanken.util.CheckableListItem; public class EndpointSelector extends JDialog { /** * */ private static final long serialVersionUID = -5270916655051535400L; private EndpointSettings[] settings; private Map settingNames; private JPanel jContentPane; private CheckableList endpointList; private JScrollPane endpointListScrollPane; private JPanel buttonPane; private JButton okButton; private boolean valid = false; public EndpointSelector(Frame owner, EndpointSettings[] settings){ super(owner); this.settings = settings; this.settingNames = new LinkedHashMap(); this.setTitle("Select the target endpoints"); for (EndpointSettings setting : settings){ settingNames.put(setting.getEndpoint(), setting); } initialize(); } public boolean isValid(){ return valid; } public EndpointSettings[] getSettings(){ DefaultListModel model = (DefaultListModel)getEndpointList().getModel(); for (int i=0; i