| | |
| | | import java.awt.Insets;
|
| | | import java.awt.event.ActionEvent;
|
| | | import java.awt.event.ActionListener;
|
| | | import java.awt.event.KeyEvent;
|
| | | import java.text.MessageFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | |
| | | import javax.swing.JList;
|
| | | import javax.swing.JOptionPane;
|
| | | import javax.swing.JPanel;
|
| | | import javax.swing.JRootPane;
|
| | | import javax.swing.JTabbedPane;
|
| | | import javax.swing.JTextField;
|
| | | import javax.swing.KeyStroke;
|
| | | import javax.swing.ListCellRenderer;
|
| | |
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | |
| | |
|
| | | private JCheckBox showReadme;
|
| | |
|
| | | private JCheckBox skipSizeCalculation;
|
| | |
|
| | | private JCheckBox isFrozen;
|
| | |
|
| | | private JComboBox accessRestriction;
|
| | |
| | | setTitle(Translation.get("gb.edit") + ": " + aRepository.name);
|
| | | setIconImage(new ImageIcon(getClass().getResource("/gitblt-favicon.png")).getImage());
|
| | | }
|
| | | |
| | | @Override
|
| | | protected JRootPane createRootPane() {
|
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
|
| | | JRootPane rootPane = new JRootPane();
|
| | | rootPane.registerKeyboardAction(new ActionListener() {
|
| | | public void actionPerformed(ActionEvent actionEvent) {
|
| | | setVisible(false);
|
| | | }
|
| | | }, stroke, JComponent.WHEN_IN_FOCUSED_WINDOW);
|
| | | return rootPane;
|
| | | }
|
| | |
|
| | | private void initialize(RepositoryModel anRepository) {
|
| | | nameField = new JTextField(anRepository.name == null ? "" : anRepository.name, 35);
|
| | |
| | | anRepository.showRemoteBranches);
|
| | | showReadme = new JCheckBox(Translation.get("gb.showReadmeDescription"),
|
| | | anRepository.showReadme);
|
| | | skipSizeCalculation = new JCheckBox(Translation.get("gb.skipSizeCalculationDescription"),
|
| | | anRepository.skipSizeCalculation);
|
| | | isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"), anRepository.isFrozen);
|
| | |
|
| | | accessRestriction = new JComboBox(AccessRestrictionType.values());
|
| | |
| | | fieldsPanel
|
| | | .add(newFieldPanel(Translation.get("gb.showRemoteBranches"), showRemoteBranches));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.showReadme"), showReadme));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.skipSizeCalculation"), skipSizeCalculation));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen));
|
| | |
|
| | | usersPalette = new JPalette<String>();
|
| | |
| | | getContentPane().setLayout(new BorderLayout(5, 5));
|
| | | getContentPane().add(centerPanel, BorderLayout.CENTER);
|
| | | pack();
|
| | | setLocationRelativeTo(null);
|
| | | }
|
| | |
|
| | | private JPanel newFieldPanel(String label, JComponent comp) {
|
| | |
| | | repository.useDocs = useDocs.isSelected();
|
| | | repository.showRemoteBranches = showRemoteBranches.isSelected();
|
| | | repository.showReadme = showReadme.isSelected();
|
| | | repository.skipSizeCalculation = skipSizeCalculation.isSelected();
|
| | | repository.isFrozen = isFrozen.isSelected();
|
| | |
|
| | | repository.accessRestriction = (AccessRestrictionType) accessRestriction.getSelectedItem();
|