Revision: a0b70ccfcb09 Branch: default Author: Brandon Roller <brandon.r.roller@xxxxxxxxx> Date: Wed Sep 18 19:02:21 2013 UTC Log: Continued cleaning up word processor package http://code.google.com/p/brailleblaster/source/detail?r=a0b70ccfcb09&repo=newdesign Added: /src/main/org/brailleblaster/userHelp/CallOutsideWP.java /src/main/org/brailleblaster/userHelp/HelpOptions.java /src/main/org/brailleblaster/userHelp/UserHelp.java /src/main/org/brailleblaster/userHelp/WP.java Deleted: /src/main/org/brailleblaster/wordprocessor/CallOutsideWP.java /src/main/org/brailleblaster/wordprocessor/UserHelp.java /src/main/org/brailleblaster/wordprocessor/WP.java Modified: /src/main/org/brailleblaster/settings/BrailleTemplates.java /src/main/org/brailleblaster/settings/Welcome.java /src/main/org/brailleblaster/wordprocessor/BBMenu.java ======================================= --- /dev/null+++ /src/main/org/brailleblaster/userHelp/CallOutsideWP.java Wed Sep 18 19:02:21 2013 UTC
@@ -0,0 +1,47 @@ +/* BrailleBlaster Braille Transcription Application + * + * Copyright (C) 2010, 2012 + * ViewPlus Technologies, Inc. www.viewplus.com + * and + * Abilitiessoft, Inc. www.abilitiessoft.com + * and + * American Printing House for the Blind, Inc. www.aph.org + * + * All rights reserved + * + * This file may contain code borrowed from files produced by various + * Java development teams. These are gratefully acknoledged. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the Apache 2.0 License, as given at + * http://www.apache.org/licenses/ + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE + * See the Apache 2.0 License for more details. + * + * You should have received a copy of the Apache 2.0 License along with + * this program; see the file LICENSE. + * If not, see + * http://www.apache.org/licenses/ + * + * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx +*/ + +package org.brailleblaster.userHelp; + + +/** + * Make certain features available outside the word processor + */ +public class CallOutsideWP { + public void showTutorial() { + new UserHelp (HelpOptions.ReadTutorial); + } + + public void showURL (String url) { + new UserHelp (url); + } +} + ======================================= --- /dev/null+++ /src/main/org/brailleblaster/userHelp/HelpOptions.java Wed Sep 18 19:02:21 2013 UTC
@@ -0,0 +1,9 @@ +package org.brailleblaster.userHelp; + +public enum HelpOptions { + AboutBB, + HelpInfo, + ReadTutorial, + ReadManuals, + CheckUpdates; +} ======================================= --- /dev/null+++ /src/main/org/brailleblaster/userHelp/UserHelp.java Wed Sep 18 19:02:21 2013 UTC
@@ -0,0 +1,100 @@ +/* BrailleBlaster Braille Transcription Application + * + * Copyright (C) 2010, 2012 + * ViewPlus Technologies, Inc. www.viewplus.com + * and + * Abilitiessoft, Inc. www.abilitiessoft.com + * All rights reserved + * + * This file may contain code borrowed from files produced by various + * Java development teams. These are gratefully acknoledged. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the Apache 2.0 License, as given at + * http://www.apache.org/licenses/ + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE + * See the Apache 2.0 License for more details. + * + * You should have received a copy of the Apache 2.0 License along with + * this program; see the file LICENSE. + * If not, see + * http://www.apache.org/licenses/ + * + * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx +*/ + +package org.brailleblaster.userHelp; + +import java.awt.Desktop; + +import org.brailleblaster.util.Notify; +import org.brailleblaster.BBIni; +import java.net.URI; +import java.net.URISyntaxException; +import java.io.IOException; + +/** +* This class handles the items on the help menu. +*/ +public class UserHelp { + +private String helpPath; +private Desktop desktop; + +/** + * constructor that accepts integer codes for help items + */ +public UserHelp (HelpOptions helpChoice) { +helpPath = BBIni.getHelpDocsPath() + BBIni.getFileSep(); +desktop = Desktop.getDesktop(); +switch (helpChoice) { +case AboutBB:+new Notify (BBIni.getProductName() + " version " + BBIni.getVersion() + ", released on " +
+BBIni.getReleaseDate() + +". For questions and bug reports contact john.boyer@xxxxxxxxxxxxxxxxx"); +break; +case HelpInfo: +showHelp ("helpinfo.html"); +break; +case ReadTutorial: +showHelp ("tutorial.html"); +break; +case ReadManuals: +showHelp ("manuals.html"); +break; +case CheckUpdates: +showHelp ("checkupdates.html"); +default: +break; +} +} + +UserHelp (String url) { +showHelp (url); +} + +/** +* Display help documents in the local browser. +*/ +private void showHelp (String fileName) { +String us = "file:///" + helpPath.replace('\\','/') + fileName; +String URIString = us.replace(" ", "%20"); +URI uri = null; +try { +uri = new URI (URIString); +} catch (URISyntaxException e) { +new Notify ("Syntax error in " +URIString); +return; +} +try { +desktop.browse (uri); +} catch (IOException e) { +new Notify ("Could not open " + uri.toString()); +} +} + +} + ======================================= --- /dev/null+++ /src/main/org/brailleblaster/userHelp/WP.java Wed Sep 18 19:02:21 2013 UTC
@@ -0,0 +1,62 @@ +/* BrailleBlaster Braille Transcription Application + * + * Copyright (C) 2010, 2012 + * ViewPlus Technologies, Inc. www.viewplus.com + * and + * Abilitiessoft, Inc. www.abilitiessoft.com + * All rights reserved + * + * This file may contain code borrowed from files produced by various + * Java development teams. These are gratefully acknoledged. + * + * This file is free software; you can redistribute it and/or modify it + * under the terms of the Apache 2.0 License, as given at + * http://www.apache.org/licenses/ + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE + * See the Apache 2.0 License for more details. + * + * You should have received a copy of the Apache 2.0 License along with + * this program; see the file LICENSE. + * If not, see + * http://www.apache.org/licenses/ + * + * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx +*/ + +package org.brailleblaster.userHelp; + +/** + * This class contains constants that are used in other word processor + * classes. + */ + +class WP { + +// Document-Handling + +static final int NewDocument = 1; +static final int OpenDocumentGetFile = 2; +static final int ImportDocument = 3; +static final int SwitchDocuments = 4; +static final int DocumentFromCommandLine = 5; +static final int DocumentClosed = 6; +static final int BBClosed = 7; +static final int OpenDocumentGetRecent = 8; +static final int SwitchToRecentDoc = 9; + +// Help + +static final int AboutBB = 1; +static final int HelpInfo = 2; +static final int ReadTutorial = 3; +static final int ReadManuals = 4; +static final int CheckUpdates = 5; + +WP() {} + +} + + =======================================--- /src/main/org/brailleblaster/wordprocessor/CallOutsideWP.java Wed Jan 23 16:02:41 2013 UTC
+++ /dev/null @@ -1,46 +0,0 @@ -/* BrailleBlaster Braille Transcription Application - * - * Copyright (C) 2010, 2012 - * ViewPlus Technologies, Inc. www.viewplus.com - * and - * Abilitiessoft, Inc. www.abilitiessoft.com - * and - * American Printing House for the Blind, Inc. www.aph.org - * - * All rights reserved - * - * This file may contain code borrowed from files produced by various - * Java development teams. These are gratefully acknoledged. - * - * This file is free software; you can redistribute it and/or modify it - * under the terms of the Apache 2.0 License, as given at - * http://www.apache.org/licenses/ - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE - * See the Apache 2.0 License for more details. - * - * You should have received a copy of the Apache 2.0 License along with - * this program; see the file LICENSE. - * If not, see - * http://www.apache.org/licenses/ - * - * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx -*/ - -package org.brailleblaster.wordprocessor; - -/** - * Make certain features available outside the word processor - */ -public class CallOutsideWP { - public void showTutorial() { - new UserHelp (WP.ReadTutorial); - } - - public void showURL (String url) { - new UserHelp (url); - } -} - =======================================--- /src/main/org/brailleblaster/wordprocessor/UserHelp.java Fri Aug 23 13:57:48 2013 UTC
+++ /dev/null @@ -1,99 +0,0 @@ -/* BrailleBlaster Braille Transcription Application - * - * Copyright (C) 2010, 2012 - * ViewPlus Technologies, Inc. www.viewplus.com - * and - * Abilitiessoft, Inc. www.abilitiessoft.com - * All rights reserved - * - * This file may contain code borrowed from files produced by various - * Java development teams. These are gratefully acknoledged. - * - * This file is free software; you can redistribute it and/or modify it - * under the terms of the Apache 2.0 License, as given at - * http://www.apache.org/licenses/ - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE - * See the Apache 2.0 License for more details. - * - * You should have received a copy of the Apache 2.0 License along with - * this program; see the file LICENSE. - * If not, see - * http://www.apache.org/licenses/ - * - * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx -*/ - -package org.brailleblaster.wordprocessor; - -import java.awt.Desktop; -import org.brailleblaster.util.Notify; -import org.brailleblaster.BBIni; -import java.net.URI; -import java.net.URISyntaxException; -import java.io.IOException; - -/** -* This class handles the items on the help menu. -*/ -class UserHelp { - -private String helpPath; -private Desktop desktop; - -/** - * constructor that accepts integer codes for help items - */ -UserHelp (int helpChoice) { -helpPath = BBIni.getHelpDocsPath() + BBIni.getFileSep(); -desktop = Desktop.getDesktop(); -switch (helpChoice) { -case WP.AboutBB:-new Notify (BBIni.getProductName() + " version " + BBIni.getVersion() + ", released on " +
-BBIni.getReleaseDate() + -". For questions and bug reports contact john.boyer@xxxxxxxxxxxxxxxxx"); -break; -case WP.HelpInfo: -showHelp ("helpinfo.html"); -break; -case WP.ReadTutorial: -showHelp ("tutorial.html"); -break; -case WP.ReadManuals: -showHelp ("manuals.html"); -break; -case WP.CheckUpdates: -showHelp ("checkupdates.html"); -default: -break; -} -} - -UserHelp (String url) { -showHelp (url); -} - -/** -* Display help documents in the local browser. -*/ -private void showHelp (String fileName) { -String us = "file:///" + helpPath.replace('\\','/') + fileName; -String URIString = us.replace(" ", "%20"); -URI uri = null; -try { -uri = new URI (URIString); -} catch (URISyntaxException e) { -new Notify ("Syntax error in " +URIString); -return; -} -try { -desktop.browse (uri); -} catch (IOException e) { -new Notify ("Could not open " + uri.toString()); -} -} - -} - =======================================--- /src/main/org/brailleblaster/wordprocessor/WP.java Thu May 10 02:47:26 2012 UTC
+++ /dev/null @@ -1,62 +0,0 @@ -/* BrailleBlaster Braille Transcription Application - * - * Copyright (C) 2010, 2012 - * ViewPlus Technologies, Inc. www.viewplus.com - * and - * Abilitiessoft, Inc. www.abilitiessoft.com - * All rights reserved - * - * This file may contain code borrowed from files produced by various - * Java development teams. These are gratefully acknoledged. - * - * This file is free software; you can redistribute it and/or modify it - * under the terms of the Apache 2.0 License, as given at - * http://www.apache.org/licenses/ - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE - * See the Apache 2.0 License for more details. - * - * You should have received a copy of the Apache 2.0 License along with - * this program; see the file LICENSE. - * If not, see - * http://www.apache.org/licenses/ - * - * Maintained by John J. Boyer john.boyer@xxxxxxxxxxxxxxxxx -*/ - -package org.brailleblaster.wordprocessor; - -/** - * This class contains constants that are used in other word processor - * classes. - */ - -class WP { - -// Document-Handling - -static final int NewDocument = 1; -static final int OpenDocumentGetFile = 2; -static final int ImportDocument = 3; -static final int SwitchDocuments = 4; -static final int DocumentFromCommandLine = 5; -static final int DocumentClosed = 6; -static final int BBClosed = 7; -static final int OpenDocumentGetRecent = 8; -static final int SwitchToRecentDoc = 9; - -// Help - -static final int AboutBB = 1; -static final int HelpInfo = 2; -static final int ReadTutorial = 3; -static final int ReadManuals = 4; -static final int CheckUpdates = 5; - -WP() {} - -} - - =======================================--- /src/main/org/brailleblaster/settings/BrailleTemplates.java Sat Dec 8 17:04:22 2012 UTC +++ /src/main/org/brailleblaster/settings/BrailleTemplates.java Wed Sep 18 19:02:21 2013 UTC
@@ -48,8 +48,8 @@ import org.eclipse.swt.widgets.Shell; import org.brailleblaster.BBIni; import org.brailleblaster.localization.LocaleHandler; +import org.brailleblaster.userHelp.CallOutsideWP; import org.brailleblaster.util.Notify; -import org.brailleblaster.wordprocessor.CallOutsideWP; /** * This class provides the methods for dealing with liblouisutdml =======================================--- /src/main/org/brailleblaster/settings/Welcome.java Fri Sep 6 18:16:34 2013 UTC +++ /src/main/org/brailleblaster/settings/Welcome.java Wed Sep 18 19:02:21 2013 UTC
@@ -39,6 +39,7 @@ import org.brailleblaster.BBIni; import org.brailleblaster.localization.LocaleHandler; +import org.brailleblaster.userHelp.CallOutsideWP; import org.brailleblaster.util.Notify; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; @@ -50,7 +51,6 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; -import org.brailleblaster.wordprocessor.CallOutsideWP; import org.brailleblaster.wordprocessor.WPManager; /** =======================================--- /src/main/org/brailleblaster/wordprocessor/BBMenu.java Fri Sep 13 17:44:22 2013 UTC +++ /src/main/org/brailleblaster/wordprocessor/BBMenu.java Wed Sep 18 19:02:21 2013 UTC
@@ -41,6 +41,8 @@ import org.brailleblaster.localization.LocaleHandler; import org.brailleblaster.settings.ConfigFileDialog; import org.brailleblaster.settings.SettingsDialog; +import org.brailleblaster.userHelp.HelpOptions; +import org.brailleblaster.userHelp.UserHelp; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -794,28 +796,28 @@ aboutItem.setText(lh.localValue("&About")); aboutItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - new UserHelp(WP.AboutBB); + new UserHelp(HelpOptions.AboutBB); } }); helpInfoItem = new MenuItem(helpMenu, SWT.PUSH); helpInfoItem.setText(lh.localValue("&helpInfo")); helpInfoItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - new UserHelp(WP.HelpInfo); + new UserHelp(HelpOptions.HelpInfo); } }); tutorialsItem = new MenuItem(helpMenu, SWT.PUSH); tutorialsItem.setText(lh.localValue("&Tutorials")); tutorialsItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - new UserHelp(WP.ReadTutorial); + new UserHelp(HelpOptions.ReadTutorial); } }); readManualItem = new MenuItem(helpMenu, SWT.PUSH); readManualItem.setText(lh.localValue("&ReadManuals")); readManualItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - new UserHelp(WP.ReadManuals); + new UserHelp(HelpOptions.ReadManuals); } }); checkUpdatesItem = new MenuItem(helpMenu, SWT.PUSH); @@ -823,7 +825,7 @@ checkUpdatesItem.setEnabled(false); /* FO */ checkUpdatesItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - new UserHelp(WP.CheckUpdates); + new UserHelp(HelpOptions.CheckUpdates); } }); helpItem.setMenu(helpMenu);