git clone of logicmail with some fixes/features added
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial platform support for BlackBerry OS 6.0.0

git-svn-id: https://logicmail.svn.sourceforge.net/svnroot/logicmail/trunk@686 5c734088-3d25-0410-9155-b3c3832efda5

octorian 911ec8bc 881053e2

+348 -7
+1
LogicMail/src/org/logicprobe/LogicMail/PlatformInfo.java
··· 46 46 * API version to the lowest. 47 47 */ 48 48 private static String[] infoClasses = { 49 + "org.logicprobe.LogicMail.PlatformInfoBB60", 49 50 "org.logicprobe.LogicMail.PlatformInfoBB50", 50 51 "org.logicprobe.LogicMail.PlatformInfoBB47", 51 52 "org.logicprobe.LogicMail.PlatformInfoBB46",
+1
LogicMail/src/org/logicprobe/LogicMail/ui/ScreenFactory.java
··· 46 46 * API version to the lowest. 47 47 */ 48 48 private static String[] factoryClasses = { 49 + "org.logicprobe.LogicMail.ui.ScreenFactoryBB60", 49 50 "org.logicprobe.LogicMail.ui.ScreenFactoryBB50", 50 51 "org.logicprobe.LogicMail.ui.ScreenFactoryBB47", 51 52 "org.logicprobe.LogicMail.ui.ScreenFactoryBB42"
+16 -5
LogicMail/src/org/logicprobe/LogicMail/ui/StandardScreen.java
··· 53 53 protected static ResourceBundle resources = ResourceBundle.getBundle(LogicMailResource.BUNDLE_ID, LogicMailResource.BUNDLE_NAME); 54 54 protected static StatusBarField statusBarField = new StatusBarField(); 55 55 private NavigationController navigationController; 56 - private HeaderField headerField; 56 + private Field titleField; 57 57 private Field originalStatusField; 58 58 private Field currentStatusField; 59 59 ··· 87 87 private void initialize() { 88 88 // Create screen elements 89 89 if(screenProvider.getTitle() != null) { 90 - this.headerField = new HeaderField(resources.getString(LogicMailResource.APPNAME) + " - " + screenProvider.getTitle()); 91 - setTitle(headerField); 90 + this.titleField = createTitleField(); 91 + setTitle(titleField); 92 92 } 93 93 94 94 initMenuItems(); 95 95 screenProvider.setNavigationController(navigationController); 96 96 screenProvider.initFields(this); 97 + } 98 + 99 + protected Field createTitleField() { 100 + return new HeaderField( 101 + resources.getString(LogicMailResource.APPNAME) 102 + + " - " 103 + + screenProvider.getTitle()); 97 104 } 98 105 99 106 /* (non-Javadoc) ··· 242 249 accounts[i].requestDisconnect(true); 243 250 } 244 251 } 245 - headerField.removeListeners(); 252 + cleanupTitleField(titleField); 246 253 NotificationHandler.getInstance().shutdown(); 247 254 System.exit(0); 248 255 } 249 256 } 250 257 else { 251 - headerField.removeListeners(); 258 + cleanupTitleField(titleField); 252 259 NotificationHandler.getInstance().shutdown(); 253 260 System.exit(0); 254 261 } 255 262 } 256 263 264 + protected void cleanupTitleField(Field titleField) { 265 + ((HeaderField)titleField).removeListeners(); 266 + } 267 + 257 268 /** 258 269 * Shows the configuration screen. 259 270 * Subclasses should override this method if they need to
+5 -2
LogicMail_BB47/src/org/logicprobe/LogicMail/ui/ScreenFactoryBB47.java
··· 46 46 47 47 public StandardScreen getMailHomeScreen(NavigationController navigationController, MailRootNode mailRootNode) { 48 48 if(hasTouchscreen) { 49 - return new StandardTouchScreen(navigationController, new TouchMailHomeScreen(mailRootNode)); 49 + return getStandardTouchScreen(navigationController, new TouchMailHomeScreen(mailRootNode)); 50 50 } 51 51 else { 52 52 return new StandardScreen(navigationController, new MailHomeScreen(mailRootNode)); ··· 55 55 56 56 public StandardScreen getMailboxScreen(NavigationController navigationController, MailboxNode mailboxNode) { 57 57 if(hasTouchscreen) { 58 - return new StandardTouchScreen(navigationController, new MailboxScreen(mailboxNode)); 58 + return getStandardTouchScreen(navigationController, new MailboxScreen(mailboxNode)); 59 59 } 60 60 else { 61 61 return new StandardScreen(navigationController, new MailboxScreen(mailboxNode)); ··· 75 75 } 76 76 } 77 77 78 + protected StandardScreen getStandardTouchScreen(NavigationController navigationController, ScreenProvider screenProvider) { 79 + return new StandardTouchScreen(navigationController, screenProvider); 80 + } 78 81 }
+11
LogicMail_BB60/.classpath
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <classpath> 3 + <classpathentry kind="src" path="src"/> 4 + <classpathentry kind="src" path="res"/> 5 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/net.rim.ejde.BlackBerryVMInstallType/BlackBerry JRE 6.0.0"/> 6 + <classpathentry combineaccessrules="false" kind="src" path="/LogicMail"/> 7 + <classpathentry combineaccessrules="false" kind="src" path="/LogicMail_BB46"/> 8 + <classpathentry combineaccessrules="false" kind="src" path="/LogicMail_BB47"/> 9 + <classpathentry combineaccessrules="false" kind="src" path="/LogicMail_BB50"/> 10 + <classpathentry kind="output" path="bin"/> 11 + </classpath>
+29
LogicMail_BB60/.project
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <projectDescription> 3 + <name>LogicMail_BB60</name> 4 + <comment></comment> 5 + <projects> 6 + </projects> 7 + <buildSpec> 8 + <buildCommand> 9 + <name>net.rim.ejde.internal.builder.BlackBerryPreprocessBuilder</name> 10 + <arguments> 11 + </arguments> 12 + </buildCommand> 13 + <buildCommand> 14 + <name>net.rim.ejde.internal.builder.BlackBerryResourcesBuilder</name> 15 + <arguments> 16 + </arguments> 17 + </buildCommand> 18 + <buildCommand> 19 + <name>org.eclipse.jdt.core.javabuilder</name> 20 + <arguments> 21 + </arguments> 22 + </buildCommand> 23 + </buildSpec> 24 + <natures> 25 + <nature>net.rim.ejde.BlackBerryPreProcessNature</nature> 26 + <nature>net.rim.ejde.BlackBerryProjectCoreNature</nature> 27 + <nature>org.eclipse.jdt.core.javanature</nature> 28 + </natures> 29 + </projectDescription>
+12
LogicMail_BB60/.settings/org.eclipse.jdt.core.prefs
··· 1 + #Wed Aug 04 21:46:59 CDT 2010 2 + eclipse.preferences.version=1 3 + org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled 4 + org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 5 + org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 + org.eclipse.jdt.core.compiler.compliance=1.4 7 + org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 + org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 + org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 + org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore 11 + org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore 12 + org.eclipse.jdt.core.compiler.source=1.3
+18
LogicMail_BB60/BlackBerry_App_Descriptor.xml
··· 1 + <Properties ModelVersion="1.1.2"> 2 + <General Title="" Version="1.9.1" Vendor="Derek Konigsberg" Description="LogicMail BB 6.0 Platform Library"/> 3 + <Application Type="Library" MainMIDletName="" MainArgs="" HomeScreenPosition="0" StartupTier="7" IsSystemModule="true" IsAutostartup="false"/> 4 + <Resources hasTitleResource="false" TitleResourceBundleName="" TitleResourceBundleRelativePath="" TitleResourceBundleClassName="" TitleResourceBundleKey="" DescriptionId=""> 5 + <Icons/> 6 + </Resources> 7 + <Compile OutputCompilerMessages="false" ConvertImages="false" CreateWarningForNoExportedRoutine="true" CompressResources="false" AliasList=""> 8 + <PreprocessorDefines/> 9 + </Compile> 10 + <Packaging OutputFileName="LogicMail_BB60" OutputFolder="deliverables" PreBuildStep="" PostBuildStep="" CleanStep="" GenerateALXFile="true"> 11 + <AlxFiles/> 12 + </Packaging> 13 + <HiddenProperties> 14 + <ClassProtection/> 15 + <PackageProtection/> 16 + </HiddenProperties> 17 + <AlternateEntryPoints/> 18 + </Properties>
+35
LogicMail_BB60/src/org/logicprobe/LogicMail/PlatformInfoBB60.java
··· 1 + /*- 2 + * Copyright (c) 2010, Derek Konigsberg 3 + * All rights reserved. 4 + * 5 + * Redistribution and use in source and binary forms, with or without 6 + * modification, are permitted provided that the following conditions 7 + * are met: 8 + * 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 3. Neither the name of the project nor the names of its 15 + * contributors may be used to endorse or promote products derived 16 + * from this software without specific prior written permission. 17 + * 18 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 29 + * OF THE POSSIBILITY OF SUCH DAMAGE. 30 + */ 31 + package org.logicprobe.LogicMail; 32 + 33 + public class PlatformInfoBB60 extends PlatformInfoBB50 { 34 + 35 + }
+38
LogicMail_BB60/src/org/logicprobe/LogicMail/ui/ScreenFactoryBB60.java
··· 1 + /*- 2 + * Copyright (c) 2010, Derek Konigsberg 3 + * All rights reserved. 4 + * 5 + * Redistribution and use in source and binary forms, with or without 6 + * modification, are permitted provided that the following conditions 7 + * are met: 8 + * 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 3. Neither the name of the project nor the names of its 15 + * contributors may be used to endorse or promote products derived 16 + * from this software without specific prior written permission. 17 + * 18 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 29 + * OF THE POSSIBILITY OF SUCH DAMAGE. 30 + */ 31 + package org.logicprobe.LogicMail.ui; 32 + 33 + public class ScreenFactoryBB60 extends ScreenFactoryBB50 { 34 + 35 + protected StandardScreen getStandardTouchScreen(NavigationController navigationController, ScreenProvider screenProvider) { 36 + return new StandardTouchScreenBB60(navigationController, screenProvider); 37 + } 38 + }
+60
LogicMail_BB60/src/org/logicprobe/LogicMail/ui/StandardScreenBB60.java
··· 1 + /*- 2 + * Copyright (c) 2010, Derek Konigsberg 3 + * All rights reserved. 4 + * 5 + * Redistribution and use in source and binary forms, with or without 6 + * modification, are permitted provided that the following conditions 7 + * are met: 8 + * 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 3. Neither the name of the project nor the names of its 15 + * contributors may be used to endorse or promote products derived 16 + * from this software without specific prior written permission. 17 + * 18 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 29 + * OF THE POSSIBILITY OF SUCH DAMAGE. 30 + */ 31 + package org.logicprobe.LogicMail.ui; 32 + 33 + import org.logicprobe.LogicMail.LogicMailResource; 34 + 35 + import net.rim.device.api.ui.Field; 36 + import net.rim.device.api.ui.component.StandardTitleBar; 37 + 38 + public class StandardScreenBB60 extends StandardScreen { 39 + 40 + public StandardScreenBB60(NavigationController navigationController, ScreenProvider screenProvider) { 41 + super(navigationController, screenProvider); 42 + } 43 + 44 + protected Field createTitleField() { 45 + StandardTitleBar titlebarField = new StandardTitleBar(); 46 + titlebarField.addTitle( 47 + resources.getString(LogicMailResource.APPNAME) 48 + + " - " 49 + + screenProvider.getTitle()); 50 + titlebarField.addSignalIndicator(); 51 + titlebarField.setPropertyValue( 52 + StandardTitleBar.PROPERTY_BATTERY_VISIBILITY, 53 + StandardTitleBar.BATTERY_VISIBLE_ALWAYS); 54 + return titlebarField; 55 + } 56 + 57 + protected void cleanupTitleField(Field titleField) { 58 + // System title field does not require cleanup 59 + } 60 + }
+122
LogicMail_BB60/src/org/logicprobe/LogicMail/ui/StandardTouchScreenBB60.java
··· 1 + /*- 2 + * Copyright (c) 2010, Derek Konigsberg 3 + * All rights reserved. 4 + * 5 + * Redistribution and use in source and binary forms, with or without 6 + * modification, are permitted provided that the following conditions 7 + * are met: 8 + * 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 3. Neither the name of the project nor the names of its 15 + * contributors may be used to endorse or promote products derived 16 + * from this software without specific prior written permission. 17 + * 18 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 29 + * OF THE POSSIBILITY OF SUCH DAMAGE. 30 + */ 31 + package org.logicprobe.LogicMail.ui; 32 + 33 + import net.rim.device.api.command.AlwaysExecutableCommand; 34 + import net.rim.device.api.command.Command; 35 + import net.rim.device.api.command.ReadOnlyCommandMetadata; 36 + import net.rim.device.api.system.Bitmap; 37 + import net.rim.device.api.ui.image.ImageFactory; 38 + import net.rim.device.api.ui.toolbar.ToolbarButtonField; 39 + import net.rim.device.api.ui.toolbar.ToolbarManager; 40 + import net.rim.device.api.ui.toolbar.ToolbarSpacer; 41 + import net.rim.device.api.util.IntHashtable; 42 + import net.rim.device.api.util.StringProvider; 43 + 44 + import org.logicprobe.LogicMail.ui.ScreenProvider.ShortcutItem; 45 + 46 + public class StandardTouchScreenBB60 extends StandardScreenBB60 { 47 + private ToolbarManager toolbarManager; 48 + private IntHashtable shortcutIdMap; 49 + 50 + public StandardTouchScreenBB60(NavigationController navigationController, ScreenProvider screenProvider) { 51 + super(navigationController, screenProvider); 52 + 53 + if(screenProvider.hasShortcuts()) { 54 + ShortcutItem[] shortcuts = screenProvider.getShortcuts(); 55 + if(shortcuts != null) { 56 + initializeShortcutBar(shortcuts); 57 + } 58 + } 59 + } 60 + 61 + private void initializeShortcutBar(ShortcutItem[] shortcuts) { 62 + shortcutIdMap = new IntHashtable(5); 63 + toolbarManager = new ToolbarManager(); 64 + int len = Math.min(shortcuts.length, 5); 65 + for(int i=0; i<len; i++) { 66 + ToolbarButtonField button; 67 + if(shortcuts[i] == null) { 68 + button = new ToolbarSpacer(i); 69 + } 70 + else { 71 + button = new ToolbarButtonField( 72 + ImageFactory.createImage( 73 + Bitmap.getBitmapResource(shortcuts[i].getEnabledIcon())), 74 + new StringProvider(shortcuts[i].getName()), i); 75 + button.setEnabled(true); 76 + button.setCommand(new Command(new ShortcutCommand(shortcuts[i]))); 77 + shortcutIdMap.put(shortcuts[i].getId(), button); 78 + } 79 + toolbarManager.add(button); 80 + } 81 + setStatus(toolbarManager); 82 + 83 + } 84 + 85 + /* (non-Javadoc) 86 + * @see org.logicprobe.LogicMail.ui.StandardScreen#isShortcutEnabled(int) 87 + */ 88 + public boolean isShortcutEnabled(int id) { 89 + boolean result = false; 90 + if(shortcutIdMap != null) { 91 + Object value = shortcutIdMap.get(id); 92 + if(value instanceof ToolbarButtonField) { 93 + result = ((ToolbarButtonField)value).isEnabled(); 94 + } 95 + } 96 + return result; 97 + } 98 + 99 + /* (non-Javadoc) 100 + * @see org.logicprobe.LogicMail.ui.StandardScreen#setShortcutEnabled(int, boolean) 101 + */ 102 + public void setShortcutEnabled(int id, boolean enabled) { 103 + if(shortcutIdMap != null) { 104 + Object value = shortcutIdMap.get(id); 105 + if(value instanceof ToolbarButtonField) { 106 + ((ToolbarButtonField)value).setEnabled(enabled); 107 + } 108 + } 109 + } 110 + 111 + private class ShortcutCommand extends AlwaysExecutableCommand { 112 + private final ShortcutItem item; 113 + 114 + public ShortcutCommand(ShortcutItem item) { 115 + this.item = item; 116 + } 117 + 118 + public void execute(ReadOnlyCommandMetadata metadata, Object context) { 119 + screenProvider.shortcutAction(item); 120 + } 121 + } 122 + }