| | |
| | | }
|
| | | });
|
| | |
|
| | | final JButton logRepository = new JButton(Translation.get("gb.log") + "...");
|
| | | logRepository.setEnabled(false);
|
| | | logRepository.addActionListener(new ActionListener() {
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | RepositoryModel model = getSelectedRepositories().get(0);
|
| | | showSearchDialog(false, model);
|
| | | }
|
| | | });
|
| | |
|
| | | final JButton searchRepository = new JButton(Translation.get("gb.search") + "...");
|
| | | searchRepository.setEnabled(false);
|
| | | searchRepository.addActionListener(new ActionListener() {
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | RepositoryModel model = getSelectedRepositories().get(0);
|
| | | searchRepository(model);
|
| | | showSearchDialog(true, model);
|
| | | }
|
| | | });
|
| | |
|
| | |
| | | if (singleSelection) {
|
| | | RepositoryModel repository = getSelectedRepositories().get(0);
|
| | | browseRepository.setEnabled(repository.hasCommits);
|
| | | logRepository.setEnabled(repository.hasCommits);
|
| | | searchRepository.setEnabled(repository.hasCommits);
|
| | | subscribeRepository.setEnabled(repository.hasCommits);
|
| | | } else {
|
| | | browseRepository.setEnabled(false);
|
| | | logRepository.setEnabled(false);
|
| | | searchRepository.setEnabled(false);
|
| | | subscribeRepository.setEnabled(false);
|
| | | }
|
| | |
| | | repositoryControls.add(editRepository);
|
| | | repositoryControls.add(delRepository);
|
| | | repositoryControls.add(subscribeRepository);
|
| | | repositoryControls.add(logRepository);
|
| | | repositoryControls.add(searchRepository);
|
| | |
|
| | | setLayout(new BorderLayout(Utils.MARGIN, Utils.MARGIN));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | protected void searchRepository(final RepositoryModel repository) {
|
| | | SearchDialog searchDialog = new SearchDialog(gitblit);
|
| | | private void showSearchDialog(boolean isSearch, final RepositoryModel repository) {
|
| | | final SearchDialog dialog = new SearchDialog(gitblit, isSearch);
|
| | | if (repository != null) {
|
| | | searchDialog.selectRepository(repository);
|
| | | dialog.selectRepository(repository);
|
| | | }
|
| | | searchDialog.setLocationRelativeTo(this);
|
| | | searchDialog.setVisible(true);
|
| | | dialog.setLocationRelativeTo(this);
|
| | | dialog.setVisible(true);
|
| | | }
|
| | | }
|