Refinements to search dialog and null checks in cell renderers
| | |
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | | if (value == null) {
|
| | | return this;
|
| | | }
|
| | | setText(value.toString());
|
| | | setText(value == null ? "" : value.toString());
|
| | | if (isSelected) {
|
| | | setForeground(table.getSelectionForeground());
|
| | | }
|
| | |
| | | @Override
|
| | | public Component getListCellRendererComponent(JList list, Object value, int index,
|
| | | boolean isSelected, boolean cellHasFocus) {
|
| | | setText(value.toString());
|
| | | setText(value == null ? "" : value.toString());
|
| | | if (isSelected) {
|
| | | setBackground(list.getSelectionBackground());
|
| | | setForeground(list.getSelectionForeground());
|
| | |
| | | setBackground(table.getBackground());
|
| | | messageLabel.setForeground(isSelected ? table.getSelectionForeground() : table
|
| | | .getForeground());
|
| | | if (value == null) {
|
| | | return this;
|
| | | }
|
| | | SyndicatedEntryModel entry = (SyndicatedEntryModel) value;
|
| | |
|
| | | if (gitblit == null) {
|
| | |
| | | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
|
| | | boolean hasFocus, int row, int column) {
|
| | | super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
| | | setValue(value, isSelected);
|
| | | setValue(value == null ? "" : value, isSelected);
|
| | | return this;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Component getListCellRendererComponent(JList list, Object value, int index,
|
| | | boolean isSelected, boolean cellHasFocus) {
|
| | | setValue(value, isSelected);
|
| | | setValue(value == null ? "" : value, isSelected);
|
| | | if (isSelected) {
|
| | | setBackground(list.getSelectionBackground());
|
| | | setForeground(list.getSelectionForeground());
|
| | |
| | | selectedBranch = branchSelector.getSelectedItem().toString();
|
| | | }
|
| | | updateBranches();
|
| | | if (selectedBranch != null) {
|
| | | if (StringUtils.isEmpty(selectedBranch)) {
|
| | | // do not select branch
|
| | | branchSelector.setSelectedIndex(-1);
|
| | | } else {
|
| | | if (branchChoices.getIndexOf(selectedBranch) > -1) {
|
| | | // select branch
|
| | | branchChoices.setSelectedItem(selectedBranch);
|
| | | } else {
|
| | | // branch does not exist, do not select branch
|
| | | branchSelector.setSelectedIndex(-1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | JPanel northControls = new JPanel(new FlowLayout(FlowLayout.LEFT, Utils.MARGIN, 0));
|
| | | northControls.add(new JLabel(Translation.get("gb.repository")));
|
| | | northControls.add(repositorySelector);
|
| | | northControls.add(new JLabel(Translation.get("gb.branch")));
|
| | | northControls.add(branchSelector);
|
| | | northControls.add(new JLabel(Translation.get("gb.type")));
|
| | | northControls.add(searchTypeSelector);
|
| | | northControls.add(new JLabel(Translation.get("gb.maxHits")));
|
| | | northControls.add(maxHitsSelector);
|
| | | northControls.add(searchFragment);
|
| | | northControls.add(search);
|
| | | northControls.add(prev);
|
| | | northControls.add(next);
|
| | | JPanel queryPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, Utils.MARGIN, 0));
|
| | | queryPanel.add(new JLabel(Translation.get("gb.repository")));
|
| | | queryPanel.add(repositorySelector);
|
| | | queryPanel.add(new JLabel(Translation.get("gb.branch")));
|
| | | queryPanel.add(branchSelector);
|
| | | queryPanel.add(new JLabel(Translation.get("gb.type")));
|
| | | queryPanel.add(searchTypeSelector);
|
| | | queryPanel.add(new JLabel(Translation.get("gb.maxHits")));
|
| | | queryPanel.add(maxHitsSelector);
|
| | |
|
| | | JPanel actionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, Utils.MARGIN, 0));
|
| | | actionsPanel.add(search);
|
| | | actionsPanel.add(prev);
|
| | | actionsPanel.add(next);
|
| | |
|
| | | JPanel northControls = new JPanel(new BorderLayout(Utils.MARGIN, Utils.MARGIN));
|
| | | northControls.add(queryPanel, BorderLayout.WEST);
|
| | | northControls.add(searchFragment, BorderLayout.CENTER);
|
| | | northControls.add(actionsPanel, BorderLayout.EAST);
|
| | | |
| | |
|
| | | JPanel northPanel = new JPanel(new BorderLayout(0, Utils.MARGIN));
|
| | | northPanel.add(header, BorderLayout.NORTH);
|