{"thread":{"id":"17490","subject":"[EGIT PATCH] Resurrect group filtering options in history pane","startedAt":"2009-02-01T20:36:18Z","lastAt":"2009-02-05T16:14:10Z","messageCount":6,"participants":["Robin Rosenberg","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"102773","messageId":"1233520578-10453-1-git-send-email-robin.rosenberg@dewire.com","threadId":"17490","inReplyTo":null,"subject":"[EGIT PATCH] Resurrect group filtering options in history pane","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2009-02-01T20:36:18Z","receivedAt":"2009-02-01T20:36:18Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"This commit restores the ability to filter on not only the selected\nresource but instead all changes in the same folder, same project\nor same repository. The filtering levels supported are Resource (no button\npessed), Folder, Project and Repository. Only the highest level has any\neffect. The flags are persistent between eclipse sessions in the same\nworkspace.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../egit/ui/internal/history/GitHistoryPage.java   |  108 +++++++++++++++++++-\n 1 files changed, 104 insertions(+), 4 deletions(-)\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\nindex d718cd7..4e95df4 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n@@ -96,7 +96,7 @@\n \n \t/**\n \t * Determine if the input can be shown in this viewer.\n-\t * \n+\t *\n \t * @param object\n \t *            an object that is hopefully of type ResourceList or IResource,\n \t *            but may be anything (including null).\n@@ -188,6 +188,18 @@ private static boolean typeOk(final IResource object) {\n \t */\n \tprivate List<String> pathFilters;\n \n+\tprivate static final String PREF_SHOWALLREPOVERSIONS = \"org.spearce.egit.ui.githistorypage.showallrepoversions\";\n+\n+\tprivate static final String PREF_SHOWALLPROJECTVERSIONS = \"org.spearce.egit.ui.githistorypage.showallprojectversions\";\n+\n+\tprivate static final String PREF_SHOWALLFOLDERVERSIONS = \"org.spearce.egit.ui.githistorypage.showallfolderversions\";\n+\n+\tprivate boolean showAllProjectVersions;\n+\n+\tprivate boolean showAllFolderVersions;\n+\n+\tprivate boolean showAllRepoVersions;\n+\n \t/**\n \t * The selection provider tracks the selected revisions for the context menu\n \t */\n@@ -236,9 +248,85 @@ public void createControl(final Composite parent) {\n \t\tattachContextMenu(fileViewer.getControl());\n \t\tlayout();\n \n+\t\tshowAllProjectVersions = Activator.getDefault().getPreferenceStore()\n+\t\t\t\t.getBoolean(PREF_SHOWALLPROJECTVERSIONS);\n+\t\tshowAllFolderVersions = Activator.getDefault().getPreferenceStore()\n+\t\t\t\t.getBoolean(PREF_SHOWALLFOLDERVERSIONS);\n+\t\tshowAllRepoVersions = Activator.getDefault().getPreferenceStore()\n+\t\t\t\t.getBoolean(PREF_SHOWALLREPOVERSIONS);\n+\n+\t\tAction showAllRepoVersionsAction = new Action(\"R\") {\n+\t\t\tpublic void run() {\n+\t\t\t\tcancelRefreshJob();\n+\t\t\t\tsetShowAllRepoVersions(isChecked());\n+\t\t\t\tcancelRefreshJob();\n+\t\t\t}\n+\t\t};\n+\t\tshowAllRepoVersionsAction\n+\t\t\t\t.setToolTipText(\"Show all versions for the repository containing the resource\");\n+\t\tshowAllRepoVersionsAction.setChecked(isShowAllRepoVersions());\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllRepoVersionsAction);\n+\n+\t\tAction showAllProjectVersionsAction = new Action(\"P\") {\n+\t\t\tpublic void run() {\n+\t\t\t\tcancelRefreshJob();\n+\t\t\t\tsetShowAllProjectVersions(isChecked());\n+\t\t\t\tinputSet();\n+\t\t\t}\n+\t\t};\n+\t\tshowAllProjectVersionsAction\n+\t\t\t\t.setToolTipText(\"Show all versions for the project containing the resource\");\n+\t\tshowAllProjectVersionsAction.setChecked(isShowAllProjectVersions());\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllProjectVersionsAction);\n+\n+\t\tAction showAllFolderVersionsAction = new Action(\"F\") {\n+\t\t\tpublic void run() {\n+\t\t\t\tcancelRefreshJob();\n+\t\t\t\tsetShowAllFolderVersion(isChecked());\n+\t\t\t\tinputSet();\n+\t\t\t}\n+\t\t};\n+\t\tshowAllFolderVersionsAction\n+\t\t\t\t.setToolTipText(\"Show all versions for the folder containing the resource\");\n+\t\tshowAllFolderVersionsAction.setChecked(isShowAllFolderVersions());\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllFolderVersionsAction);\n+\n \t\tRepository.addAnyRepositoryChangedListener(this);\n \t}\n \n+\t/* private */boolean isShowAllRepoVersions() {\n+\t\treturn showAllRepoVersions;\n+\t}\n+\n+\tvoid setShowAllRepoVersions(boolean showAllRepoVersions) {\n+\t\tthis.showAllRepoVersions = showAllRepoVersions;\n+\t\tActivator.getDefault().getPreferenceStore().setValue(\n+\t\t\t\tPREF_SHOWALLREPOVERSIONS, showAllRepoVersions);\n+\t}\n+\n+\t/* private */boolean isShowAllProjectVersions() {\n+\t\treturn showAllProjectVersions;\n+\t}\n+\n+\tvoid setShowAllProjectVersions(boolean showAllProjectVersions) {\n+\t\tthis.showAllProjectVersions = showAllProjectVersions;\n+\t\tActivator.getDefault().getPreferenceStore().setValue(\n+\t\t\t\tPREF_SHOWALLPROJECTVERSIONS, showAllProjectVersions);\n+\t}\n+\n+\t/* private */boolean isShowAllFolderVersions() {\n+\t\treturn showAllFolderVersions;\n+\t}\n+\n+\tvoid setShowAllFolderVersion(boolean showAllFolderVersions) {\n+\t\tthis.showAllFolderVersions = showAllFolderVersions;\n+\t\tActivator.getDefault().getPreferenceStore().setValue(\n+\t\t\t\tPREF_SHOWALLFOLDERVERSIONS, showAllFolderVersions);\n+\t}\n+\n \tprivate Runnable refschangedRunnable;\n \n \tpublic void refsChanged(final RefsChangedEvent e) {\n@@ -566,9 +654,21 @@ public boolean inputSet() {\n \t\t\telse if (db != map.getRepository())\n \t\t\t\treturn false;\n \n-\t\t\tfinal String name = map.getRepoRelativePath(r);\n-\t\t\tif (name != null && name.length() > 0)\n-\t\t\t\tpaths.add(name);\n+\t\t\tif (isShowAllFolderVersions()) {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r.getParent());\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t} else if (isShowAllProjectVersions()) {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r.getProject());\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t} else if (isShowAllRepoVersions()) {\n+\t\t\t\t// nothing\n+\t\t\t} else {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r);\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t}\n \t\t}\n \n \t\tif (db == null)\n-- \n1.6.1.285.g35d8b\n"},{"id":"102774","messageId":"200902012143.31323.robin.rosenberg.lists@dewire.com","threadId":"17490","inReplyTo":"1233520578-10453-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH] Resurrect group filtering options in history pane","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2009-02-01T20:43:31Z","receivedAt":"2009-02-01T20:43:31Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"söndag 01 februari 2009 21:36:18 skrev jag:\n> This commit restores the ability to filter on not only the selected\n> resource but instead all changes in the same folder, same project\n> or same repository. \n\n> The filtering levels supported are Resource (no button\n> pessed), Folder, Project and Repository. Only the highest level has any\n> effect. \n\nOmg... I just told people not to repeat themselves...\n\n> The flags are persistent between eclipse sessions in the same\n> workspace.\n\n-- robin\n"},{"id":"102790","messageId":"20090201223920.GQ26880@spearce.org","threadId":"17490","inReplyTo":"1233520578-10453-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH] Resurrect group filtering options in history pane","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-01T22:39:20Z","receivedAt":"2009-02-01T22:39:20Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> This commit restores the ability to filter on not only the selected\n> resource but instead all changes in the same folder, same project\n> or same repository. The filtering levels supported are Resource (no button\n> pessed), Folder, Project and Repository. Only the highest level has any\n> effect. The flags are persistent between eclipse sessions in the same\n> workspace.\n\nShouldn't these filtering flag buttons be exclusive buttons,\nin the sense that only one can be depressed at a time, or none\nare depressed?\n\nI managed to depress R,P,F by doing it in the opposite order (push\nF, then P, then R) and I have no clue what that should really mean\nwhen looking at the history.\n\nAlso, the R/P/F labels are a bit too similar.  I know its what we\nhad before, but these are blending too much to me visually and I\nkeep reading the F as though it were a misdrawn R or P, like the\nbox isn't big enough for it.  Which actually has me thinking that\nwith the proportional width font on my workbench the F is using a\nnarrower button box than the R or P, which looks funny.\n\n> diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n> index d718cd7..4e95df4 100644\n> --- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n> +++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n> @@ -96,7 +96,7 @@\n>  \n>  \t/**\n>  \t * Determine if the input can be shown in this viewer.\n> -\t * \n> +\t *\n>  \t * @param object\n>  \t *            an object that is hopefully of type ResourceList or IResource,\n>  \t *            but may be anything (including null).\n\nUnnecessary re-formatting hunk.  Please discard from the patch.\n\n-- \nShawn.\n"},{"id":"103220","messageId":"1233787393-21023-1-git-send-email-robin.rosenberg@dewire.com","threadId":"17490","inReplyTo":"20090201223920.GQ26880@spearce.org","subject":"[EGIT PATCH] Resurrect group filtering options in history view","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2009-02-04T22:43:13Z","receivedAt":"2009-02-04T22:43:13Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"This commit restores the ability to filter on not only the selected\nresource but instead all changes in the same folder, same project\nor same repository. The flag is persistent.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n org.spearce.egit.ui/icons/elcl16/filterfolder.gif  |  Bin 0 -> 153 bytes\n org.spearce.egit.ui/icons/elcl16/filterproject.gif |  Bin 0 -> 154 bytes\n org.spearce.egit.ui/icons/elcl16/filterrepo.gif    |  Bin 0 -> 322 bytes\n .../src/org/spearce/egit/ui/UIIcons.java           |   12 ++\n .../src/org/spearce/egit/ui/UIText.java            |   11 ++-\n .../egit/ui/internal/history/GitHistoryPage.java   |  115 +++++++++++++++++++-\n .../src/org/spearce/egit/ui/uitext.properties      |    4 +\n 7 files changed, 136 insertions(+), 6 deletions(-)\n create mode 100644 org.spearce.egit.ui/icons/elcl16/filterfolder.gif\n create mode 100644 org.spearce.egit.ui/icons/elcl16/filterproject.gif\n create mode 100644 org.spearce.egit.ui/icons/elcl16/filterrepo.gif\n\nsÃ¶ndag 01 februari 2009 23:39:20 skrev Shawn O. Pearce:\n> Shouldn't these filtering flag buttons be exclusive buttons,\n> in the sense that only one can be depressed at a time, or none\n> are depressed?\nFixed.\n> Also, the R/P/F labels are a bit too similar.  I know its what we\n> had before, but these are blending too much to me visually and I\n> keep reading the F as though it were a misdrawn R or P, like the\n> box isn't big enough for it.  Which actually has me thinking that\n> with the proportional width font on my workbench the F is using a\n> narrower button box than the R or P, which looks funny.\n\nHow about these cute icons instead? They are shamelessy stolen from\nother places in Eclipse and mis-treated using kolourpaint.\n\nBtw, I think we have a case for open source mail programs that can display\nimage patches inline.... Any takers? (I'm using KMail).\n\n-- robin\n\ndiff --git a/org.spearce.egit.ui/icons/elcl16/filterfolder.gif b/org.spearce.egit.ui/icons/elcl16/filterfolder.gif\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..55843e768f2d5509d2b48a1f881fe69ffbe9d59a\nGIT binary patch\nliteral 153\nzcmZ?wbhEHb6krfw_{_lI8x<R#Qq$nT@Z&;7epyRu?UeGCSuw3kL%KKrxG~|!g9Sf6\nzoM1o#ia%Kx85npNbU<PtGZ<LhCY<zKt$O)}SHl&tA`zFDjkB+KI$9<6DD0lRK&9Cx\nw|InlVO;daqUU;k3<f62a=TlMhipj#pewK1>+9q0S16GPM?`iDS6=bjm0G<puSpWb4\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/elcl16/filterproject.gif b/org.spearce.egit.ui/icons/elcl16/filterproject.gif\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..a24b94dcfa75ff64da290f69c8b20d21886c7c11\nGIT binary patch\nliteral 154\nzcmZ?wbhEHb6krfw_{_lI8x<R#Qq$nT@Z&;7epyRu?Gy%v|K%;SVp^AmbZ=((|NqC0\nz2|pez`0?Qc0~jd&WMO1r;A7AM@jzxUu()41>A70<^9`?tD`8C{E-xErU-5LbO6*hE\nzJ^7$cvrWF+<Nr-ldJh^%@H%!UZZy!C$M*05=iP+9<5x~y<m&a(o^tK6K(z5R4hCxg\nDA$>k#\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/elcl16/filterrepo.gif b/org.spearce.egit.ui/icons/elcl16/filterrepo.gif\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..c1cfa7bedc95329943acc214bf92e072059ad54b\nGIT binary patch\nliteral 322\nzcmZ?wbhEHb6krfw_^QU>8x<R#QnS6Ddt<HD-bo_6CtK{EV)=F+&!IlmgS~1m+LaD3\nzQaQa+|JW+iLtCsKFVTOxUhnlzmB(9bUmsNccGBX+&al_V{J&iH`g6<Y&uzbtM?=0p\nziuign;p@G`-;c6?KPk;GYe}u0Qr<EvrgdpZ_vYUprv3l_pMiQn@h1x-1A{t)4#-H5\nzpBUKU4@@rb(2;U<p16^NiDRnUB@LEURtvoogC$PzO+0d{DZsGOpYP0a=fXMClKjyH\nzW-exvogc+Km~w+7ota-;fQ#A3MT)tVna9UZol#AUnOP_;C?rfhA~Jezx_ZJwS4ReG\nE0D-q??*IS*\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java\nindex 1697542..13749fa 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java\n@@ -71,6 +71,15 @@\n \t/** Connect Wizard banner */\n \tpublic static final ImageDescriptor WIZBAN_CONNECT_REPO;\n \n+\t/** History filter, select all version in repo */\n+\tpublic static ImageDescriptor FILTERREPO;\n+\n+\t/** History filter, select all version in same project */\n+\tpublic static ImageDescriptor FILTERPROJECT;\n+\n+\t/** History filter, select all version in same folder */\n+\tpublic static ImageDescriptor FILTERFOLDER;\n+\n \tprivate static final URL base;\n \n \tstatic {\n@@ -97,6 +106,9 @@\n \t\tCHECKBOX_ENABLED_UNCHECKED = map(\"checkboxes/enabled_unchecked.gif\");\n \t\tCHECKBOX_DISABLED_CHECKED = map(\"checkboxes/disabled_checked.gif\");\n \t\tCHECKBOX_DISABLED_UNCHECKED = map(\"checkboxes/disabled_unchecked.gif\");\n+\t\tFILTERREPO = map(\"elcl16/filterrepo.gif\"); //$NON-NLS-1$\n+\t\tFILTERPROJECT = map(\"elcl16/filterproject.gif\"); //$NON-NLS-1$\n+\t\tFILTERFOLDER = map(\"elcl16/filterfolder.gif\"); //$NON-NLS-1$\n \t}\n \n \tprivate static ImageDescriptor map(final String icon) {\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\nindex 7a7d3ef..d386482 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n@@ -913,8 +913,17 @@\n \t/** */\n \tpublic static String BranchSelectionDialog_Refs;\n \n+\t/** */\n+\tpublic static String HistoryPage_ShowAllVersionsForProject;\n+\n+\t/** */\n+\tpublic static String HistoryPage_ShowAllVersionsForRepo;\n+\n+\t/** */\n+\tpublic static String HistoryPage_ShowAllVersionsForFolder;\n+\n \tstatic {\n-\t\tinitializeMessages(UIText.class.getPackage().getName() + \".uitext\",\n+\t\tinitializeMessages(UIText.class.getPackage().getName() + \".uitext\", //$NON-NLS-1$\n \t\t\t\tUIText.class);\n \t}\n }\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\nindex d718cd7..08b8d69 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n@@ -1,5 +1,4 @@\n /*******************************************************************************\n- * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n  * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>\n  * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n  *\n@@ -27,6 +26,7 @@\n import org.eclipse.jface.action.IToolBarManager;\n import org.eclipse.jface.action.MenuManager;\n import org.eclipse.jface.action.Separator;\n+import org.eclipse.jface.resource.ImageDescriptor;\n import org.eclipse.jface.text.ITextOperationTarget;\n import org.eclipse.jface.viewers.ISelection;\n import org.eclipse.jface.viewers.ISelectionChangedListener;\n@@ -96,7 +96,7 @@\n \n \t/**\n \t * Determine if the input can be shown in this viewer.\n-\t * \n+\t *\n \t * @param object\n \t *            an object that is hopefully of type ResourceList or IResource,\n \t *            but may be anything (including null).\n@@ -193,6 +193,98 @@ private static boolean typeOk(final IResource object) {\n \t */\n \tprivate RevObjectSelectionProvider revObjectSelectionProvider;\n \n+\tprivate static final String PREF_SHOWALLFILTER = \"org.spearce.egit.ui.githistorypage.showallfilter\"; //$NON-NLS-1$\n+\n+\tenum ShowFilter {\n+\t\tSHOWALLRESOURCE,\n+\t\tSHOWALLFOLDER,\n+\t\tSHOWALLPROJECT,\n+\t\tSHOWALLREPO,\n+\t}\n+\n+\tclass ShowFilterAction extends Action {\n+\t\tprivate final ShowFilter filter;\n+\n+\t\tShowFilterAction(ShowFilter filter, ImageDescriptor icon, String toolTipText) {\n+\t\t\tsuper(null, IAction.AS_CHECK_BOX);\n+\t\t\tthis.filter = filter;\n+\t\t\tsetImageDescriptor(icon);\n+\t\t\tsetToolTipText(toolTipText);\n+\t\t}\n+\t\t@Override\n+\t\tpublic void run() {\n+\t\t\tif (!isChecked()) {\n+\t\t\t\tif (showAllFilter == filter) {\n+\t\t\t\t\tshowAllFilter = ShowFilter.SHOWALLRESOURCE;\n+\t\t\t\t\trefresh();\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (isChecked() && showAllFilter != filter) {\n+\t\t\t\tshowAllFilter = filter;\n+\t\t\t\tif (this != showAllRepoVersionsAction)\n+\t\t\t\t\tshowAllRepoVersionsAction.setChecked(false);\n+\t\t\t\tif (this != showAllProjectVersionsAction)\n+\t\t\t\t\tshowAllProjectVersionsAction.setChecked(false);\n+\t\t\t\tif (this != showAllFolderVersionsAction)\n+\t\t\t\t\tshowAllFolderVersionsAction.setChecked(false);\n+\t\t\t\trefresh();\n+\t\t\t}\n+\t\t\tActivator.getDefault().getPreferenceStore().setValue(\n+\t\t\t\t\tPREF_SHOWALLFILTER, showAllFilter.toString());\n+\t\t}\n+\t\t@Override\n+\t\tpublic String toString() {\n+\t\t\treturn \"ShowFilter[\" + filter.toString() + \"]\"; //$NON-NLS-1$ //$NON-NLS-2$\n+\t\t}\n+\t}\n+\n+\tprivate ShowFilter showAllFilter = ShowFilter.SHOWALLRESOURCE;\n+\n+\tprivate ShowFilterAction showAllRepoVersionsAction;\n+\n+\tprivate ShowFilterAction showAllProjectVersionsAction;\n+\n+\tprivate ShowFilterAction showAllFolderVersionsAction;\n+\n+\tprivate void createResourceFilterActions() {\n+\t\ttry {\n+\t\t\tshowAllFilter = ShowFilter.valueOf(Activator.getDefault()\n+\t\t\t\t\t.getPreferenceStore().getString(PREF_SHOWALLFILTER));\n+\t\t} catch (IllegalArgumentException e) {\n+\t\t\tshowAllFilter = ShowFilter.SHOWALLRESOURCE;\n+\t\t}\n+\n+\t\tshowAllRepoVersionsAction = new ShowFilterAction(\n+\t\t\t\tShowFilter.SHOWALLREPO, UIIcons.FILTERREPO,\n+\t\t\t\tUIText.HistoryPage_ShowAllVersionsForRepo);\n+\n+\t\tshowAllProjectVersionsAction = new ShowFilterAction(\n+\t\t\t\tShowFilter.SHOWALLPROJECT, UIIcons.FILTERPROJECT,\n+\t\t\t\tUIText.HistoryPage_ShowAllVersionsForProject);\n+\n+\t\tshowAllFolderVersionsAction = new ShowFilterAction(\n+\t\t\t\tShowFilter.SHOWALLFOLDER, UIIcons.FILTERFOLDER,\n+\t\t\t\tUIText.HistoryPage_ShowAllVersionsForFolder);\n+\n+\t\tshowAllRepoVersionsAction\n+\t\t\t\t.setChecked(showAllFilter == showAllRepoVersionsAction.filter);\n+\t\tshowAllProjectVersionsAction\n+\t\t\t\t.setChecked(showAllFilter == showAllProjectVersionsAction.filter);\n+\t\tshowAllFolderVersionsAction\n+\t\t\t\t.setChecked(showAllFilter == showAllFolderVersionsAction.filter);\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(new Separator());\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllRepoVersionsAction);\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllProjectVersionsAction);\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllFolderVersionsAction);\n+\t}\n+\n \t@Override\n \tpublic void createControl(final Composite parent) {\n \t\tGridData gd;\n@@ -227,6 +319,7 @@ public void createControl(final Composite parent) {\n \t\tpopupMgr = new MenuManager(null, POPUP_ID);\n \t\tattachCommitSelectionChanged();\n \t\tcreateLocalToolbarActions();\n+\t\tcreateResourceFilterActions();\n \t\tcreateStandardActions();\n \t\tcreateViewMenu();\n \n@@ -566,9 +659,21 @@ public boolean inputSet() {\n \t\t\telse if (db != map.getRepository())\n \t\t\t\treturn false;\n \n-\t\t\tfinal String name = map.getRepoRelativePath(r);\n-\t\t\tif (name != null && name.length() > 0)\n-\t\t\t\tpaths.add(name);\n+\t\t\tif (showAllFilter == ShowFilter.SHOWALLFOLDER) {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r.getParent());\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t} else if (showAllFilter == ShowFilter.SHOWALLPROJECT) {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r.getProject());\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t} else if (showAllFilter == ShowFilter.SHOWALLREPO) {\n+\t\t\t\t// nothing\n+\t\t\t} else /*if (showAllFilter == ShowFilter.SHOWALLRESOURCE)*/ {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r);\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t}\n \t\t}\n \n \t\tif (db == null)\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\nindex a86e58b..52fa4f8 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\n@@ -199,6 +199,10 @@ HistoryPage_findbar_changeto_committer=Change to Committer\n HistoryPage_findbar_exceeded=Results limit exceeded\n HistoryPage_findbar_notFound=String not found\n \n+HistoryPage_ShowAllVersionsForRepo=Show all versions for the repository containing the resource\n+HistoryPage_ShowAllVersionsForProject=Show all versions for the project containing the resource\n+HistoryPage_ShowAllVersionsForFolder=Show all versions for the folder containing the resource\n+\n HistoryPreferencePage_title=Git\n \n PushAction_wrongURIDescription=Remote repositories URIs configuration is corrupted.\n-- \n1.6.1.285.g35d8b\n"},{"id":"103233","messageId":"1233789799-24333-1-git-send-email-robin.rosenberg@dewire.com","threadId":"17490","inReplyTo":"1233787393-21023-1-git-send-email-robin.rosenberg@dewire.com","subject":"[EGIT PATCH] Resurrect group filtering options in history view","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2009-02-04T23:23:19Z","receivedAt":"2009-02-04T23:23:19Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"This commit restores the ability to filter on not only the selected\nresource but instead all changes in the same folder, same project\nor same repository. The flag is persistent.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n\nSame thing, not not adding the NON-NLS stuff tof UIIcons and UIText. We\nshould use SuppressWarnings for those files.\n\n-- robin\n org.spearce.egit.ui/icons/elcl16/filterfolder.gif  |  Bin 0 -> 153 bytes\n org.spearce.egit.ui/icons/elcl16/filterproject.gif |  Bin 0 -> 154 bytes\n org.spearce.egit.ui/icons/elcl16/filterrepo.gif    |  Bin 0 -> 322 bytes\n .../src/org/spearce/egit/ui/UIIcons.java           |   12 ++\n .../src/org/spearce/egit/ui/UIText.java            |    9 ++\n .../egit/ui/internal/history/GitHistoryPage.java   |  113 +++++++++++++++++++-\n .../src/org/spearce/egit/ui/uitext.properties      |    4 +\n 7 files changed, 134 insertions(+), 4 deletions(-)\n create mode 100644 org.spearce.egit.ui/icons/elcl16/filterfolder.gif\n create mode 100644 org.spearce.egit.ui/icons/elcl16/filterproject.gif\n create mode 100644 org.spearce.egit.ui/icons/elcl16/filterrepo.gif\n\ndiff --git a/org.spearce.egit.ui/icons/elcl16/filterfolder.gif b/org.spearce.egit.ui/icons/elcl16/filterfolder.gif\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..55843e768f2d5509d2b48a1f881fe69ffbe9d59a\nGIT binary patch\nliteral 153\nzcmZ?wbhEHb6krfw_{_lI8x<R#Qq$nT@Z&;7epyRu?UeGCSuw3kL%KKrxG~|!g9Sf6\nzoM1o#ia%Kx85npNbU<PtGZ<LhCY<zKt$O)}SHl&tA`zFDjkB+KI$9<6DD0lRK&9Cx\nw|InlVO;daqUU;k3<f62a=TlMhipj#pewK1>+9q0S16GPM?`iDS6=bjm0G<puSpWb4\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/elcl16/filterproject.gif b/org.spearce.egit.ui/icons/elcl16/filterproject.gif\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..a24b94dcfa75ff64da290f69c8b20d21886c7c11\nGIT binary patch\nliteral 154\nzcmZ?wbhEHb6krfw_{_lI8x<R#Qq$nT@Z&;7epyRu?Gy%v|K%;SVp^AmbZ=((|NqC0\nz2|pez`0?Qc0~jd&WMO1r;A7AM@jzxUu()41>A70<^9`?tD`8C{E-xErU-5LbO6*hE\nzJ^7$cvrWF+<Nr-ldJh^%@H%!UZZy!C$M*05=iP+9<5x~y<m&a(o^tK6K(z5R4hCxg\nDA$>k#\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/icons/elcl16/filterrepo.gif b/org.spearce.egit.ui/icons/elcl16/filterrepo.gif\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..c1cfa7bedc95329943acc214bf92e072059ad54b\nGIT binary patch\nliteral 322\nzcmZ?wbhEHb6krfw_^QU>8x<R#QnS6Ddt<HD-bo_6CtK{EV)=F+&!IlmgS~1m+LaD3\nzQaQa+|JW+iLtCsKFVTOxUhnlzmB(9bUmsNccGBX+&al_V{J&iH`g6<Y&uzbtM?=0p\nziuign;p@G`-;c6?KPk;GYe}u0Qr<EvrgdpZ_vYUprv3l_pMiQn@h1x-1A{t)4#-H5\nzpBUKU4@@rb(2;U<p16^NiDRnUB@LEURtvoogC$PzO+0d{DZsGOpYP0a=fXMClKjyH\nzW-exvogc+Km~w+7ota-;fQ#A3MT)tVna9UZol#AUnOP_;C?rfhA~Jezx_ZJwS4ReG\nE0D-q??*IS*\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java\nindex 1697542..ced186e 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIIcons.java\n@@ -71,6 +71,15 @@\n \t/** Connect Wizard banner */\n \tpublic static final ImageDescriptor WIZBAN_CONNECT_REPO;\n \n+\t/** History filter, select all version in repo */\n+\tpublic static ImageDescriptor FILTERREPO;\n+\n+\t/** History filter, select all version in same project */\n+\tpublic static ImageDescriptor FILTERPROJECT;\n+\n+\t/** History filter, select all version in same folder */\n+\tpublic static ImageDescriptor FILTERFOLDER;\n+\n \tprivate static final URL base;\n \n \tstatic {\n@@ -97,6 +106,9 @@\n \t\tCHECKBOX_ENABLED_UNCHECKED = map(\"checkboxes/enabled_unchecked.gif\");\n \t\tCHECKBOX_DISABLED_CHECKED = map(\"checkboxes/disabled_checked.gif\");\n \t\tCHECKBOX_DISABLED_UNCHECKED = map(\"checkboxes/disabled_unchecked.gif\");\n+\t\tFILTERREPO = map(\"elcl16/filterrepo.gif\");\n+\t\tFILTERPROJECT = map(\"elcl16/filterproject.gif\");\n+\t\tFILTERFOLDER = map(\"elcl16/filterfolder.gif\");\n \t}\n \n \tprivate static ImageDescriptor map(final String icon) {\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\nindex 7a7d3ef..d74f53e 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/UIText.java\n@@ -913,6 +913,15 @@\n \t/** */\n \tpublic static String BranchSelectionDialog_Refs;\n \n+\t/** */\n+\tpublic static String HistoryPage_ShowAllVersionsForProject;\n+\n+\t/** */\n+\tpublic static String HistoryPage_ShowAllVersionsForRepo;\n+\n+\t/** */\n+\tpublic static String HistoryPage_ShowAllVersionsForFolder;\n+\n \tstatic {\n \t\tinitializeMessages(UIText.class.getPackage().getName() + \".uitext\",\n \t\t\t\tUIText.class);\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\nindex d718cd7..08887c8 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java\n@@ -1,5 +1,4 @@\n /*******************************************************************************\n- * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>\n  * Copyright (C) 2008, Roger C. Soares <rogersoares@intelinet.com.br>\n  * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n  *\n@@ -27,6 +26,7 @@\n import org.eclipse.jface.action.IToolBarManager;\n import org.eclipse.jface.action.MenuManager;\n import org.eclipse.jface.action.Separator;\n+import org.eclipse.jface.resource.ImageDescriptor;\n import org.eclipse.jface.text.ITextOperationTarget;\n import org.eclipse.jface.viewers.ISelection;\n import org.eclipse.jface.viewers.ISelectionChangedListener;\n@@ -193,6 +193,98 @@ private static boolean typeOk(final IResource object) {\n \t */\n \tprivate RevObjectSelectionProvider revObjectSelectionProvider;\n \n+\tprivate static final String PREF_SHOWALLFILTER = \"org.spearce.egit.ui.githistorypage.showallfilter\"; //$NON-NLS-1$\n+\n+\tenum ShowFilter {\n+\t\tSHOWALLRESOURCE,\n+\t\tSHOWALLFOLDER,\n+\t\tSHOWALLPROJECT,\n+\t\tSHOWALLREPO,\n+\t}\n+\n+\tclass ShowFilterAction extends Action {\n+\t\tprivate final ShowFilter filter;\n+\n+\t\tShowFilterAction(ShowFilter filter, ImageDescriptor icon, String toolTipText) {\n+\t\t\tsuper(null, IAction.AS_CHECK_BOX);\n+\t\t\tthis.filter = filter;\n+\t\t\tsetImageDescriptor(icon);\n+\t\t\tsetToolTipText(toolTipText);\n+\t\t}\n+\t\t@Override\n+\t\tpublic void run() {\n+\t\t\tif (!isChecked()) {\n+\t\t\t\tif (showAllFilter == filter) {\n+\t\t\t\t\tshowAllFilter = ShowFilter.SHOWALLRESOURCE;\n+\t\t\t\t\trefresh();\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (isChecked() && showAllFilter != filter) {\n+\t\t\t\tshowAllFilter = filter;\n+\t\t\t\tif (this != showAllRepoVersionsAction)\n+\t\t\t\t\tshowAllRepoVersionsAction.setChecked(false);\n+\t\t\t\tif (this != showAllProjectVersionsAction)\n+\t\t\t\t\tshowAllProjectVersionsAction.setChecked(false);\n+\t\t\t\tif (this != showAllFolderVersionsAction)\n+\t\t\t\t\tshowAllFolderVersionsAction.setChecked(false);\n+\t\t\t\trefresh();\n+\t\t\t}\n+\t\t\tActivator.getDefault().getPreferenceStore().setValue(\n+\t\t\t\t\tPREF_SHOWALLFILTER, showAllFilter.toString());\n+\t\t}\n+\t\t@Override\n+\t\tpublic String toString() {\n+\t\t\treturn \"ShowFilter[\" + filter.toString() + \"]\"; //$NON-NLS-1$ //$NON-NLS-2$\n+\t\t}\n+\t}\n+\n+\tprivate ShowFilter showAllFilter = ShowFilter.SHOWALLRESOURCE;\n+\n+\tprivate ShowFilterAction showAllRepoVersionsAction;\n+\n+\tprivate ShowFilterAction showAllProjectVersionsAction;\n+\n+\tprivate ShowFilterAction showAllFolderVersionsAction;\n+\n+\tprivate void createResourceFilterActions() {\n+\t\ttry {\n+\t\t\tshowAllFilter = ShowFilter.valueOf(Activator.getDefault()\n+\t\t\t\t\t.getPreferenceStore().getString(PREF_SHOWALLFILTER));\n+\t\t} catch (IllegalArgumentException e) {\n+\t\t\tshowAllFilter = ShowFilter.SHOWALLRESOURCE;\n+\t\t}\n+\n+\t\tshowAllRepoVersionsAction = new ShowFilterAction(\n+\t\t\t\tShowFilter.SHOWALLREPO, UIIcons.FILTERREPO,\n+\t\t\t\tUIText.HistoryPage_ShowAllVersionsForRepo);\n+\n+\t\tshowAllProjectVersionsAction = new ShowFilterAction(\n+\t\t\t\tShowFilter.SHOWALLPROJECT, UIIcons.FILTERPROJECT,\n+\t\t\t\tUIText.HistoryPage_ShowAllVersionsForProject);\n+\n+\t\tshowAllFolderVersionsAction = new ShowFilterAction(\n+\t\t\t\tShowFilter.SHOWALLFOLDER, UIIcons.FILTERFOLDER,\n+\t\t\t\tUIText.HistoryPage_ShowAllVersionsForFolder);\n+\n+\t\tshowAllRepoVersionsAction\n+\t\t\t\t.setChecked(showAllFilter == showAllRepoVersionsAction.filter);\n+\t\tshowAllProjectVersionsAction\n+\t\t\t\t.setChecked(showAllFilter == showAllProjectVersionsAction.filter);\n+\t\tshowAllFolderVersionsAction\n+\t\t\t\t.setChecked(showAllFilter == showAllFolderVersionsAction.filter);\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(new Separator());\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllRepoVersionsAction);\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllProjectVersionsAction);\n+\n+\t\tgetSite().getActionBars().getToolBarManager().add(\n+\t\t\t\tshowAllFolderVersionsAction);\n+\t}\n+\n \t@Override\n \tpublic void createControl(final Composite parent) {\n \t\tGridData gd;\n@@ -227,6 +319,7 @@ public void createControl(final Composite parent) {\n \t\tpopupMgr = new MenuManager(null, POPUP_ID);\n \t\tattachCommitSelectionChanged();\n \t\tcreateLocalToolbarActions();\n+\t\tcreateResourceFilterActions();\n \t\tcreateStandardActions();\n \t\tcreateViewMenu();\n \n@@ -566,9 +659,21 @@ public boolean inputSet() {\n \t\t\telse if (db != map.getRepository())\n \t\t\t\treturn false;\n \n-\t\t\tfinal String name = map.getRepoRelativePath(r);\n-\t\t\tif (name != null && name.length() > 0)\n-\t\t\t\tpaths.add(name);\n+\t\t\tif (showAllFilter == ShowFilter.SHOWALLFOLDER) {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r.getParent());\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t} else if (showAllFilter == ShowFilter.SHOWALLPROJECT) {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r.getProject());\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t} else if (showAllFilter == ShowFilter.SHOWALLREPO) {\n+\t\t\t\t// nothing\n+\t\t\t} else /*if (showAllFilter == ShowFilter.SHOWALLRESOURCE)*/ {\n+\t\t\t\tfinal String name = map.getRepoRelativePath(r);\n+\t\t\t\tif (name != null && name.length() > 0)\n+\t\t\t\t\tpaths.add(name);\n+\t\t\t}\n \t\t}\n \n \t\tif (db == null)\ndiff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\nindex a86e58b..52fa4f8 100644\n--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\n+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/uitext.properties\n@@ -199,6 +199,10 @@ HistoryPage_findbar_changeto_committer=Change to Committer\n HistoryPage_findbar_exceeded=Results limit exceeded\n HistoryPage_findbar_notFound=String not found\n \n+HistoryPage_ShowAllVersionsForRepo=Show all versions for the repository containing the resource\n+HistoryPage_ShowAllVersionsForProject=Show all versions for the project containing the resource\n+HistoryPage_ShowAllVersionsForFolder=Show all versions for the folder containing the resource\n+\n HistoryPreferencePage_title=Git\n \n PushAction_wrongURIDescription=Remote repositories URIs configuration is corrupted.\n-- \n1.6.1.285.g35d8b\n"},{"id":"103346","messageId":"20090205161410.GJ26880@spearce.org","threadId":"17490","inReplyTo":"1233789799-24333-1-git-send-email-robin.rosenberg@dewire.com","subject":"Re: [EGIT PATCH] Resurrect group filtering options in history view","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-02-05T16:14:10Z","receivedAt":"2009-02-05T16:14:10Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> This commit restores the ability to filter on not only the selected\n> resource but instead all changes in the same folder, same project\n> or same repository. The flag is persistent.\n> \n> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n> ---\n> \n> Same thing, not not adding the NON-NLS stuff tof UIIcons and UIText. We\n> should use SuppressWarnings for those files.\n\nLooks good, thanks.  :-)\n \n>  org.spearce.egit.ui/icons/elcl16/filterfolder.gif  |  Bin 0 -> 153 bytes\n>  org.spearce.egit.ui/icons/elcl16/filterproject.gif |  Bin 0 -> 154 bytes\n>  org.spearce.egit.ui/icons/elcl16/filterrepo.gif    |  Bin 0 -> 322 bytes\n>  .../src/org/spearce/egit/ui/UIIcons.java           |   12 ++\n>  .../src/org/spearce/egit/ui/UIText.java            |    9 ++\n>  .../egit/ui/internal/history/GitHistoryPage.java   |  113 +++++++++++++++++++-\n>  .../src/org/spearce/egit/ui/uitext.properties      |    4 +\n>  7 files changed, 134 insertions(+), 4 deletions(-)\n>  create mode 100644 org.spearce.egit.ui/icons/elcl16/filterfolder.gif\n>  create mode 100644 org.spearce.egit.ui/icons/elcl16/filterproject.gif\n>  create mode 100644 org.spearce.egit.ui/icons/elcl16/filterrepo.gif\n\n-- \nShawn.\n"}]}