public SessionPanel createSessionPanel(String title, FileSystem fileSystem) { SessionPanel sessionPanel = null; try { sessionPanel = new SessionPanel( createNavigationPanel(new LocalFileSystem()), createNavigationPanel(fileSystem)); context.getSessionsPanel().addTab(title, sessionPanel); } catch (ApplicationException e) { e.show(); } return sessionPanel; }
public ApplicationFrame(ApplicationContext context) { this.context = context; this.actionFactory = context.getActionFactory(); this.buttonFactory = context.getButtonFactory(); this.uiFactory = context.getUiFactory(); setSize(1024, 768); setLocationRelativeTo(null); setTitle("Jar Commander"); setFocusable(true); setPreferredSize(new Dimension(1024, 768)); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new CustomWindowAdapter()); GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); setLayout(gridBagLayout); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; add(createHeaderPanel(), c); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; c.gridy++; add(uiFactory.createSessionsPanel(), c); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 0; c.weighty = 0; c.gridy++; JPanel footerPanel = createFooterPanel(); add(footerPanel, c); pack(); ((SessionPanel) context.getSessionsPanel().getSelectedComponent()) .getSelectedNavigationPanel() .getFileTablePane() .getTable() .requestFocusInWindow(); }