2 new revisions: Revision: 7608ea99714b Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Tue May 1 23:08:20 2012 Log: adding setText method to BBStatusBar http://code.google.com/p/brailleblaster/source/detail?r=7608ea99714b Revision: 276a2cc3d425 Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Tue May 1 23:37:23 2012 Log: show results of loading file in status bar http://code.google.com/p/brailleblaster/source/detail?r=276a2cc3d425 ============================================================================== Revision: 7608ea99714b Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Tue May 1 23:08:20 2012 Log: adding setText method to BBStatusBar http://code.google.com/p/brailleblaster/source/detail?r=7608ea99714b Modified: /src/main/org/brailleblaster/wordprocessor/BBStatusBar.java =======================================--- /src/main/org/brailleblaster/wordprocessor/BBStatusBar.java Sat Aug 13 07:29:07 2011 +++ /src/main/org/brailleblaster/wordprocessor/BBStatusBar.java Tue May 1 23:08:20 2012
@@ -34,11 +34,11 @@ import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormAttachment; -public class BBStatusBar { - -final private Label statusBar; - -public BBStatusBar (Shell documentWindow) { +class BBStatusBar { + +private Label statusBar; + +BBStatusBar (Shell documentWindow) { statusBar = new Label (documentWindow, SWT.BORDER); statusBar.setText ("This is the status bar."); FormData location = new FormData(); @@ -47,6 +47,10 @@ location.bottom = new FormAttachment(100); statusBar.setLayoutData (location); } + +void setText (String text) { +statusBar.setText (text); +} } ============================================================================== Revision: 276a2cc3d425 Author: John Boyer <john.boyer@xxxxxxxxxxxxxxxxx> Date: Tue May 1 23:37:23 2012 Log: show results of loading file in status bar http://code.google.com/p/brailleblaster/source/detail?r=276a2cc3d425 Modified: /src/main/org/brailleblaster/wordprocessor/DocumentManager.java =======================================--- /src/main/org/brailleblaster/wordprocessor/DocumentManager.java Tue May 1 16:10:04 2012 +++ /src/main/org/brailleblaster/wordprocessor/DocumentManager.java Tue May 1 23:37:23 2012
@@ -518,6 +518,9 @@ void fileNew() { placeholder(); } + + int numLines; + int numChars; void fileOpen () { if (BBIni.debugging() && doc != null) { @@ -551,6 +554,9 @@ rd.addDocument(fileName); setWindowTitle (documentName); haveOpenedFile = true; + numLines = 0; + numChars = 0; + statusBar.setText ("Loading " + documentName);final Element rootElement = doc.getRootElement();//this needs to be final, because it will be used by a different thread
//Use threading to keep the control of the window new Thread() { @@ -559,6 +565,8 @@ } } .start(); + statusBar.setText ("Read " + numLines + " lines, " + numChars + + " characters."); } private void walkTree (Node node) { @@ -570,6 +578,8 @@ } else if (newNode instanceof Text) { final String value = newNode.getValue(); + numLines++; + numChars += value.length(); buffer = buffer.concat(value);//the main thread gets to execute the block inside syncExec()
if(buffer.length()>2048 || i== node.getChildCount()-1){