[brailleblaster] push by brandon....@xxxxxxxxx - Fixed bug with status bar style not matching name in style panel on 2015-02-23 18:31 GMT

  • From: brailleblaster@xxxxxxxxxxxxxx
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Mon, 23 Feb 2015 18:31:29 +0000

Revision: d170eec8c9fc
Branch:   default
Author:   Brandon Roller<brandon.r.roller@xxxxxxxxx>
Date:     Mon Feb 23 18:29:45 2015 UTC
Log:      Fixed bug with status bar style not matching name in style panel
https://code.google.com/p/brailleblaster/source/detail?r=d170eec8c9fc

Modified:
 /src/main/org/brailleblaster/perspectives/braille/views/wp/WPView.java

=======================================
--- /src/main/org/brailleblaster/perspectives/braille/views/wp/WPView.java Wed Jan 28 17:59:21 2015 UTC +++ /src/main/org/brailleblaster/perspectives/braille/views/wp/WPView.java Mon Feb 23 18:29:45 2015 UTC
@@ -364,18 +364,30 @@
                }

                if(manager.getCurrent() != null){
-                       Element e = manager.getCurrent().parentElement();
-                       
while(stylesTable.getSemanticTypeFromAttribute(e).equals("action"))
-                               e = (Element)e.getParent();
+                       String styleName;
+                       if(manager.getCurrent() instanceof PageMapElement){
+                               styleName = "Print Page";
+                       }
+                       else {
+                               Element e = 
manager.getCurrent().parentElement();
+                               
while(stylesTable.getSemanticTypeFromAttribute(e).equals("action"))
+                                       e = (Element)e.getParent();

-                       String style = stylesTable.getKeyFromAttribute(e);
+                               styleName = stylesTable.getKeyFromAttribute(e);
+                               Styles style = stylesTable.get(styleName);

-                       if(style.contains("local_")){
-                               String [] tokens = style.split("_");
-                               style = tokens[1];
+                               if(styleName.contains("local_")){
+                                       String [] tokens = styleName.split("_");
+                                       styleName = tokens[1];
+                                       style = stylesTable.get(styleName);
+                                       styleName = 
(String)style.get(StylesType.name);
+                               }
+                               else if(style.contains(StylesType.name))
+                                       styleName = 
(String)style.get(StylesType.name);
+                               else
+                                       styleName = style.getName();
                        }
-
-                       statusBarText += "Style: " + style + " | ";
+                       statusBarText += "Style: " + styleName + " | ";
                }

Message statusMessage = Message.createUpdateStatusbarMessage(statusBarText + " Words: " + words);

Other related posts:

  • » [brailleblaster] push by brandon....@xxxxxxxxx - Fixed bug with status bar style not matching name in style panel on 2015-02-23 18:31 GMT - brailleblaster