| | |
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.HashSet;
|
| | | import java.util.LinkedHashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.swing.BoxLayout;
|
| | | import javax.swing.DefaultComboBoxModel;
|
| | | import javax.swing.ImageIcon;
|
| | | import javax.swing.JButton;
|
| | |
| | | import javax.swing.JOptionPane;
|
| | | import javax.swing.JPanel;
|
| | | import javax.swing.JRootPane;
|
| | | import javax.swing.JScrollPane;
|
| | | import javax.swing.JTabbedPane;
|
| | | import javax.swing.JTextField;
|
| | | import javax.swing.KeyStroke;
|
| | | import javax.swing.ListCellRenderer;
|
| | | import javax.swing.ScrollPaneConstants;
|
| | |
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | | import com.gitblit.Constants.FederationStrategy;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | | import com.gitblit.utils.ArrayUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | private JCheckBox skipSizeCalculation;
|
| | |
|
| | | private JCheckBox skipSummaryMetrics;
|
| | |
|
| | | private JCheckBox isFrozen;
|
| | |
|
| | | private JTextField mailingListsField;
|
| | |
|
| | | private JComboBox accessRestriction;
|
| | |
|
| | |
| | |
|
| | | private JComboBox ownerField;
|
| | |
|
| | | private JComboBox headRefField;
|
| | |
|
| | | private JPalette<String> usersPalette;
|
| | |
|
| | | private JPalette<String> setsPalette;
|
| | |
|
| | | private Set<String> repositoryNames;
|
| | | private JPalette<String> teamsPalette;
|
| | | |
| | | private JPalette<String> indexedBranchesPalette;
|
| | |
|
| | | public EditRepositoryDialog() {
|
| | | this(new RepositoryModel());
|
| | | private JPalette<String> preReceivePalette;
|
| | |
|
| | | private JLabel preReceiveInherited;
|
| | |
|
| | | private JPalette<String> postReceivePalette;
|
| | |
|
| | | private JLabel postReceiveInherited;
|
| | |
|
| | | private Set<String> repositoryNames;
|
| | | |
| | | private JPanel customFieldsPanel;
|
| | | |
| | | private List<JTextField> customTextfields;
|
| | |
|
| | | public EditRepositoryDialog(int protocolVersion) {
|
| | | this(protocolVersion, new RepositoryModel());
|
| | | this.isCreate = true;
|
| | | setTitle(Translation.get("gb.newRepository"));
|
| | | }
|
| | |
|
| | | public EditRepositoryDialog(RepositoryModel aRepository) {
|
| | | public EditRepositoryDialog(int protocolVersion, RepositoryModel aRepository) {
|
| | | super();
|
| | | this.repositoryName = aRepository.name;
|
| | | this.repository = new RepositoryModel();
|
| | | this.repositoryNames = new HashSet<String>();
|
| | | this.isCreate = false;
|
| | | initialize(aRepository);
|
| | | initialize(protocolVersion, aRepository);
|
| | | setModal(true);
|
| | | setResizable(false);
|
| | | setTitle(Translation.get("gb.edit") + ": " + aRepository.name);
|
| | | setIconImage(new ImageIcon(getClass().getResource("/gitblt-favicon.png")).getImage());
|
| | | setIconImage(new ImageIcon(getClass()
|
| | | .getResource("/gitblt-favicon.png")).getImage());
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return rootPane;
|
| | | }
|
| | |
|
| | | private void initialize(RepositoryModel anRepository) {
|
| | | nameField = new JTextField(anRepository.name == null ? "" : anRepository.name, 35);
|
| | | private void initialize(int protocolVersion, RepositoryModel anRepository) {
|
| | | nameField = new JTextField(anRepository.name == null ? ""
|
| | | : anRepository.name, 35);
|
| | | descriptionField = new JTextField(anRepository.description == null ? ""
|
| | | : anRepository.description, 35);
|
| | |
|
| | | JTextField originField = new JTextField(anRepository.origin == null ? ""
|
| | | : anRepository.origin, 40);
|
| | | JTextField originField = new JTextField(
|
| | | anRepository.origin == null ? "" : anRepository.origin, 40);
|
| | | originField.setEditable(false);
|
| | |
|
| | | if (ArrayUtils.isEmpty(anRepository.availableRefs)) {
|
| | | headRefField = new JComboBox();
|
| | | headRefField.setEnabled(false); |
| | | } else {
|
| | | headRefField = new JComboBox(
|
| | | anRepository.availableRefs.toArray());
|
| | | headRefField.setSelectedItem(anRepository.HEAD);
|
| | | }
|
| | |
|
| | | ownerField = new JComboBox();
|
| | |
|
| | | useTickets = new JCheckBox(Translation.get("gb.useTicketsDescription"),
|
| | | anRepository.useTickets);
|
| | | useDocs = new JCheckBox(Translation.get("gb.useDocsDescription"), anRepository.useDocs);
|
| | | showRemoteBranches = new JCheckBox(Translation.get("gb.showRemoteBranchesDescription"),
|
| | | useDocs = new JCheckBox(Translation.get("gb.useDocsDescription"),
|
| | | anRepository.useDocs);
|
| | | showRemoteBranches = new JCheckBox(
|
| | | Translation.get("gb.showRemoteBranchesDescription"),
|
| | | anRepository.showRemoteBranches);
|
| | | showReadme = new JCheckBox(Translation.get("gb.showReadmeDescription"),
|
| | | anRepository.showReadme);
|
| | | skipSizeCalculation = new JCheckBox(Translation.get("gb.skipSizeCalculationDescription"),
|
| | | skipSizeCalculation = new JCheckBox(
|
| | | Translation.get("gb.skipSizeCalculationDescription"),
|
| | | anRepository.skipSizeCalculation);
|
| | | isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"), anRepository.isFrozen);
|
| | | skipSummaryMetrics = new JCheckBox(
|
| | | Translation.get("gb.skipSummaryMetricsDescription"),
|
| | | anRepository.skipSummaryMetrics);
|
| | | isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"),
|
| | | anRepository.isFrozen);
|
| | |
|
| | | mailingListsField = new JTextField(
|
| | | ArrayUtils.isEmpty(anRepository.mailingLists) ? ""
|
| | | : StringUtils.flattenStrings(anRepository.mailingLists,
|
| | | " "), 50);
|
| | |
|
| | | accessRestriction = new JComboBox(AccessRestrictionType.values());
|
| | | accessRestriction.setRenderer(new AccessRestrictionRenderer());
|
| | |
| | |
|
| | | JPanel fieldsPanel = new JPanel(new GridLayout(0, 1));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.name"), nameField));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.description"), descriptionField));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.origin"), originField));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.description"),
|
| | | descriptionField));
|
| | | fieldsPanel
|
| | | .add(newFieldPanel(Translation.get("gb.origin"), originField));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.headRef"), headRefField));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.owner"), ownerField));
|
| | |
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.enableTickets"), useTickets));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.enableDocs"), useDocs));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.enableTickets"),
|
| | | useTickets));
|
| | | 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));
|
| | | .add(newFieldPanel(Translation.get("gb.enableDocs"), useDocs));
|
| | | 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.skipSummaryMetrics"),
|
| | | skipSummaryMetrics));
|
| | | fieldsPanel
|
| | | .add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen));
|
| | | fieldsPanel.add(newFieldPanel(Translation.get("gb.mailingLists"),
|
| | | mailingListsField));
|
| | |
|
| | | usersPalette = new JPalette<String>();
|
| | | JPanel accessPanel = new JPanel(new BorderLayout(5, 5));
|
| | | accessPanel.add(newFieldPanel(Translation.get("gb.accessRestriction"), accessRestriction),
|
| | | BorderLayout.NORTH);
|
| | | accessPanel.add(newFieldPanel(Translation.get("gb.permittedUsers"), usersPalette),
|
| | | BorderLayout.CENTER);
|
| | | accessPanel.add(
|
| | | newFieldPanel(Translation.get("gb.accessRestriction"),
|
| | | accessRestriction), BorderLayout.NORTH);
|
| | | accessPanel.add(
|
| | | newFieldPanel(Translation.get("gb.permittedUsers"),
|
| | | usersPalette), BorderLayout.CENTER);
|
| | |
|
| | | teamsPalette = new JPalette<String>();
|
| | | JPanel teamsPanel = new JPanel(new BorderLayout(5, 5));
|
| | | teamsPanel.add(
|
| | | newFieldPanel(Translation.get("gb.permittedTeams"),
|
| | | teamsPalette), BorderLayout.CENTER);
|
| | |
|
| | | setsPalette = new JPalette<String>();
|
| | | JPanel federationPanel = new JPanel(new BorderLayout(5, 5));
|
| | | federationPanel.add(
|
| | | newFieldPanel(Translation.get("gb.federationStrategy"), federationStrategy),
|
| | | BorderLayout.NORTH);
|
| | | federationPanel.add(newFieldPanel(Translation.get("gb.federationSets"), setsPalette),
|
| | | BorderLayout.CENTER);
|
| | | newFieldPanel(Translation.get("gb.federationStrategy"),
|
| | | federationStrategy), BorderLayout.NORTH);
|
| | | federationPanel
|
| | | .add(newFieldPanel(Translation.get("gb.federationSets"),
|
| | | setsPalette), BorderLayout.CENTER);
|
| | |
|
| | | indexedBranchesPalette = new JPalette<String>();
|
| | | JPanel indexedBranchesPanel = new JPanel(new BorderLayout(5, 5));
|
| | | indexedBranchesPanel
|
| | | .add(newFieldPanel(Translation.get("gb.indexedBranches"),
|
| | | indexedBranchesPalette), BorderLayout.CENTER);
|
| | |
|
| | | preReceivePalette = new JPalette<String>(true);
|
| | | preReceiveInherited = new JLabel();
|
| | | JPanel preReceivePanel = new JPanel(new BorderLayout(5, 5));
|
| | | preReceivePanel.add(preReceivePalette, BorderLayout.CENTER);
|
| | | preReceivePanel.add(preReceiveInherited, BorderLayout.WEST);
|
| | |
|
| | | postReceivePalette = new JPalette<String>(true);
|
| | | postReceiveInherited = new JLabel();
|
| | | JPanel postReceivePanel = new JPanel(new BorderLayout(5, 5));
|
| | | postReceivePanel.add(postReceivePalette, BorderLayout.CENTER);
|
| | | postReceivePanel.add(postReceiveInherited, BorderLayout.WEST);
|
| | | |
| | | customFieldsPanel = new JPanel();
|
| | | customFieldsPanel.setLayout(new BoxLayout(customFieldsPanel, BoxLayout.Y_AXIS));
|
| | | JScrollPane customFieldsScrollPane = new JScrollPane(customFieldsPanel);
|
| | | customFieldsScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
| | | customFieldsScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
|
| | |
|
| | | JTabbedPane panel = new JTabbedPane(JTabbedPane.TOP);
|
| | | panel.addTab(Translation.get("gb.general"), fieldsPanel);
|
| | | panel.addTab(Translation.get("gb.accessRestriction"), accessPanel);
|
| | | if (protocolVersion >= 2) {
|
| | | panel.addTab(Translation.get("gb.teams"), teamsPanel);
|
| | | }
|
| | | panel.addTab(Translation.get("gb.federation"), federationPanel);
|
| | | if (protocolVersion >= 3) {
|
| | | panel.addTab(Translation.get("gb.indexedBranches"), indexedBranchesPanel);
|
| | | }
|
| | | panel.addTab(Translation.get("gb.preReceiveScripts"), preReceivePanel);
|
| | | panel.addTab(Translation.get("gb.postReceiveScripts"), postReceivePanel);
|
| | | |
| | | panel.addTab(Translation.get("gb.customFields"), customFieldsScrollPane);
|
| | | |
| | |
|
| | | JButton createButton = new JButton(Translation.get("gb.save"));
|
| | | createButton.addActionListener(new ActionListener() {
|
| | |
| | | getContentPane().setLayout(new BorderLayout(5, 5));
|
| | | getContentPane().add(centerPanel, BorderLayout.CENTER);
|
| | | pack();
|
| | | nameField.requestFocus();
|
| | | }
|
| | | |
| | | private JPanel newFieldPanel(String label, JComponent comp) {
|
| | | return newFieldPanel(label, 150, comp);
|
| | | }
|
| | |
|
| | | private JPanel newFieldPanel(String label, JComponent comp) {
|
| | | private JPanel newFieldPanel(String label, int labelSize, JComponent comp) {
|
| | | JLabel fieldLabel = new JLabel(label);
|
| | | fieldLabel.setFont(fieldLabel.getFont().deriveFont(Font.BOLD));
|
| | | fieldLabel.setPreferredSize(new Dimension(150, 20));
|
| | | fieldLabel.setPreferredSize(new Dimension(labelSize, 20));
|
| | | JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
|
| | | panel.add(fieldLabel);
|
| | | panel.add(comp);
|
| | |
| | | error("Relative folder references (../) are prohibited.");
|
| | | return false;
|
| | | }
|
| | | if (rname.endsWith("/")) {
|
| | | rname = rname.substring(0, rname.length() - 1);
|
| | | }
|
| | |
|
| | | // confirm valid characters in repository name
|
| | | Character c = StringUtils.findInvalidCharacter(rname);
|
| | | if (c != null) {
|
| | | error(MessageFormat.format("Illegal character ''{0}'' in repository name!", c));
|
| | | error(MessageFormat.format(
|
| | | "Illegal character ''{0}'' in repository name!", c));
|
| | | return false;
|
| | | }
|
| | |
|
| | |
| | | // is case-insensitive, regardless of the Gitblit server's
|
| | | // filesystem
|
| | | if (repositoryNames.contains(rname.toLowerCase())) {
|
| | | error(MessageFormat.format(
|
| | | "Can not create repository ''{0}'' because it already exists.", rname));
|
| | | error(MessageFormat
|
| | | .format("Can not create repository ''{0}'' because it already exists.",
|
| | | rname));
|
| | | return false;
|
| | | }
|
| | | } else {
|
| | | // check rename collision
|
| | | if (!repositoryName.equalsIgnoreCase(rname)) {
|
| | | if (repositoryNames.contains(rname.toLowerCase())) {
|
| | | error(MessageFormat.format(
|
| | | "Failed to rename ''{0}'' because ''{1}'' already exists.",
|
| | | repositoryName, rname));
|
| | | error(MessageFormat
|
| | | .format("Failed to rename ''{0}'' because ''{1}'' already exists.",
|
| | | repositoryName, rname));
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | repository.name = rname;
|
| | | repository.description = descriptionField.getText();
|
| | | repository.owner = ownerField.getSelectedItem() == null ? null : ownerField
|
| | | .getSelectedItem().toString();
|
| | | repository.owner = ownerField.getSelectedItem() == null ? null
|
| | | : ownerField.getSelectedItem().toString();
|
| | | repository.HEAD = headRefField.getSelectedItem() == null ? null
|
| | | : headRefField.getSelectedItem().toString();
|
| | | repository.useTickets = useTickets.isSelected();
|
| | | repository.useDocs = useDocs.isSelected();
|
| | | repository.showRemoteBranches = showRemoteBranches.isSelected();
|
| | | repository.showReadme = showReadme.isSelected();
|
| | | repository.skipSizeCalculation = skipSizeCalculation.isSelected();
|
| | | repository.skipSummaryMetrics = skipSummaryMetrics.isSelected();
|
| | | repository.isFrozen = isFrozen.isSelected();
|
| | |
|
| | | repository.accessRestriction = (AccessRestrictionType) accessRestriction.getSelectedItem();
|
| | | repository.federationStrategy = (FederationStrategy) federationStrategy.getSelectedItem();
|
| | | String ml = mailingListsField.getText();
|
| | | if (!StringUtils.isEmpty(ml)) {
|
| | | Set<String> list = new HashSet<String>();
|
| | | for (String address : ml.split("(,|\\s)")) {
|
| | | if (StringUtils.isEmpty(address)) {
|
| | | continue;
|
| | | }
|
| | | list.add(address.toLowerCase());
|
| | | }
|
| | | repository.mailingLists = new ArrayList<String>(list);
|
| | | }
|
| | |
|
| | | repository.accessRestriction = (AccessRestrictionType) accessRestriction
|
| | | .getSelectedItem();
|
| | | repository.federationStrategy = (FederationStrategy) federationStrategy
|
| | | .getSelectedItem();
|
| | |
|
| | | if (repository.federationStrategy.exceeds(FederationStrategy.EXCLUDE)) {
|
| | | repository.federationSets = setsPalette.getSelections();
|
| | | }
|
| | | |
| | | repository.indexedBranches = indexedBranchesPalette.getSelections();
|
| | | repository.preReceiveScripts = preReceivePalette.getSelections();
|
| | | repository.postReceiveScripts = postReceivePalette.getSelections();
|
| | | |
| | | // Custom Fields
|
| | | repository.customFields = new LinkedHashMap<String, String>();
|
| | | if (customTextfields != null) {
|
| | | for (JTextField field : customTextfields) {
|
| | | String key = field.getName();
|
| | | String value = field.getText();
|
| | | repository.customFields.put(key, value);
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | JOptionPane.showMessageDialog(EditRepositoryDialog.this, message,
|
| | | Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);
|
| | | }
|
| | | |
| | | public void setAccessRestriction(AccessRestrictionType restriction) {
|
| | | this.accessRestriction.setSelectedItem(restriction);
|
| | | }
|
| | |
|
| | | public void setUsers(String owner, List<String> all, List<String> selected) {
|
| | | ownerField.setModel(new DefaultComboBoxModel(all.toArray()));
|
| | |
| | | ownerField.setSelectedItem(owner);
|
| | | }
|
| | | usersPalette.setObjects(all, selected);
|
| | | }
|
| | |
|
| | | public void setTeams(List<String> all, List<String> selected) {
|
| | | teamsPalette.setObjects(all, selected);
|
| | | }
|
| | |
|
| | | public void setRepositories(List<RepositoryModel> repositories) {
|
| | |
| | | public void setFederationSets(List<String> all, List<String> selected) {
|
| | | setsPalette.setObjects(all, selected);
|
| | | }
|
| | | |
| | | public void setIndexedBranches(List<String> all, List<String> selected) {
|
| | | indexedBranchesPalette.setObjects(all, selected);
|
| | | }
|
| | |
|
| | | public void setPreReceiveScripts(List<String> all, List<String> inherited,
|
| | | List<String> selected) {
|
| | | preReceivePalette.setObjects(all, selected);
|
| | | showInherited(inherited, preReceiveInherited);
|
| | | }
|
| | |
|
| | | public void setPostReceiveScripts(List<String> all, List<String> inherited,
|
| | | List<String> selected) {
|
| | | postReceivePalette.setObjects(all, selected);
|
| | | showInherited(inherited, postReceiveInherited);
|
| | | }
|
| | |
|
| | | private void showInherited(List<String> list, JLabel label) {
|
| | | StringBuilder sb = new StringBuilder();
|
| | | if (list != null && list.size() > 0) {
|
| | | sb.append("<html><body><b>INHERITED</b><ul style=\"margin-left:5px;list-style-type: none;\">");
|
| | | for (String script : list) {
|
| | | sb.append("<li>").append(script).append("</li>");
|
| | | }
|
| | | sb.append("</ul></body></html>");
|
| | | }
|
| | | label.setText(sb.toString());
|
| | | }
|
| | |
|
| | | public RepositoryModel getRepository() {
|
| | | if (canceled) {
|
| | |
| | | return usersPalette.getSelections();
|
| | | }
|
| | |
|
| | | public List<String> getPermittedTeams() {
|
| | | return teamsPalette.getSelections();
|
| | | }
|
| | | |
| | | public void setCustomFields(RepositoryModel repository, Map<String, String> customFields) {
|
| | | customFieldsPanel.removeAll();
|
| | | customTextfields = new ArrayList<JTextField>();
|
| | | |
| | | final Insets insets = new Insets(5, 5, 5, 5);
|
| | | JPanel fields = new JPanel(new GridLayout(0, 1, 0, 5)) {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Insets getInsets() {
|
| | | return insets;
|
| | | }
|
| | | }; |
| | | |
| | | for (Map.Entry<String, String> entry : customFields.entrySet()) {
|
| | | String field = entry.getKey();
|
| | | String value = "";
|
| | | if (repository.customFields != null && repository.customFields.containsKey(field)) {
|
| | | value = repository.customFields.get(field);
|
| | | }
|
| | | JTextField textField = new JTextField(value);
|
| | | textField.setName(field);
|
| | | |
| | | textField.setPreferredSize(new Dimension(450, 26));
|
| | | |
| | | fields.add(newFieldPanel(entry.getValue(), 250, textField));
|
| | | |
| | | customTextfields.add(textField);
|
| | | }
|
| | | JScrollPane jsp = new JScrollPane(fields); |
| | | jsp.getVerticalScrollBar().setBlockIncrement(100);
|
| | | jsp.getVerticalScrollBar().setUnitIncrement(100);
|
| | | jsp.setViewportBorder(null);
|
| | | customFieldsPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
|
| | | customFieldsPanel.add(jsp);
|
| | | }
|
| | |
|
| | | /**
|
| | | * ListCellRenderer to display descriptive text about the access
|
| | | * restriction.
|
| | | *
|
| | | */
|
| | | private class AccessRestrictionRenderer extends JLabel implements ListCellRenderer {
|
| | | private class AccessRestrictionRenderer extends JLabel implements
|
| | | ListCellRenderer {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Component getListCellRendererComponent(JList list, Object value, int index,
|
| | | boolean isSelected, boolean cellHasFocus) {
|
| | | public Component getListCellRendererComponent(JList list, Object value,
|
| | | int index, boolean isSelected, boolean cellHasFocus) {
|
| | | if (value instanceof AccessRestrictionType) {
|
| | | AccessRestrictionType restriction = (AccessRestrictionType) value;
|
| | | switch (restriction) {
|
| | |
| | | * ListCellRenderer to display descriptive text about the federation
|
| | | * strategy.
|
| | | */
|
| | | private class FederationStrategyRenderer extends JLabel implements ListCellRenderer {
|
| | | private class FederationStrategyRenderer extends JLabel implements
|
| | | ListCellRenderer {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public Component getListCellRendererComponent(JList list, Object value, int index,
|
| | | boolean isSelected, boolean cellHasFocus) {
|
| | | public Component getListCellRendererComponent(JList list, Object value,
|
| | | int index, boolean isSelected, boolean cellHasFocus) {
|
| | | if (value instanceof FederationStrategy) {
|
| | | FederationStrategy strategy = (FederationStrategy) value;
|
| | | switch (strategy) {
|