From: <ez...@us...> - 2013-03-05 19:40:12
|
Revision: 22828 http://jedit.svn.sourceforge.net/jedit/?rev=22828&view=rev Author: ezust Date: 2013-03-05 19:40:05 +0000 (Tue, 05 Mar 2013) Log Message: ----------- Renamed abbreviate() to abbreviateView(), new API which observes the view option for whether to abbreviate paths in the jEdit View. abbreviate() behavior is restored to how it worked previously so this option does not break plugins such as ProjectViewer and BufferList which also use this API and have a separate option to control whether it is used. Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/Buffer.java jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_3.java jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_4.java jEdit/trunk/org/jedit/core/MigrationService.java Modified: jEdit/trunk/org/gjt/sp/jedit/Buffer.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/Buffer.java 2013-03-05 05:30:41 UTC (rev 22827) +++ jEdit/trunk/org/gjt/sp/jedit/Buffer.java 2013-03-05 19:40:05 UTC (rev 22828) @@ -803,7 +803,7 @@ */ public String getPath(Boolean shortVersion) { - return shortVersion ? MiscUtilities.abbreviate(path) : getPath(); + return shortVersion ? MiscUtilities.abbreviateView(path) : getPath(); } //}}} @@ -1588,7 +1588,7 @@ @Override public String toString() { - return name + " (" + MiscUtilities.abbreviate(directory) + ')'; + return name + " (" + MiscUtilities.abbreviateView(directory) + ')'; } //}}} //{{{ addBufferUndoListener() method Modified: jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2013-03-05 05:30:41 UTC (rev 22827) +++ jEdit/trunk/org/gjt/sp/jedit/MiscUtilities.java 2013-03-05 19:40:05 UTC (rev 22828) @@ -171,7 +171,7 @@ return arg; } //}}} - //{{{ abbreviate() method + //{{{ abbreviate() methods /** @return an abbreviated path, replacing values with variables, if a prefix exists. uses platform convention (%varname% on windows, $varname on other platforms) * @see #expandVariables @@ -179,10 +179,19 @@ */ public static String abbreviate(String path) { - if (!jEdit.getBooleanProperty("view.abbreviatePaths")) return path; if (svc == null) svc = new VarCompressor(); return svc.compress(path); + } + + /** Same as abbreviate() but checks a view option which can + * disable the feature for things jEdit UI components. + * + */ + public static String abbreviateView(String path) + { + if (!jEdit.getBooleanProperty("view.abbreviatePaths")) return path; + return abbreviate(path); } //}}} //{{{ resolveSymlinks() method Modified: jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java 2013-03-05 05:30:41 UTC (rev 22827) +++ jEdit/trunk/org/gjt/sp/jedit/io/FavoritesVFS.java 2013-03-05 19:40:05 UTC (rev 22828) @@ -195,7 +195,7 @@ String p = favorite.getPath(); String l = favorite.getLabel(); jEdit.setProperty("vfs.favorite." + i, p); - if (p.equals(l) || MiscUtilities.abbreviate(p).equals(l)) + if (p.equals(l) || MiscUtilities.abbreviateView(p).equals(l)) jEdit.unsetProperty("vfs.favorite." + i + ".label"); else jEdit.setProperty("vfs.favorite." + i + ".label", l); @@ -236,7 +236,7 @@ Favorite(String path, int type) { super(path,path,PROTOCOL + ':' + path,type, 0L,false); - this.label = MiscUtilities.abbreviate(path); + this.label = MiscUtilities.abbreviateView(path); } public String getLabel() Modified: jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_3.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_3.java 2013-03-05 05:30:41 UTC (rev 22827) +++ jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_3.java 2013-03-05 19:40:05 UTC (rev 22828) @@ -83,7 +83,7 @@ public static void print(final View view, final Buffer buffer, boolean selection) { job = getPrintJob(); - job.setJobName(MiscUtilities.abbreviate(buffer.getPath())); + job.setJobName(MiscUtilities.abbreviateView(buffer.getPath())); boolean header = jEdit.getBooleanProperty("print.header"); boolean footer = jEdit.getBooleanProperty("print.footer"); boolean lineNumbers = jEdit.getBooleanProperty("print.lineNumbers"); Modified: jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_4.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_4.java 2013-03-05 05:30:41 UTC (rev 22827) +++ jEdit/trunk/org/gjt/sp/jedit/print/BufferPrinter1_4.java 2013-03-05 19:40:05 UTC (rev 22828) @@ -86,7 +86,7 @@ //{{{ print() method public static void print(final View view, final Buffer buffer, boolean selection) { - job = getPrintJob(MiscUtilities.abbreviate(buffer.getPath())); + job = getPrintJob(MiscUtilities.abbreviateView(buffer.getPath())); boolean header = jEdit.getBooleanProperty("print.header"); boolean footer = jEdit.getBooleanProperty("print.footer"); Modified: jEdit/trunk/org/jedit/core/MigrationService.java =================================================================== --- jEdit/trunk/org/jedit/core/MigrationService.java 2013-03-05 05:30:41 UTC (rev 22827) +++ jEdit/trunk/org/jedit/core/MigrationService.java 2013-03-05 19:40:05 UTC (rev 22828) @@ -30,7 +30,7 @@ * The service and interface exists primarily so you don't need to add a compilation * dependency of the org.gjt.sp.jEdit class to your MigrationService class. <br /> * <br /> - * Concrete instances need to gurantee that the migration itself is only done + * Concrete instances need to guarantee that the migration itself is only done * once. * @see org.jedit.migration.OneTimeMigrationService * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |