From: <ez...@us...> - 2008-08-18 03:14:41
|
Revision: 13360 http://jedit.svn.sourceforge.net/jedit/?rev=13360&view=rev Author: ezust Date: 2008-08-18 03:14:39 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Made get/set splitconfig public, so it can be saved/restored by JDiff and other splitting plugins/macros. Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/View.java Modified: jEdit/trunk/org/gjt/sp/jedit/View.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/View.java 2008-08-17 23:52:40 UTC (rev 13359) +++ jEdit/trunk/org/gjt/sp/jedit/View.java 2008-08-18 03:14:39 UTC (rev 13360) @@ -859,6 +859,48 @@ setSplitConfig(null,lastSplitConfig); } //}}} + //{{{ getSplitConfig() method + /** + * Split configurations are recorded in a simple RPN "language". + * @return The split configuration, describing where splitpanes + * are, which buffers are open in each EditPane, etc. + * + */ + public String getSplitConfig() + { + StringBuilder splitConfig = new StringBuilder(); + + if(splitPane != null) + getSplitConfig(splitPane,splitConfig); + else + { + appendToSplitConfig(splitConfig, editPane); + } + + return splitConfig.toString(); + } //}}} + + //{{{ setSplitConfig() method + /** + * sets the split configuration as per the splitConfig. + * + * @param buffer if null, checks all buffers to restore View's split config. + * @param splitConfig the split config, as returned by getSplitConfig() + */ + public void setSplitConfig(Buffer buffer, String splitConfig) + { + try + { + Component comp = restoreSplitConfig(buffer,splitConfig); + setMainContent(comp); + } + catch(IOException e) + { + // this should never throw an exception. + throw new InternalError(); + } + } //}}} + //{{{ nextTextArea() method /** * Moves keyboard focus to the next text area. @@ -1432,21 +1474,6 @@ } //}}} //{{{ getSplitConfig() method - private String getSplitConfig() - { - StringBuilder splitConfig = new StringBuilder(); - - if(splitPane != null) - getSplitConfig(splitPane,splitConfig); - else - { - appendToSplitConfig(splitConfig, editPane); - } - - return splitConfig.toString(); - } //}}} - - //{{{ getSplitConfig() method /* * The split config is recorded in a simple RPN "language". */ @@ -1510,21 +1537,6 @@ } } //}}} - //{{{ setSplitConfig() method - private void setSplitConfig(Buffer buffer, String splitConfig) - { - try - { - Component comp = restoreSplitConfig(buffer,splitConfig); - setMainContent(comp); - } - catch(IOException e) - { - // this should never throw an exception. - throw new InternalError(); - } - } //}}} - //{{{ restoreSplitConfig() method private Component restoreSplitConfig(Buffer buffer, String splitConfig) throws IOException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |