From c2111023b407d51f5e291d574fad3779008b2e24 Mon Sep 17 00:00:00 2001 From: Alex Coles Date: Mon, 17 Aug 2009 11:07:59 +0200 Subject: [PATCH] Cleaned up whitespace, fix DOS line endings Signed-off-by: Alex Coles --- README.markdown | 3 +- src/org/nbgit/DiskMapTurboProvider.java | 2 +- src/org/nbgit/Git.java | 2 +- src/org/nbgit/GitAnnotator.java | 2 +- src/org/nbgit/GitInterceptor.java | 2 +- src/org/nbgit/GitModuleConfig.java | 492 ++++++++++----------- src/org/nbgit/GitProgressSupport.java | 2 +- src/org/nbgit/GitVCS.java | 2 +- src/org/nbgit/OutputLogger.java | 2 +- src/org/nbgit/options/GitAdvancedOption.java | 2 +- src/org/nbgit/options/GitExtProperties.java | 4 +- .../nbgit/options/GitOptionsPanelController.java | 2 +- src/org/nbgit/options/LabelsPanel.java | 2 +- src/org/nbgit/options/PropertiesPanel.java | 1 - src/org/nbgit/options/PropertiesTable.java | 2 +- src/org/nbgit/options/PropertiesTableModel.java | 2 +- src/org/nbgit/ui/ContextMenu.java | 2 +- src/org/nbgit/ui/GitFileNode.java | 2 +- src/org/nbgit/ui/commit/CommitPanel.java | 2 +- src/org/nbgit/ui/commit/CommitTable.java | 2 +- src/org/nbgit/ui/commit/CommitTableModel.java | 2 +- .../nbgit/ui/commit/ExcludeFromCommitAction.java | 2 +- src/org/nbgit/ui/custom/CustomAction.java | 2 +- src/org/nbgit/ui/custom/CustomMenu.java | 2 +- src/org/nbgit/ui/custom/CustomWizardPanel.java | 2 +- src/org/nbgit/ui/diff/DiffFileTable.java | 4 +- src/org/nbgit/ui/diff/MultiDiffPanel.java | 2 +- src/org/nbgit/ui/diff/VerticalFlowLayout.java | 2 +- src/org/nbgit/ui/init/InitAction.java | 2 +- src/org/nbgit/ui/log/DiffResultsView.java | 1 - src/org/nbgit/ui/log/DiffTreeTable.java | 2 +- src/org/nbgit/ui/log/Divider.java | 2 +- src/org/nbgit/ui/log/GitLogMessageChangedPath.java | 2 +- src/org/nbgit/ui/log/LogAction.java | 2 +- src/org/nbgit/ui/log/RepositoryRevision.java | 2 +- src/org/nbgit/ui/log/RevisionNode.java | 4 +- src/org/nbgit/ui/log/SearchCriteriaPanel.java | 2 +- src/org/nbgit/ui/log/SearchExecutor.java | 2 +- src/org/nbgit/ui/log/SearchHistoryAction.java | 408 ++++++++--------- src/org/nbgit/ui/log/SearchHistoryPanel.java | 2 +- .../nbgit/ui/log/SearchHistoryTopComponent.java | 2 +- src/org/nbgit/ui/log/SummaryView.java | 2 +- src/org/nbgit/ui/properties/GitProperties.java | 430 +++++++++--------- src/org/nbgit/ui/properties/GitPropertiesNode.java | 2 +- src/org/nbgit/ui/properties/PropertiesAction.java | 2 +- src/org/nbgit/ui/properties/PropertiesPanel.java | 2 +- src/org/nbgit/ui/properties/PropertiesTable.java | 2 +- .../nbgit/ui/properties/PropertiesTableModel.java | 4 +- .../nbgit/ui/status/GitVersioningTopComponent.java | 2 +- src/org/nbgit/ui/status/OpenInEditorAction.java | 2 +- src/org/nbgit/ui/status/OpenVersioningAction.java | 2 +- src/org/nbgit/ui/status/ShowAllChangesAction.java | 2 +- src/org/nbgit/ui/status/StatusAction.java | 2 +- src/org/nbgit/ui/status/SyncFileNode.java | 2 +- src/org/nbgit/ui/status/SyncTable.java | 8 +- .../nbgit/ui/update/ConflictResolvedAction.java | 2 +- .../nbgit/ui/update/ResolveConflictsAction.java | 2 +- src/org/nbgit/ui/update/RevertModifications.java | 2 +- .../nbgit/ui/update/RevertModificationsAction.java | 2 +- .../nbgit/ui/update/RevertModificationsPanel.java | 2 +- src/org/nbgit/ui/update/Update.java | 2 +- src/org/nbgit/ui/update/UpdateAction.java | 2 +- src/org/nbgit/ui/update/UpdatePanel.java | 2 +- src/org/nbgit/util/GitCommand.java | 1 - src/org/nbgit/util/GitProjectUtils.java | 2 +- src/org/nbgit/util/exclude/Excludes.java | 2 +- .../src/org/nbgit/ui/commit/StripSpaceTest.java | 2 +- 67 files changed, 733 insertions(+), 737 deletions(-) diff --git a/README.markdown b/README.markdown index bc6ea38..ba943be 100644 --- a/README.markdown +++ b/README.markdown @@ -41,7 +41,7 @@ the plugin by "running" the project. Getting the Source ------------------ -Performing a git clone on either of the following repositories will get you +Performing a git clone on either of the following repositories will get you the latest source: git clone git://github.com/myabc/nbgit.git @@ -64,4 +64,3 @@ Support * **nbgit**: * **nbgit Mailing List**: - \ No newline at end of file diff --git a/src/org/nbgit/DiskMapTurboProvider.java b/src/org/nbgit/DiskMapTurboProvider.java index effb559..b660350 100644 --- a/src/org/nbgit/DiskMapTurboProvider.java +++ b/src/org/nbgit/DiskMapTurboProvider.java @@ -370,4 +370,4 @@ class DiskMapTurboProvider implements TurboProvider { } out.flush(); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/Git.java b/src/org/nbgit/Git.java index 4bf004e..aa66e8c 100644 --- a/src/org/nbgit/Git.java +++ b/src/org/nbgit/Git.java @@ -272,4 +272,4 @@ public class Git { processorsToUrl.remove(url); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/GitAnnotator.java b/src/org/nbgit/GitAnnotator.java index ff75cca..044f6e4 100644 --- a/src/org/nbgit/GitAnnotator.java +++ b/src/org/nbgit/GitAnnotator.java @@ -314,7 +314,7 @@ public class GitAnnotator extends VCSAnnotator { if (root != null) actions.add(new CloneAction(NbBundle.getMessage(GitAnnotator.class, "CTL_PopupMenuItem_CloneLocal", // NOI18N root.getName()), ctx)); - + actions.add(null); actions.add(new FetchAction(NbBundle.getMessage(GitAnnotator.class, "CTL_PopupMenuItem_FetchLocal"), ctx)); // NOI18N diff --git a/src/org/nbgit/GitInterceptor.java b/src/org/nbgit/GitInterceptor.java index 6570171..de2a8f4 100644 --- a/src/org/nbgit/GitInterceptor.java +++ b/src/org/nbgit/GitInterceptor.java @@ -410,4 +410,4 @@ public class GitInterceptor extends VCSInterceptor { } } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/GitModuleConfig.java b/src/org/nbgit/GitModuleConfig.java index 010ce85..5c110ed 100644 --- a/src/org/nbgit/GitModuleConfig.java +++ b/src/org/nbgit/GitModuleConfig.java @@ -1,246 +1,246 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 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]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * Portions Copyright 2008 Alexander Coles (Ikonoklastik Productions). - * - * 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. - */ -package org.nbgit; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Properties; -import java.util.Set; -import java.util.prefs.Preferences; -import java.util.regex.Pattern; -import org.netbeans.modules.versioning.util.TableSorter; -import org.netbeans.modules.versioning.util.Utils; -import org.openide.util.NbPreferences; -import org.openide.util.Utilities; -import org.spearce.jgit.lib.FileBasedConfig; -import org.spearce.jgit.lib.Repository; -import org.spearce.jgit.lib.RepositoryConfig; -import org.spearce.jgit.lib.UserConfig; -import org.spearce.jgit.util.SystemReader; - -/** - * Stores Git module configuration. - * - * @author alexbcoles - */ -public class GitModuleConfig { - - public static final String PROP_IGNORED_FILEPATTERNS = "ignoredFilePatterns"; // NOI18N - public static final String PROP_COMMIT_EXCLUSIONS = "commitExclusions"; // NOI18N - public static final String PROP_DEFAULT_VALUES = "defaultValues"; // NOI18N - public static final String PROP_RUN_VERSION = "runVersion"; // NOI18N - public static final String KEY_EXECUTABLE_BINARY = "gitExecBinary"; // NOI18N - public static final String KEY_EXPORT_FILENAME = "gitExportFilename"; // NOI18N - public static final String KEY_EXPORT_FOLDER = "gitExportFolder"; // NOI18N - public static final String KEY_IMPORT_FOLDER = "gitImportFolder"; // NOI18N - public static final String KEY_ANNOTATION_FORMAT = "annotationFormat"; // NOI18N - public static final String SAVE_PASSWORD = "savePassword"; // NOI18N - public static final String KEY_BACKUP_ON_REVERTMODS = "backupOnRevert"; // NOI18N - public static final String KEY_SHOW_HISTORY_MERGES = "showHistoryMerges"; // NOI18N - public static final String KEY_SIGN_OFF_COMMITS = "signOffCommits"; // NOI18N - public static final String KEY_STRIP_SPACE = "stripSpace"; // NOI18N - public static final String TEXT_ANNOTATIONS_FORMAT_DEFAULT = "{DEFAULT}"; // NOI18N - private static final GitModuleConfig INSTANCE = new GitModuleConfig(); - private static String userEmail; - private static String userName; - - static { - FileBasedConfig baseConfig = SystemReader.getInstance().openUserConfig(); - try { - baseConfig.load(); - UserConfig user = baseConfig.get(UserConfig.KEY); - userEmail = user.getAuthorEmail(); - userName = user.getAuthorName(); - } catch (Throwable error) { - userEmail = userName = ""; - } - } - - public static GitModuleConfig getDefault() { - return INSTANCE; - } - private Set exclusions; - // properties ~~~~~~~~~~~~~~~~~~~~~~~~~ - - public Preferences getPreferences() { - return NbPreferences.forModule(GitModuleConfig.class); - } - - public boolean isExcludedFromCommit(String path) { - return getCommitExclusions().contains(path); - } - - /** - * @param paths collection of paths, of File.getAbsolutePath() - */ - public void addExclusionPaths(Collection paths) { - Set exclusions = getCommitExclusions(); - if (exclusions.addAll(paths)) { - Utils.put(getPreferences(), PROP_COMMIT_EXCLUSIONS, new ArrayList(exclusions)); - } - } - - /** - * @param paths collection of paths, File.getAbsolutePath() - */ - public void removeExclusionPaths(Collection paths) { - Set exclusions = getCommitExclusions(); - if (exclusions.removeAll(paths)) { - Utils.put(getPreferences(), PROP_COMMIT_EXCLUSIONS, new ArrayList(exclusions)); - } - } - - public String getExecutableBinaryPath() { - return getPreferences().get(KEY_EXECUTABLE_BINARY, ""); // NOI18N - } - - public boolean getBackupOnRevertModifications() { - return getPreferences().getBoolean(KEY_BACKUP_ON_REVERTMODS, true); - } - - public void setBackupOnRevertModifications(boolean bBackup) { - getPreferences().putBoolean(KEY_BACKUP_ON_REVERTMODS, bBackup); - } - - public boolean getSignOffCommits() { - return getPreferences().getBoolean(KEY_SIGN_OFF_COMMITS, false); - } - - public void setSignOffCommits(boolean signOff) { - getPreferences().putBoolean(KEY_SIGN_OFF_COMMITS, signOff); - } - - public boolean getStripSpace() { - return getPreferences().getBoolean(KEY_STRIP_SPACE, false); - } - - public void setStripSpace(boolean signOff) { - getPreferences().putBoolean(KEY_STRIP_SPACE, signOff); - } - - public boolean getShowHistoryMerges() { - return getPreferences().getBoolean(KEY_SHOW_HISTORY_MERGES, true); - } - - public void setShowHistoryMerges(boolean bShowMerges) { - getPreferences().putBoolean(KEY_SHOW_HISTORY_MERGES, bShowMerges); - } - - /** - * This method returns the email address specified in $HOME/.gitconfig - * or a default email address if none is found. - */ - public String getEmail() { - return userEmail; - } - - /** - * This method returns the username specified in $HOME/.gitconfig - * or a default username if none is found. - */ - public String getUserName() { - return userName; - } - - public void setEmail(String email) { - userEmail = email; - } - - public void setUserName(String name) { - userName = name; - } - - public Boolean isEmailValid(String email) { - if (email.equals(userEmail)) { - return true; - } - return email.indexOf("@") != -1; - } - - public Boolean isUserNameValid(String name) { - if (name.equals(userName)) { - return true; - } - if (name.length() == 0) { - return true; - } - return true; - } - - public Properties getProperties(File file) { - Properties props = new Properties(); - Repository repo = Git.getInstance().getRepository(file); - RepositoryConfig config = repo.getConfig(); - - props.setProperty("user.email", config.getAuthorEmail()); // NOI18N - props.setProperty("user.name", config.getAuthorName()); // NOI18N - - boolean signOff = config.getBoolean("nbgit", "signoff", getSignOffCommits()); - props.setProperty("nbgit.signoff", signOff ? "yes" : "no"); // NOI18N - - boolean stripSpace = config.getBoolean("nbgit", "stripspace", getStripSpace()); - props.setProperty("nbgit.stripspace", stripSpace ? "yes" : "no"); // NOI18N - - return props; - } - - public String getAnnotationFormat() { - return getPreferences().get(KEY_ANNOTATION_FORMAT, getDefaultAnnotationFormat()); - } - - public String getDefaultAnnotationFormat() { - return "[{" + GitAnnotator.ANNOTATION_STATUS + "} {" + GitAnnotator.ANNOTATION_FOLDER + "}]"; // NOI18N - } - - public void setAnnotationFormat(String annotationFormat) { - getPreferences().put(KEY_ANNOTATION_FORMAT, annotationFormat); - } - - private synchronized Set getCommitExclusions() { - if (exclusions == null) { - exclusions = new HashSet(Utils.getStringList(getPreferences(), PROP_COMMIT_EXCLUSIONS)); - } - return exclusions; - } -} +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2007 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]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun + * Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2008 Alexander Coles (Ikonoklastik Productions). + * + * 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. + */ +package org.nbgit; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; +import java.util.prefs.Preferences; +import java.util.regex.Pattern; +import org.netbeans.modules.versioning.util.TableSorter; +import org.netbeans.modules.versioning.util.Utils; +import org.openide.util.NbPreferences; +import org.openide.util.Utilities; +import org.spearce.jgit.lib.FileBasedConfig; +import org.spearce.jgit.lib.Repository; +import org.spearce.jgit.lib.RepositoryConfig; +import org.spearce.jgit.lib.UserConfig; +import org.spearce.jgit.util.SystemReader; + +/** + * Stores Git module configuration. + * + * @author alexbcoles + */ +public class GitModuleConfig { + + public static final String PROP_IGNORED_FILEPATTERNS = "ignoredFilePatterns"; // NOI18N + public static final String PROP_COMMIT_EXCLUSIONS = "commitExclusions"; // NOI18N + public static final String PROP_DEFAULT_VALUES = "defaultValues"; // NOI18N + public static final String PROP_RUN_VERSION = "runVersion"; // NOI18N + public static final String KEY_EXECUTABLE_BINARY = "gitExecBinary"; // NOI18N + public static final String KEY_EXPORT_FILENAME = "gitExportFilename"; // NOI18N + public static final String KEY_EXPORT_FOLDER = "gitExportFolder"; // NOI18N + public static final String KEY_IMPORT_FOLDER = "gitImportFolder"; // NOI18N + public static final String KEY_ANNOTATION_FORMAT = "annotationFormat"; // NOI18N + public static final String SAVE_PASSWORD = "savePassword"; // NOI18N + public static final String KEY_BACKUP_ON_REVERTMODS = "backupOnRevert"; // NOI18N + public static final String KEY_SHOW_HISTORY_MERGES = "showHistoryMerges"; // NOI18N + public static final String KEY_SIGN_OFF_COMMITS = "signOffCommits"; // NOI18N + public static final String KEY_STRIP_SPACE = "stripSpace"; // NOI18N + public static final String TEXT_ANNOTATIONS_FORMAT_DEFAULT = "{DEFAULT}"; // NOI18N + private static final GitModuleConfig INSTANCE = new GitModuleConfig(); + private static String userEmail; + private static String userName; + + static { + FileBasedConfig baseConfig = SystemReader.getInstance().openUserConfig(); + try { + baseConfig.load(); + UserConfig user = baseConfig.get(UserConfig.KEY); + userEmail = user.getAuthorEmail(); + userName = user.getAuthorName(); + } catch (Throwable error) { + userEmail = userName = ""; + } + } + + public static GitModuleConfig getDefault() { + return INSTANCE; + } + private Set exclusions; + // properties ~~~~~~~~~~~~~~~~~~~~~~~~~ + + public Preferences getPreferences() { + return NbPreferences.forModule(GitModuleConfig.class); + } + + public boolean isExcludedFromCommit(String path) { + return getCommitExclusions().contains(path); + } + + /** + * @param paths collection of paths, of File.getAbsolutePath() + */ + public void addExclusionPaths(Collection paths) { + Set exclusions = getCommitExclusions(); + if (exclusions.addAll(paths)) { + Utils.put(getPreferences(), PROP_COMMIT_EXCLUSIONS, new ArrayList(exclusions)); + } + } + + /** + * @param paths collection of paths, File.getAbsolutePath() + */ + public void removeExclusionPaths(Collection paths) { + Set exclusions = getCommitExclusions(); + if (exclusions.removeAll(paths)) { + Utils.put(getPreferences(), PROP_COMMIT_EXCLUSIONS, new ArrayList(exclusions)); + } + } + + public String getExecutableBinaryPath() { + return getPreferences().get(KEY_EXECUTABLE_BINARY, ""); // NOI18N + } + + public boolean getBackupOnRevertModifications() { + return getPreferences().getBoolean(KEY_BACKUP_ON_REVERTMODS, true); + } + + public void setBackupOnRevertModifications(boolean bBackup) { + getPreferences().putBoolean(KEY_BACKUP_ON_REVERTMODS, bBackup); + } + + public boolean getSignOffCommits() { + return getPreferences().getBoolean(KEY_SIGN_OFF_COMMITS, false); + } + + public void setSignOffCommits(boolean signOff) { + getPreferences().putBoolean(KEY_SIGN_OFF_COMMITS, signOff); + } + + public boolean getStripSpace() { + return getPreferences().getBoolean(KEY_STRIP_SPACE, false); + } + + public void setStripSpace(boolean signOff) { + getPreferences().putBoolean(KEY_STRIP_SPACE, signOff); + } + + public boolean getShowHistoryMerges() { + return getPreferences().getBoolean(KEY_SHOW_HISTORY_MERGES, true); + } + + public void setShowHistoryMerges(boolean bShowMerges) { + getPreferences().putBoolean(KEY_SHOW_HISTORY_MERGES, bShowMerges); + } + + /** + * This method returns the email address specified in $HOME/.gitconfig + * or a default email address if none is found. + */ + public String getEmail() { + return userEmail; + } + + /** + * This method returns the username specified in $HOME/.gitconfig + * or a default username if none is found. + */ + public String getUserName() { + return userName; + } + + public void setEmail(String email) { + userEmail = email; + } + + public void setUserName(String name) { + userName = name; + } + + public Boolean isEmailValid(String email) { + if (email.equals(userEmail)) { + return true; + } + return email.indexOf("@") != -1; + } + + public Boolean isUserNameValid(String name) { + if (name.equals(userName)) { + return true; + } + if (name.length() == 0) { + return true; + } + return true; + } + + public Properties getProperties(File file) { + Properties props = new Properties(); + Repository repo = Git.getInstance().getRepository(file); + RepositoryConfig config = repo.getConfig(); + + props.setProperty("user.email", config.getAuthorEmail()); // NOI18N + props.setProperty("user.name", config.getAuthorName()); // NOI18N + + boolean signOff = config.getBoolean("nbgit", "signoff", getSignOffCommits()); + props.setProperty("nbgit.signoff", signOff ? "yes" : "no"); // NOI18N + + boolean stripSpace = config.getBoolean("nbgit", "stripspace", getStripSpace()); + props.setProperty("nbgit.stripspace", stripSpace ? "yes" : "no"); // NOI18N + + return props; + } + + public String getAnnotationFormat() { + return getPreferences().get(KEY_ANNOTATION_FORMAT, getDefaultAnnotationFormat()); + } + + public String getDefaultAnnotationFormat() { + return "[{" + GitAnnotator.ANNOTATION_STATUS + "} {" + GitAnnotator.ANNOTATION_FOLDER + "}]"; // NOI18N + } + + public void setAnnotationFormat(String annotationFormat) { + getPreferences().put(KEY_ANNOTATION_FORMAT, annotationFormat); + } + + private synchronized Set getCommitExclusions() { + if (exclusions == null) { + exclusions = new HashSet(Utils.getStringList(getPreferences(), PROP_COMMIT_EXCLUSIONS)); + } + return exclusions; + } +} diff --git a/src/org/nbgit/GitProgressSupport.java b/src/org/nbgit/GitProgressSupport.java index b47693a..55df696 100644 --- a/src/org/nbgit/GitProgressSupport.java +++ b/src/org/nbgit/GitProgressSupport.java @@ -190,4 +190,4 @@ public abstract class GitProgressSupport implements Runnable, Cancellable { return new URIish(); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/GitVCS.java b/src/org/nbgit/GitVCS.java index aa0ebd9..72dbf40 100644 --- a/src/org/nbgit/GitVCS.java +++ b/src/org/nbgit/GitVCS.java @@ -124,4 +124,4 @@ public class GitVCS extends VersioningSystem implements PropertyChangeListener, fireVersionedFilesChanged(); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/OutputLogger.java b/src/org/nbgit/OutputLogger.java index c1e32b6..5e8b9cf 100644 --- a/src/org/nbgit/OutputLogger.java +++ b/src/org/nbgit/OutputLogger.java @@ -276,4 +276,4 @@ public class OutputLogger { public void clearOutput() { } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/options/GitAdvancedOption.java b/src/org/nbgit/options/GitAdvancedOption.java index d20a01d..0d8fda7 100644 --- a/src/org/nbgit/options/GitAdvancedOption.java +++ b/src/org/nbgit/options/GitAdvancedOption.java @@ -58,4 +58,4 @@ public final class GitAdvancedOption extends AdvancedOption { public OptionsPanelController create() { return new GitOptionsPanelController(); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/options/GitExtProperties.java b/src/org/nbgit/options/GitExtProperties.java index b747be6..9e81975 100644 --- a/src/org/nbgit/options/GitExtProperties.java +++ b/src/org/nbgit/options/GitExtProperties.java @@ -148,7 +148,7 @@ public class GitExtProperties implements ActionListener, DocumentListener { Properties props = GitModuleConfig.getDefault().getProperties(root, "extensions"); // NOI18N GitPropertiesNode[] gitProps = new GitPropertiesNode[props.size()]; int i = 0; - + for (Enumeration e = props.propertyNames(); e.hasMoreElements();) { String name = (String) e.nextElement(); String tmp = props.getProperty(name); @@ -284,4 +284,4 @@ public class GitExtProperties implements ActionListener, DocumentListener { } } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/options/GitOptionsPanelController.java b/src/org/nbgit/options/GitOptionsPanelController.java index be79dcd..c2b7386 100644 --- a/src/org/nbgit/options/GitOptionsPanelController.java +++ b/src/org/nbgit/options/GitOptionsPanelController.java @@ -278,4 +278,4 @@ final class GitOptionsPanelController extends OptionsPanelController implements gitProperties.setProperties(); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/options/LabelsPanel.java b/src/org/nbgit/options/LabelsPanel.java index 366083c..f200af2 100644 --- a/src/org/nbgit/options/LabelsPanel.java +++ b/src/org/nbgit/options/LabelsPanel.java @@ -84,4 +84,4 @@ public class LabelsPanel extends javax.swing.JPanel { private javax.swing.JScrollPane jScrollPane1; final javax.swing.JList labelsList = new javax.swing.JList(); // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/options/PropertiesPanel.java b/src/org/nbgit/options/PropertiesPanel.java index 0cc49ac..2894c59 100644 --- a/src/org/nbgit/options/PropertiesPanel.java +++ b/src/org/nbgit/options/PropertiesPanel.java @@ -217,4 +217,3 @@ public class PropertiesPanel extends javax.swing.JPanel implements PreferenceCha final javax.swing.JTextArea txtAreaValue = new javax.swing.JTextArea(); // End of variables declaration//GEN-END:variables } - diff --git a/src/org/nbgit/options/PropertiesTable.java b/src/org/nbgit/options/PropertiesTable.java index 7530135..35582e2 100644 --- a/src/org/nbgit/options/PropertiesTable.java +++ b/src/org/nbgit/options/PropertiesTable.java @@ -211,4 +211,4 @@ public class PropertiesTable implements AncestorListener, TableModelListener { return renderer; } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/options/PropertiesTableModel.java b/src/org/nbgit/options/PropertiesTableModel.java index 4880985..b164e18 100644 --- a/src/org/nbgit/options/PropertiesTableModel.java +++ b/src/org/nbgit/options/PropertiesTableModel.java @@ -115,4 +115,4 @@ public class PropertiesTableModel extends AbstractTableModel { } throw new IllegalArgumentException("The column index is out of index: " + columnIndex); // NOI18N } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/ContextMenu.java b/src/org/nbgit/ui/ContextMenu.java index b159380..819a13a 100644 --- a/src/org/nbgit/ui/ContextMenu.java +++ b/src/org/nbgit/ui/ContextMenu.java @@ -81,4 +81,4 @@ public abstract class ContextMenu extends AbstractAction implements DynamicMenuC protected abstract JMenu createMenu(VCSContext context, boolean forMainMenu); -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/GitFileNode.java b/src/org/nbgit/ui/GitFileNode.java index acc6d7e..b027f38 100644 --- a/src/org/nbgit/ui/GitFileNode.java +++ b/src/org/nbgit/ui/GitFileNode.java @@ -100,4 +100,4 @@ public class GitFileNode { } return list.toArray(new Object[list.size()]); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/commit/CommitPanel.java b/src/org/nbgit/ui/commit/CommitPanel.java index 4f6fcfd..14f1dc6 100644 --- a/src/org/nbgit/ui/commit/CommitPanel.java +++ b/src/org/nbgit/ui/commit/CommitPanel.java @@ -240,4 +240,4 @@ public class CommitPanel extends javax.swing.JPanel implements PreferenceChangeL final javax.swing.JLabel recentLink = new javax.swing.JLabel(); // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/commit/CommitTable.java b/src/org/nbgit/ui/commit/CommitTable.java index 43c90e0..c0bda96 100644 --- a/src/org/nbgit/ui/commit/CommitTable.java +++ b/src/org/nbgit/ui/commit/CommitTable.java @@ -350,4 +350,4 @@ public class CommitTable implements AncestorListener, TableModelListener { tableModel.getNode(row2.intValue()).getName()); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/commit/CommitTableModel.java b/src/org/nbgit/ui/commit/CommitTableModel.java index 831b447..1b6d1de 100644 --- a/src/org/nbgit/ui/commit/CommitTableModel.java +++ b/src/org/nbgit/ui/commit/CommitTableModel.java @@ -241,4 +241,4 @@ public class CommitTableModel extends AbstractTableModel { rootFile.repositoryPath = repositoryPath; rootFile.rootLocalPath = rootLocalPath; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/commit/ExcludeFromCommitAction.java b/src/org/nbgit/ui/commit/ExcludeFromCommitAction.java index 9fa4dbc..177a813 100644 --- a/src/org/nbgit/ui/commit/ExcludeFromCommitAction.java +++ b/src/org/nbgit/ui/commit/ExcludeFromCommitAction.java @@ -141,4 +141,4 @@ public final class ExcludeFromCommitAction extends ContextAction { }; support.start(rp, "", ""); // NOI18N } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/custom/CustomAction.java b/src/org/nbgit/ui/custom/CustomAction.java index a5156d7..2b527c4 100644 --- a/src/org/nbgit/ui/custom/CustomAction.java +++ b/src/org/nbgit/ui/custom/CustomAction.java @@ -183,4 +183,4 @@ public class CustomAction extends ContextAction { } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/custom/CustomMenu.java b/src/org/nbgit/ui/custom/CustomMenu.java index c00a3d4..b868b2a 100644 --- a/src/org/nbgit/ui/custom/CustomMenu.java +++ b/src/org/nbgit/ui/custom/CustomMenu.java @@ -203,4 +203,4 @@ public class CustomMenu extends ContextMenu { } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/custom/CustomWizardPanel.java b/src/org/nbgit/ui/custom/CustomWizardPanel.java index d91c9ea..65679d1 100644 --- a/src/org/nbgit/ui/custom/CustomWizardPanel.java +++ b/src/org/nbgit/ui/custom/CustomWizardPanel.java @@ -113,4 +113,4 @@ public class CustomWizardPanel implements WizardDescriptor.Panel columnLabels = new HashMap(4); - + { ResourceBundle loc = NbBundle.getBundle(DiffFileTable.class); @@ -401,4 +401,4 @@ class DiffFileTable implements MouseListener, ListSelectionListener, AncestorLis return renderer; } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/diff/MultiDiffPanel.java b/src/org/nbgit/ui/diff/MultiDiffPanel.java index d526d77..f73129b 100644 --- a/src/org/nbgit/ui/diff/MultiDiffPanel.java +++ b/src/org/nbgit/ui/diff/MultiDiffPanel.java @@ -879,4 +879,4 @@ class MultiDiffPanel extends javax.swing.JPanel implements ActionListener, DiffS } } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/diff/VerticalFlowLayout.java b/src/org/nbgit/ui/diff/VerticalFlowLayout.java index bb415d6..a4f9757 100644 --- a/src/org/nbgit/ui/diff/VerticalFlowLayout.java +++ b/src/org/nbgit/ui/diff/VerticalFlowLayout.java @@ -133,4 +133,4 @@ public class VerticalFlowLayout implements LayoutManager { } } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/init/InitAction.java b/src/org/nbgit/ui/init/InitAction.java index 3eb84d6..235220d 100644 --- a/src/org/nbgit/ui/init/InitAction.java +++ b/src/org/nbgit/ui/init/InitAction.java @@ -282,4 +282,4 @@ public class InitAction extends ContextAction { return files; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/DiffResultsView.java b/src/org/nbgit/ui/log/DiffResultsView.java index 8dbaf3e..83d2da7 100644 --- a/src/org/nbgit/ui/log/DiffResultsView.java +++ b/src/org/nbgit/ui/log/DiffResultsView.java @@ -386,4 +386,3 @@ class DiffResultsView implements AncestorListener, PropertyChangeListener, DiffS return diffView; } } - diff --git a/src/org/nbgit/ui/log/DiffTreeTable.java b/src/org/nbgit/ui/log/DiffTreeTable.java index cb0380e..cd86262 100644 --- a/src/org/nbgit/ui/log/DiffTreeTable.java +++ b/src/org/nbgit/ui/log/DiffTreeTable.java @@ -250,4 +250,4 @@ class DiffTreeTable extends TreeTableView { return new Node[]{node}; } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/Divider.java b/src/org/nbgit/ui/log/Divider.java index c8299a4..08623ca 100644 --- a/src/org/nbgit/ui/log/Divider.java +++ b/src/org/nbgit/ui/log/Divider.java @@ -129,4 +129,4 @@ class Divider extends JPanel { g.drawLine(mid - 1, 1, mid + 1, 1); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/GitLogMessageChangedPath.java b/src/org/nbgit/ui/log/GitLogMessageChangedPath.java index 43e9acf..7066e97 100644 --- a/src/org/nbgit/ui/log/GitLogMessageChangedPath.java +++ b/src/org/nbgit/ui/log/GitLogMessageChangedPath.java @@ -73,4 +73,4 @@ class GitLogMessageChangedPath { public String toString() { return "action: " + this.action + " path: " + this.path; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/LogAction.java b/src/org/nbgit/ui/log/LogAction.java index bc73fe4..0660d84 100644 --- a/src/org/nbgit/ui/log/LogAction.java +++ b/src/org/nbgit/ui/log/LogAction.java @@ -62,4 +62,4 @@ public class LogAction extends ContextAction { SearchHistoryAction.openHistory(context, NbBundle.getMessage(LogAction.class, "MSG_Log_TabTitle", org.netbeans.modules.versioning.util.Utils.getContextDisplayName(context))); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/RepositoryRevision.java b/src/org/nbgit/ui/log/RepositoryRevision.java index 1d7f233..58a8d8c 100644 --- a/src/org/nbgit/ui/log/RepositoryRevision.java +++ b/src/org/nbgit/ui/log/RepositoryRevision.java @@ -278,4 +278,4 @@ public class RepositoryRevision extends RevCommit { return walk; } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/RevisionNode.java b/src/org/nbgit/ui/log/RevisionNode.java index 2f60951..24994ee 100644 --- a/src/org/nbgit/ui/log/RevisionNode.java +++ b/src/org/nbgit/ui/log/RevisionNode.java @@ -265,7 +265,7 @@ class RevisionNode extends AbstractNode { private static class RevisionPropertyEditor extends PropertyEditorSupport { private static final JLabel renderer = new JLabel(); - + static { renderer.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2)); @@ -288,4 +288,4 @@ class RevisionNode extends AbstractNode { return true; } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/SearchCriteriaPanel.java b/src/org/nbgit/ui/log/SearchCriteriaPanel.java index ef35059..73cadb4 100644 --- a/src/org/nbgit/ui/log/SearchCriteriaPanel.java +++ b/src/org/nbgit/ui/log/SearchCriteriaPanel.java @@ -300,4 +300,4 @@ class SearchCriteriaPanel extends javax.swing.JPanel { private javax.swing.JLabel toLabel; private javax.swing.JLabel usernameLabel; // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/SearchExecutor.java b/src/org/nbgit/ui/log/SearchExecutor.java index a7271a2..681e6d8 100644 --- a/src/org/nbgit/ui/log/SearchExecutor.java +++ b/src/org/nbgit/ui/log/SearchExecutor.java @@ -252,4 +252,4 @@ class SearchExecutor implements Runnable { }); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/SearchHistoryAction.java b/src/org/nbgit/ui/log/SearchHistoryAction.java index f8790e6..1f8564f 100644 --- a/src/org/nbgit/ui/log/SearchHistoryAction.java +++ b/src/org/nbgit/ui/log/SearchHistoryAction.java @@ -1,204 +1,204 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 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]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * Portions Copyright 2008 Alexander Coles (Ikonoklastik Productions). - * - * 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. - */ -package org.nbgit.ui.log; - -import java.awt.event.ActionEvent; -import java.io.File; -import javax.swing.SwingUtilities; -import org.nbgit.StatusInfo; -import org.nbgit.ui.ContextAction; -import org.netbeans.modules.versioning.spi.VCSContext; -import org.netbeans.modules.versioning.util.Utils; -import org.openide.nodes.Node; -import org.openide.util.NbBundle; -import org.openide.windows.TopComponent; - -/** - * Opens Search History Component. - * - * @author Maros Sandor - */ -public class SearchHistoryAction extends ContextAction { - - static final int DIRECTORY_ENABLED_STATUS = StatusInfo.STATUS_MANAGED & ~StatusInfo.STATUS_NOTVERSIONED_EXCLUDED & ~StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY; - static final int FILE_ENABLED_STATUS = StatusInfo.STATUS_MANAGED & ~StatusInfo.STATUS_NOTVERSIONED_EXCLUDED & ~StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY; - - public SearchHistoryAction(String name, VCSContext context) { - super(name, context); - } - - protected String getBaseName(Node[] activatedNodes) { - return "CTL_MenuItem_SearchHistory"; // NOI18N - } - - protected int getFileEnabledStatus() { - return FILE_ENABLED_STATUS; - } - - protected int getDirectoryEnabledStatus() { - return DIRECTORY_ENABLED_STATUS; - } - - protected boolean asynchronous() { - return false; - } - - public void performAction(ActionEvent e) { - String title = NbBundle.getMessage(SearchHistoryAction.class, "CTL_SearchHistory_Title", Utils.getContextDisplayName(context)); // NOI18N - openHistory(context, title); - } - - public static void openHistory(final VCSContext context, final String title) { - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - if (context == null) { - return; - } - SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context); - tc.setDisplayName(title); - tc.open(); - tc.requestActive(); - tc.search(true); - } - }); - } - - /** - * Opens the Search History panel to view Git Changesets that will be sent on next Pull from remote repo - * using: git incoming - to get the data - * - * @param title title of the search - * @param commitMessage commit message to search for - * @param username user name to search for - * @param date date of the change in question - */ - public static void openIncoming(final VCSContext context, final String title) { - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - if (context == null) { - return; - } - SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context); - tc.setDisplayName(title); - tc.open(); - tc.requestActive(); - tc.searchIncoming(); - } - }); - } - - /** - * Opens the Search History panel to view Git Out Changesets that will be sent on next Push to remote repo - * using: git out - to get the data - * - * @param title title of the search - * @param commitMessage commit message to search for - * @param username user name to search for - * @param date date of the change in question - */ - public static void openOut(final VCSContext context, final String title) { - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - if (context == null) { - return; - } - SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context); - tc.setDisplayName(title); - tc.open(); - tc.requestActive(); - tc.searchOut(); - } - }); - } - - /** - * Opens the Search History panel with given pre-filled values. The search is executed in default context - * (all open projects). - * - * @param title title of the search - * @param commitMessage commit message to search for - * @param username user name to search for - * @param rev the revision of the change in question - */ - public static void openSearch(String title, String commitMessage, String username, String rev) { - openSearch(getDefaultContext(), title, commitMessage, username, rev); - } - - public static void openSearch(VCSContext context, String title, String commitMessage, String username, String from) { - String to = from + "~20"; - - if (commitMessage != null && commitMessage.indexOf('\n') != -1) { - commitMessage = commitMessage.substring(0, commitMessage.indexOf('\n')); - } - SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context, commitMessage, username, from, to); - String tcTitle = NbBundle.getMessage(SearchHistoryAction.class, "CTL_SearchHistory_Title", title); // NOI18N - tc.setDisplayName(tcTitle); - tc.open(); - tc.requestActive(); - tc.search(false); - } - - private static VCSContext getDefaultContext() { - Node[] nodes = TopComponent.getRegistry().getActivatedNodes(); - - return nodes != null ? VCSContext.forNodes(nodes) : VCSContext.EMPTY; - } - - /** - * Opens search panel in the context of the given repository URL. - * - * @param repositoryUrl URL to search - * @param localRoot local working copy root that corresponds to the repository URL - * @param revision revision to search for - */ - public static void openSearch(String repositoryUrl, File localRoot, String revision) { - SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repositoryUrl, localRoot, revision); - String tcTitle = NbBundle.getMessage(SearchHistoryAction.class, "CTL_SearchHistory_Title", repositoryUrl); // NOI18N - tc.setDisplayName(tcTitle); - tc.open(); - tc.requestActive(); - tc.search(false); - } -} \ No newline at end of file +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2007 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]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun + * Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2008 Alexander Coles (Ikonoklastik Productions). + * + * 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. + */ +package org.nbgit.ui.log; + +import java.awt.event.ActionEvent; +import java.io.File; +import javax.swing.SwingUtilities; +import org.nbgit.StatusInfo; +import org.nbgit.ui.ContextAction; +import org.netbeans.modules.versioning.spi.VCSContext; +import org.netbeans.modules.versioning.util.Utils; +import org.openide.nodes.Node; +import org.openide.util.NbBundle; +import org.openide.windows.TopComponent; + +/** + * Opens Search History Component. + * + * @author Maros Sandor + */ +public class SearchHistoryAction extends ContextAction { + + static final int DIRECTORY_ENABLED_STATUS = StatusInfo.STATUS_MANAGED & ~StatusInfo.STATUS_NOTVERSIONED_EXCLUDED & ~StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY; + static final int FILE_ENABLED_STATUS = StatusInfo.STATUS_MANAGED & ~StatusInfo.STATUS_NOTVERSIONED_EXCLUDED & ~StatusInfo.STATUS_NOTVERSIONED_NEWLOCALLY; + + public SearchHistoryAction(String name, VCSContext context) { + super(name, context); + } + + protected String getBaseName(Node[] activatedNodes) { + return "CTL_MenuItem_SearchHistory"; // NOI18N + } + + protected int getFileEnabledStatus() { + return FILE_ENABLED_STATUS; + } + + protected int getDirectoryEnabledStatus() { + return DIRECTORY_ENABLED_STATUS; + } + + protected boolean asynchronous() { + return false; + } + + public void performAction(ActionEvent e) { + String title = NbBundle.getMessage(SearchHistoryAction.class, "CTL_SearchHistory_Title", Utils.getContextDisplayName(context)); // NOI18N + openHistory(context, title); + } + + public static void openHistory(final VCSContext context, final String title) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + if (context == null) { + return; + } + SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context); + tc.setDisplayName(title); + tc.open(); + tc.requestActive(); + tc.search(true); + } + }); + } + + /** + * Opens the Search History panel to view Git Changesets that will be sent on next Pull from remote repo + * using: git incoming - to get the data + * + * @param title title of the search + * @param commitMessage commit message to search for + * @param username user name to search for + * @param date date of the change in question + */ + public static void openIncoming(final VCSContext context, final String title) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + if (context == null) { + return; + } + SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context); + tc.setDisplayName(title); + tc.open(); + tc.requestActive(); + tc.searchIncoming(); + } + }); + } + + /** + * Opens the Search History panel to view Git Out Changesets that will be sent on next Push to remote repo + * using: git out - to get the data + * + * @param title title of the search + * @param commitMessage commit message to search for + * @param username user name to search for + * @param date date of the change in question + */ + public static void openOut(final VCSContext context, final String title) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + if (context == null) { + return; + } + SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context); + tc.setDisplayName(title); + tc.open(); + tc.requestActive(); + tc.searchOut(); + } + }); + } + + /** + * Opens the Search History panel with given pre-filled values. The search is executed in default context + * (all open projects). + * + * @param title title of the search + * @param commitMessage commit message to search for + * @param username user name to search for + * @param rev the revision of the change in question + */ + public static void openSearch(String title, String commitMessage, String username, String rev) { + openSearch(getDefaultContext(), title, commitMessage, username, rev); + } + + public static void openSearch(VCSContext context, String title, String commitMessage, String username, String from) { + String to = from + "~20"; + + if (commitMessage != null && commitMessage.indexOf('\n') != -1) { + commitMessage = commitMessage.substring(0, commitMessage.indexOf('\n')); + } + SearchHistoryTopComponent tc = new SearchHistoryTopComponent(context, commitMessage, username, from, to); + String tcTitle = NbBundle.getMessage(SearchHistoryAction.class, "CTL_SearchHistory_Title", title); // NOI18N + tc.setDisplayName(tcTitle); + tc.open(); + tc.requestActive(); + tc.search(false); + } + + private static VCSContext getDefaultContext() { + Node[] nodes = TopComponent.getRegistry().getActivatedNodes(); + + return nodes != null ? VCSContext.forNodes(nodes) : VCSContext.EMPTY; + } + + /** + * Opens search panel in the context of the given repository URL. + * + * @param repositoryUrl URL to search + * @param localRoot local working copy root that corresponds to the repository URL + * @param revision revision to search for + */ + public static void openSearch(String repositoryUrl, File localRoot, String revision) { + SearchHistoryTopComponent tc = new SearchHistoryTopComponent(repositoryUrl, localRoot, revision); + String tcTitle = NbBundle.getMessage(SearchHistoryAction.class, "CTL_SearchHistory_Title", repositoryUrl); // NOI18N + tc.setDisplayName(tcTitle); + tc.open(); + tc.requestActive(); + tc.search(false); + } +} diff --git a/src/org/nbgit/ui/log/SearchHistoryPanel.java b/src/org/nbgit/ui/log/SearchHistoryPanel.java index 7b568bb..9363397 100644 --- a/src/org/nbgit/ui/log/SearchHistoryPanel.java +++ b/src/org/nbgit/ui/log/SearchHistoryPanel.java @@ -609,4 +609,4 @@ private void showMergesChkBoxStateChanged(javax.swing.event.ChangeEvent evt) {// private javax.swing.JToggleButton tbSummary; // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/SearchHistoryTopComponent.java b/src/org/nbgit/ui/log/SearchHistoryTopComponent.java index bd198f1..1a5ce78 100644 --- a/src/org/nbgit/ui/log/SearchHistoryTopComponent.java +++ b/src/org/nbgit/ui/log/SearchHistoryTopComponent.java @@ -158,4 +158,4 @@ public class SearchHistoryTopComponent extends TopComponent implements DiffSetup public String getSetupDisplayName() { return getDisplayName(); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/log/SummaryView.java b/src/org/nbgit/ui/log/SummaryView.java index e328dc4..5730bcc 100644 --- a/src/org/nbgit/ui/log/SummaryView.java +++ b/src/org/nbgit/ui/log/SummaryView.java @@ -800,4 +800,4 @@ class SummaryView implements MouseListener, ComponentListener, MouseMotionListen setBackground(background); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/properties/GitProperties.java b/src/org/nbgit/ui/properties/GitProperties.java index 9078542..2206bc4 100644 --- a/src/org/nbgit/ui/properties/GitProperties.java +++ b/src/org/nbgit/ui/properties/GitProperties.java @@ -1,215 +1,215 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 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]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * Portions Copyright 2008 Alexander Coles (Ikonoklastik Productions). - * - * 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. - */ -package org.nbgit.ui.properties; - -import java.awt.Font; -import java.io.File; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Properties; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; -import org.nbgit.Git; -import org.nbgit.GitModuleConfig; -import org.nbgit.GitProgressSupport; -import org.openide.util.Exceptions; -import org.openide.util.RequestProcessor; -import org.spearce.jgit.lib.Repository; -import org.spearce.jgit.lib.RepositoryConfig; - -/** - * - * @author Padraig O'Briain - */ -public class GitProperties implements ListSelectionListener { - - public static final String GITPROPNAME_USER_EMAIL = "email"; // NOI18N - public static final String GITPROPNAME_USER_NAME = "name"; // NOI18N - public static final String GITPROPNAME_DEFAULT_PULL = "default-pull"; // NOI18N - private PropertiesPanel panel; - private File root; - private PropertiesTable propTable; - private GitProgressSupport support; - private File loadedValueFile; - private Font fontTextArea; - - /** Creates a new instance of GitProperties */ - public GitProperties(PropertiesPanel panel, PropertiesTable propTable, File root) { - this.panel = panel; - this.propTable = propTable; - this.root = root; - propTable.getTable().getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - propTable.getTable().getSelectionModel().addListSelectionListener(this); - - refreshProperties(); - } - - public PropertiesPanel getPropertiesPanel() { - return panel; - } - - public void setPropertiesPanel(PropertiesPanel panel) { - this.panel = panel; - } - - public File getRoot() { - return root; - } - - public void setRoot(File root) { - this.root = root; - } - - protected String getPropertyValue() { - return panel.txtAreaValue.getText(); - } - - protected void refreshProperties() { - RequestProcessor rp = Git.getInstance().getRequestProcessor(root.getAbsolutePath()); - try { - support = new GitProgressSupport() { - - protected void perform() { - Properties props = GitModuleConfig.getDefault().getProperties(root); - GitPropertiesNode[] gitProps = new GitPropertiesNode[props.size()]; - int i = 0; - - for (Enumeration e = props.propertyNames(); e.hasMoreElements();) { - String name = (String) e.nextElement(); - String tmp = props.getProperty(name); - String value = tmp != null ? tmp : ""; // NOI18N - gitProps[i] = new GitPropertiesNode(name, value); - i++; - } - propTable.setNodes(gitProps); - } - }; - support.start(rp, root.getAbsolutePath(), org.openide.util.NbBundle.getMessage(GitProperties.class, "LBL_Properties_Progress")); // NOI18N - } finally { - support = null; - } - } - - public void setProperties() { - RequestProcessor rp = Git.getInstance().getRequestProcessor(root.getAbsolutePath()); - try { - support = new GitProgressSupport() { - - protected void perform() { - Repository repo = Git.getInstance().getRepository(root); - if (repo == null) { - return; - } - RepositoryConfig config = repo.getConfig(); - boolean save = false; - /* - GitModuleConfig.getDefault().clearProperties(root, "paths"); // NOI18N - GitModuleConfig.getDefault().removeProperty(root, "user", GITPROPNAME_USER_EMAIL); // NOI18N - GitModuleConfig.getDefault().removeProperty(root, "user", GITPROPNAME_USER_NAME); // NOI18N - */ - GitPropertiesNode[] gitPropertiesNodes = propTable.getNodes(); - for (int i = 0; i < gitPropertiesNodes.length; i++) { - String name = gitPropertiesNodes[i].getName(); - String value = gitPropertiesNodes[i].getValue().trim(); - if (value.length() == 0) { - continue; - } - - if (name.equals("user.name")) { - config.setString("user", null, "name", value); - save = true; - } - - if (name.equals("user.email")) { - config.setString("user", null, "email", value); - save = true; - } - - if (name.equals("nbgit.signoff")) { - config.setString("nbgit", null, "signoff", value); - save = true; - } - - if (name.equals("nbgit.stripspace")) { - config.setString("nbgit", null, "stripspace", value); - save = true; - } - } - - //GitRepositoryContextCache.resetPullDefault(); - //GitRepositoryContextCache.resetPushDefault(); - try { - config.save(); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - } - } - }; - support.start(rp, root.getAbsolutePath(), org.openide.util.NbBundle.getMessage(GitProperties.class, "LBL_Properties_Progress")); // NOI18N - } finally { - support = null; - } - } - private int lastIndex = -1; - - public void updateLastSelection() { - GitPropertiesNode[] gitPropertiesNodes = propTable.getNodes(); - if (lastIndex >= 0) { - gitPropertiesNodes[lastIndex].setValue(getPropertyValue()); - } - } - - public void valueChanged(ListSelectionEvent e) { - int index = propTable.getTable().getSelectedRow(); - if (index < 0) { - lastIndex = -1; - return; - } - GitPropertiesNode[] gitPropertiesNodes = propTable.getNodes(); - if (lastIndex >= 0) { - gitPropertiesNodes[lastIndex].setValue(getPropertyValue()); - } - panel.txtAreaValue.setText(gitPropertiesNodes[index].getValue()); - lastIndex = index; - } -} \ No newline at end of file +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2007 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]" + * + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun + * Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2008 Alexander Coles (Ikonoklastik Productions). + * + * 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. + */ +package org.nbgit.ui.properties; + +import java.awt.Font; +import java.io.File; +import java.io.IOException; +import java.util.Enumeration; +import java.util.Properties; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import org.nbgit.Git; +import org.nbgit.GitModuleConfig; +import org.nbgit.GitProgressSupport; +import org.openide.util.Exceptions; +import org.openide.util.RequestProcessor; +import org.spearce.jgit.lib.Repository; +import org.spearce.jgit.lib.RepositoryConfig; + +/** + * + * @author Padraig O'Briain + */ +public class GitProperties implements ListSelectionListener { + + public static final String GITPROPNAME_USER_EMAIL = "email"; // NOI18N + public static final String GITPROPNAME_USER_NAME = "name"; // NOI18N + public static final String GITPROPNAME_DEFAULT_PULL = "default-pull"; // NOI18N + private PropertiesPanel panel; + private File root; + private PropertiesTable propTable; + private GitProgressSupport support; + private File loadedValueFile; + private Font fontTextArea; + + /** Creates a new instance of GitProperties */ + public GitProperties(PropertiesPanel panel, PropertiesTable propTable, File root) { + this.panel = panel; + this.propTable = propTable; + this.root = root; + propTable.getTable().getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + propTable.getTable().getSelectionModel().addListSelectionListener(this); + + refreshProperties(); + } + + public PropertiesPanel getPropertiesPanel() { + return panel; + } + + public void setPropertiesPanel(PropertiesPanel panel) { + this.panel = panel; + } + + public File getRoot() { + return root; + } + + public void setRoot(File root) { + this.root = root; + } + + protected String getPropertyValue() { + return panel.txtAreaValue.getText(); + } + + protected void refreshProperties() { + RequestProcessor rp = Git.getInstance().getRequestProcessor(root.getAbsolutePath()); + try { + support = new GitProgressSupport() { + + protected void perform() { + Properties props = GitModuleConfig.getDefault().getProperties(root); + GitPropertiesNode[] gitProps = new GitPropertiesNode[props.size()]; + int i = 0; + + for (Enumeration e = props.propertyNames(); e.hasMoreElements();) { + String name = (String) e.nextElement(); + String tmp = props.getProperty(name); + String value = tmp != null ? tmp : ""; // NOI18N + gitProps[i] = new GitPropertiesNode(name, value); + i++; + } + propTable.setNodes(gitProps); + } + }; + support.start(rp, root.getAbsolutePath(), org.openide.util.NbBundle.getMessage(GitProperties.class, "LBL_Properties_Progress")); // NOI18N + } finally { + support = null; + } + } + + public void setProperties() { + RequestProcessor rp = Git.getInstance().getRequestProcessor(root.getAbsolutePath()); + try { + support = new GitProgressSupport() { + + protected void perform() { + Repository repo = Git.getInstance().getRepository(root); + if (repo == null) { + return; + } + RepositoryConfig config = repo.getConfig(); + boolean save = false; + /* + GitModuleConfig.getDefault().clearProperties(root, "paths"); // NOI18N + GitModuleConfig.getDefault().removeProperty(root, "user", GITPROPNAME_USER_EMAIL); // NOI18N + GitModuleConfig.getDefault().removeProperty(root, "user", GITPROPNAME_USER_NAME); // NOI18N + */ + GitPropertiesNode[] gitPropertiesNodes = propTable.getNodes(); + for (int i = 0; i < gitPropertiesNodes.length; i++) { + String name = gitPropertiesNodes[i].getName(); + String value = gitPropertiesNodes[i].getValue().trim(); + if (value.length() == 0) { + continue; + } + + if (name.equals("user.name")) { + config.setString("user", null, "name", value); + save = true; + } + + if (name.equals("user.email")) { + config.setString("user", null, "email", value); + save = true; + } + + if (name.equals("nbgit.signoff")) { + config.setString("nbgit", null, "signoff", value); + save = true; + } + + if (name.equals("nbgit.stripspace")) { + config.setString("nbgit", null, "stripspace", value); + save = true; + } + } + + //GitRepositoryContextCache.resetPullDefault(); + //GitRepositoryContextCache.resetPushDefault(); + try { + config.save(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + }; + support.start(rp, root.getAbsolutePath(), org.openide.util.NbBundle.getMessage(GitProperties.class, "LBL_Properties_Progress")); // NOI18N + } finally { + support = null; + } + } + private int lastIndex = -1; + + public void updateLastSelection() { + GitPropertiesNode[] gitPropertiesNodes = propTable.getNodes(); + if (lastIndex >= 0) { + gitPropertiesNodes[lastIndex].setValue(getPropertyValue()); + } + } + + public void valueChanged(ListSelectionEvent e) { + int index = propTable.getTable().getSelectedRow(); + if (index < 0) { + lastIndex = -1; + return; + } + GitPropertiesNode[] gitPropertiesNodes = propTable.getNodes(); + if (lastIndex >= 0) { + gitPropertiesNodes[lastIndex].setValue(getPropertyValue()); + } + panel.txtAreaValue.setText(gitPropertiesNodes[index].getValue()); + lastIndex = index; + } +} diff --git a/src/org/nbgit/ui/properties/GitPropertiesNode.java b/src/org/nbgit/ui/properties/GitPropertiesNode.java index 706a4e6..e075ec6 100644 --- a/src/org/nbgit/ui/properties/GitPropertiesNode.java +++ b/src/org/nbgit/ui/properties/GitPropertiesNode.java @@ -86,4 +86,4 @@ public class GitPropertiesNode { } return false; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/properties/PropertiesAction.java b/src/org/nbgit/ui/properties/PropertiesAction.java index 530d9cf..6663dc4 100644 --- a/src/org/nbgit/ui/properties/PropertiesAction.java +++ b/src/org/nbgit/ui/properties/PropertiesAction.java @@ -109,4 +109,4 @@ public class PropertiesAction extends ContextAction { gitProperties.setProperties(); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/properties/PropertiesPanel.java b/src/org/nbgit/ui/properties/PropertiesPanel.java index cab3769..2d706b7 100644 --- a/src/org/nbgit/ui/properties/PropertiesPanel.java +++ b/src/org/nbgit/ui/properties/PropertiesPanel.java @@ -166,4 +166,4 @@ public class PropertiesPanel extends javax.swing.JPanel implements PreferenceCha public javax.swing.JPanel propsPanel; final javax.swing.JTextArea txtAreaValue = new javax.swing.JTextArea(); // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/properties/PropertiesTable.java b/src/org/nbgit/ui/properties/PropertiesTable.java index c9cf727..ab7515f 100644 --- a/src/org/nbgit/ui/properties/PropertiesTable.java +++ b/src/org/nbgit/ui/properties/PropertiesTable.java @@ -177,4 +177,4 @@ public class PropertiesTable implements AncestorListener, TableModelListener { return renderer; } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/properties/PropertiesTableModel.java b/src/org/nbgit/ui/properties/PropertiesTableModel.java index bebd19b..d585ea5 100644 --- a/src/org/nbgit/ui/properties/PropertiesTableModel.java +++ b/src/org/nbgit/ui/properties/PropertiesTableModel.java @@ -59,7 +59,7 @@ public class PropertiesTableModel extends AbstractTableModel { private GitPropertiesNode[] nodes; private String[] columns; private static final Map columnLabels = new HashMap(2); - + { ResourceBundle loc = NbBundle.getBundle(PropertiesTableModel.class); @@ -116,4 +116,4 @@ public class PropertiesTableModel extends AbstractTableModel { } throw new IllegalArgumentException("The column index is out of index: " + columnIndex); // NOI18N } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/GitVersioningTopComponent.java b/src/org/nbgit/ui/status/GitVersioningTopComponent.java index 42ee0ed..dd7ef0b 100644 --- a/src/org/nbgit/ui/status/GitVersioningTopComponent.java +++ b/src/org/nbgit/ui/status/GitVersioningTopComponent.java @@ -280,4 +280,4 @@ public class GitVersioningTopComponent extends TopComponent { public boolean hasContext() { return context != null && context.getRootFiles().size() > 0; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/OpenInEditorAction.java b/src/org/nbgit/ui/status/OpenInEditorAction.java index 7acb2f8..1616f63 100644 --- a/src/org/nbgit/ui/status/OpenInEditorAction.java +++ b/src/org/nbgit/ui/status/OpenInEditorAction.java @@ -125,4 +125,4 @@ public class OpenInEditorAction extends AbstractAction { } return true; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/OpenVersioningAction.java b/src/org/nbgit/ui/status/OpenVersioningAction.java index 9e9065d..645a301 100644 --- a/src/org/nbgit/ui/status/OpenVersioningAction.java +++ b/src/org/nbgit/ui/status/OpenVersioningAction.java @@ -97,4 +97,4 @@ public class OpenVersioningAction extends ShowAllChangesAction { protected boolean shouldPostRefresh() { return false; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/ShowAllChangesAction.java b/src/org/nbgit/ui/status/ShowAllChangesAction.java index 31a5296..044a6aa 100644 --- a/src/org/nbgit/ui/status/ShowAllChangesAction.java +++ b/src/org/nbgit/ui/status/ShowAllChangesAction.java @@ -95,4 +95,4 @@ public class ShowAllChangesAction extends SystemAction { protected boolean shouldPostRefresh() { return true; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/StatusAction.java b/src/org/nbgit/ui/status/StatusAction.java index 3ab4d2e..cc1f40a 100644 --- a/src/org/nbgit/ui/status/StatusAction.java +++ b/src/org/nbgit/ui/status/StatusAction.java @@ -72,4 +72,4 @@ public class StatusAction extends ContextAction { stc.performRefreshAction(); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/SyncFileNode.java b/src/org/nbgit/ui/status/SyncFileNode.java index 8b97bc4..e4b0916 100644 --- a/src/org/nbgit/ui/status/SyncFileNode.java +++ b/src/org/nbgit/ui/status/SyncFileNode.java @@ -214,4 +214,4 @@ public class SyncFileNode extends AbstractNode { return finfo.getStatusText(mask); } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/status/SyncTable.java b/src/org/nbgit/ui/status/SyncTable.java index 348cb43..c4f2ee3 100644 --- a/src/org/nbgit/ui/status/SyncTable.java +++ b/src/org/nbgit/ui/status/SyncTable.java @@ -78,7 +78,7 @@ class SyncTable implements MouseListener, ListSelectionListener, AncestorListene * Defines labels for Versioning view table columns. */ private static final Map columnLabels = new HashMap(4); - + { ResourceBundle loc = NbBundle.getBundle(SyncTable.class); @@ -327,7 +327,7 @@ class SyncTable implements MouseListener, ListSelectionListener, AncestorListene /* menu.add(new JSeparator()); - + item = menu.add(new ConflictResolvedAction(loc.getString("CTL_PopupMenuItem_MarkResolved"), context)); // NOI18N Mnemonics.setLocalizedText(item, item.getText()); menu.add(new JSeparator()); @@ -370,9 +370,9 @@ class SyncTable implements MouseListener, ListSelectionListener, AncestorListene /* item = menu.add(new SystemActionBridge(SystemAction.get(SearchHistoryAction.class), actionString("CTL_PopupMenuItem_SearchHistory"))); // NOI18N Mnemonics.setLocalizedText(item, item.getText()); - + menu.add(new JSeparator()); - + // item = menu.add(new SystemActionBridge(SystemAction.get(ResolveConflictsAction.class), actionString("CTL_PopupMenuItem_ResolveConflicts"))); // NOI18N // Mnemonics.setLocalizedText(item, item.getText()); /* diff --git a/src/org/nbgit/ui/update/ConflictResolvedAction.java b/src/org/nbgit/ui/update/ConflictResolvedAction.java index 4dcaff0..0498092 100644 --- a/src/org/nbgit/ui/update/ConflictResolvedAction.java +++ b/src/org/nbgit/ui/update/ConflictResolvedAction.java @@ -124,4 +124,4 @@ public class ConflictResolvedAction extends ContextAction { public static void resolved(File file) { perform(file); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/ResolveConflictsAction.java b/src/org/nbgit/ui/update/ResolveConflictsAction.java index b70a1d4..80b66e8 100644 --- a/src/org/nbgit/ui/update/ResolveConflictsAction.java +++ b/src/org/nbgit/ui/update/ResolveConflictsAction.java @@ -95,4 +95,4 @@ public class ResolveConflictsAction extends ContextAction { } } } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/RevertModifications.java b/src/org/nbgit/ui/update/RevertModifications.java index 9e40476..4e57f54 100644 --- a/src/org/nbgit/ui/update/RevertModifications.java +++ b/src/org/nbgit/ui/update/RevertModifications.java @@ -123,4 +123,4 @@ public class RevertModifications implements PropertyChangeListener { } return panel.isBackupRequested(); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/RevertModificationsAction.java b/src/org/nbgit/ui/update/RevertModificationsAction.java index f665b3e..91b63d9 100644 --- a/src/org/nbgit/ui/update/RevertModificationsAction.java +++ b/src/org/nbgit/ui/update/RevertModificationsAction.java @@ -183,4 +183,4 @@ public class RevertModificationsAction extends ContextAction { } return true; } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/RevertModificationsPanel.java b/src/org/nbgit/ui/update/RevertModificationsPanel.java index 93726d6..4d66e56 100644 --- a/src/org/nbgit/ui/update/RevertModificationsPanel.java +++ b/src/org/nbgit/ui/update/RevertModificationsPanel.java @@ -258,4 +258,4 @@ public class RevertModificationsPanel extends javax.swing.JPanel { private javax.swing.JComboBox revisionsComboBox; private javax.swing.JLabel revisionsLabel; // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/Update.java b/src/org/nbgit/ui/update/Update.java index 84518de..c8366c6 100644 --- a/src/org/nbgit/ui/update/Update.java +++ b/src/org/nbgit/ui/update/Update.java @@ -116,4 +116,4 @@ public class Update implements PropertyChangeListener { } return panel.isForcedUpdateRequested(); } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/UpdateAction.java b/src/org/nbgit/ui/update/UpdateAction.java index dfc0838..f902909 100644 --- a/src/org/nbgit/ui/update/UpdateAction.java +++ b/src/org/nbgit/ui/update/UpdateAction.java @@ -131,4 +131,4 @@ public class UpdateAction extends ContextAction { }; support.start(rp, repository, org.openide.util.NbBundle.getMessage(UpdateAction.class, "MSG_Update_Progress")); // NOI18N } -} \ No newline at end of file +} diff --git a/src/org/nbgit/ui/update/UpdatePanel.java b/src/org/nbgit/ui/update/UpdatePanel.java index eacab11..6066e79 100644 --- a/src/org/nbgit/ui/update/UpdatePanel.java +++ b/src/org/nbgit/ui/update/UpdatePanel.java @@ -243,4 +243,4 @@ public class UpdatePanel extends javax.swing.JPanel { private javax.swing.JComboBox revisionsComboBox; private javax.swing.JLabel revisionsLabel; // End of variables declaration//GEN-END:variables -} \ No newline at end of file +} diff --git a/src/org/nbgit/util/GitCommand.java b/src/org/nbgit/util/GitCommand.java index c280619..cb17f7a 100644 --- a/src/org/nbgit/util/GitCommand.java +++ b/src/org/nbgit/util/GitCommand.java @@ -649,4 +649,3 @@ public class GitCommand { return info; } } - diff --git a/src/org/nbgit/util/GitProjectUtils.java b/src/org/nbgit/util/GitProjectUtils.java index 997ddc3..9b81f1a 100644 --- a/src/org/nbgit/util/GitProjectUtils.java +++ b/src/org/nbgit/util/GitProjectUtils.java @@ -155,4 +155,4 @@ public class GitProjectUtils { // Should not be creating an instance of this class private GitProjectUtils() { } -} \ No newline at end of file +} diff --git a/src/org/nbgit/util/exclude/Excludes.java b/src/org/nbgit/util/exclude/Excludes.java index ceba20e..71263f4 100644 --- a/src/org/nbgit/util/exclude/Excludes.java +++ b/src/org/nbgit/util/exclude/Excludes.java @@ -51,7 +51,7 @@ import org.spearce.jgit.lib.Repository; /** * Provides support for .gitignore files. - * + * * To keep the querying interface fast, a cache of patterns are maintained. */ public class Excludes { diff --git a/test/unit/src/org/nbgit/ui/commit/StripSpaceTest.java b/test/unit/src/org/nbgit/ui/commit/StripSpaceTest.java index 66ad6ab..4d21012 100644 --- a/test/unit/src/org/nbgit/ui/commit/StripSpaceTest.java +++ b/test/unit/src/org/nbgit/ui/commit/StripSpaceTest.java @@ -59,4 +59,4 @@ public class StripSpaceTest { assertEquals("a\n\nbc\n", CommitAction.stripSpace("a \n\n\n\n\nbc \t \n\n\n\n\n")); } -} \ No newline at end of file +} -- 2.11.4.GIT