# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /data/work/src/netbeans-cdev # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: subversion/src/org/netbeans/modules/subversion/ui/history/SumaryViewRenderer.java --- subversion/src/org/netbeans/modules/subversion/ui/history/SumaryViewRenderer.java Base (BASE) +++ subversion/src/org/netbeans/modules/subversion/ui/history/SumaryViewRenderer.java Locally New @@ -0,0 +1,48 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2010 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.subversion.ui.history; + +/** + * + * @author tomas + */ +public class SumaryViewRenderer { + +} Index: subversion/src/org/netbeans/modules/subversion/ui/history/SummaryView.java --- subversion/src/org/netbeans/modules/subversion/ui/history/SummaryView.java Base (BASE) +++ subversion/src/org/netbeans/modules/subversion/ui/history/SummaryView.java Locally Modified (Based On LOCAL) @@ -69,6 +69,7 @@ import java.text.DateFormat; import java.util.ArrayList; import java.util.logging.Level; +import javax.swing.border.LineBorder; import org.netbeans.modules.subversion.FileStatusCache; import org.netbeans.modules.subversion.kenai.SvnKenaiAccessor; import org.netbeans.modules.subversion.client.SvnClient; @@ -610,8 +611,22 @@ } private class SummaryCellRenderer extends JPanel implements ListCellRenderer { - private static final String FIELDS_SEPARATOR = " "; // NOI18N + + private ContainerRenderer cr = new ContainerRenderer(); + private RevisionRenderer rr = new RevisionRenderer(); + + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + if (value instanceof RepositoryRevision) { + return cr.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + } else { + return rr.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + } + } + + private class ContainerRenderer extends JPanel implements ListCellRenderer { + private static final double DARKEN_FACTOR = 0.95; private Style selectedStyle; @@ -635,7 +650,7 @@ private HyperlinkLabel diffLink; private HyperlinkLabel revertLink; - public SummaryCellRenderer() { + public ContainerRenderer() { selectionBackground = new JList().getSelectionBackground(); selectionForeground = new JList().getSelectionForeground(); @@ -688,11 +703,7 @@ @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - if (value instanceof RepositoryRevision) { renderContainer(list, (RepositoryRevision) value, index, isSelected); - } else { - renderRevision(list, (RepositoryRevision.Event) value, index, isSelected); - } return this; } @@ -802,40 +813,6 @@ revertLink.set(NbBundle.getMessage(SummaryView.class, "CTL_Action_Revert"), foregroundColor, backgroundColor); // NOI18N } - private void renderRevision(JList list, RepositoryRevision.Event dispRevision, final int index, boolean isSelected) { - Style style; - StyledDocument sd = textPane.getStyledDocument(); - - Color backgroundColor; - Color foregroundColor; - - if (isSelected) { - foregroundColor = selectionForeground; - backgroundColor = selectionBackground; - style = selectedStyle; - } else { - foregroundColor = UIManager.getColor("List.foreground"); // NOI18N - backgroundColor = UIManager.getColor("List.background"); // NOI18N - style = normalStyle; - } - textPane.setBackground(backgroundColor); - actionsPane.setVisible(false); - - this.index = -1; - try { - sd.remove(0, sd.getLength()); - sd.setParagraphAttributes(0, sd.getLength(), indentStyle, false); - - sd.insertString(sd.getLength(), String.valueOf(dispRevision.getChangedPath().getAction()), null); - sd.insertString(sd.getLength(), FIELDS_SEPARATOR + dispRevision.getChangedPath().getPath(), null); - - sd.setCharacterAttributes(0, Integer.MAX_VALUE, style, false); - resizePane(sd.getText(0, sd.getLength() - 1), list.getFontMetrics(list.getFont())); - } catch (BadLocationException e) { - Subversion.LOG.log(Level.SEVERE, null, e); - } - } - private void resizePane(String text, FontMetrics fm) { if(text == null) { text = ""; @@ -871,6 +848,23 @@ } + private class RevisionRenderer extends DefaultListCellRenderer { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + renderRevision(list, (RepositoryRevision.Event) value, index, isSelected); + return this; + } + private void renderRevision(JList list, RepositoryRevision.Event dispRevision, final int index, boolean isSelected) { + StringBuilder sb = new StringBuilder(); + sb.append(FIELDS_SEPARATOR); + sb.append(String.valueOf(dispRevision.getChangedPath().getAction())); + sb.append(FIELDS_SEPARATOR); + sb.append(dispRevision.getChangedPath().getPath()); + super.getListCellRendererComponent(list, sb.toString(), index, isSelected, isSelected); + } + } + } + private static class HyperlinkLabel extends JLabel { public HyperlinkLabel() {