import java.awt.BorderLayout;
import java.awt.CardLayout;
+import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
protected JInternalFrame mainFrame = new JInternalFrame(
getFTSFrameTitle());
+ protected JTabbedPane mainFramTabs = new JTabbedPane();
protected IProgressIndicator progressIndicator;
protected JComboBox<FTSDataColumnI> cmb_searchTarget = new JComboBox<FTSDataColumnI>();
public GFTSPanel()
{
+ this(null);
+ }
+
+ public GFTSPanel(SequenceFetcher fetcher)
+ {
try
{
+ if (fetcher == null)
+ {
+ mainFramTabs = null;
+ }
jbInit();
+ if (fetcher != null)
+ {
+ mainFramTabs.addTab("Retrieve IDs", fetcher);
+ fetcher.setDatabaseChooserVisible(false);
+ }
mainFrame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
+ final JPanel ftsPanel = this;
mainFrame.addFocusListener(new FocusAdapter()
{
@Override
public void focusGained(FocusEvent e)
{
- txt_search.requestFocusInWindow();
+ // TODO: make selected tab gain focus in correct widget
+ if (mainFramTabs != null
+ && mainFramTabs.getSelectedComponent() == ftsPanel)
+ {
+ txt_search.requestFocusInWindow();
+ }
}
});
mainFrame.invalidate();
this.add(pnl_results, java.awt.BorderLayout.CENTER);
this.add(pnl_actions, java.awt.BorderLayout.SOUTH);
mainFrame.setVisible(true);
- mainFrame.setContentPane(this);
+ if (mainFramTabs != null)
+ {
+ mainFramTabs.setOpaque(true);
+ mainFramTabs.setBackground(Color.white);
+ mainFramTabs.insertTab("Free Text Search", null, this, "", 0);
+ mainFrame.setContentPane(mainFramTabs);
+ mainFramTabs.setVisible(true);
+ }
+ else
+ {
+ mainFrame.setContentPane(this);
+ }
mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
mainFrame.addInternalFrameListener(
new javax.swing.event.InternalFrameAdapter()
closeAction();
}
});
- mainFrame.setVisible(true);
- mainFrame.setContentPane(this);
mainFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
Integer x = getTempUserPrefs().get("FTSPanel.x");
Integer y = getTempUserPrefs().get("FTSPanel.y");