[brailleblaster] [brailleblaster.newdesign] push by RandomCh...@xxxxxxxxx - Temp Toolbar button for ImageDescriber on 2013-07-25 19:00 GMT

  • From: brailleblaster@xxxxxxxxxxxxxx
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Thu, 25 Jul 2013 19:00:36 +0000

Revision: 0b51c4c80994
Branch:   default
Author:   cmyers@xxxxxxxxxxxxxxxxx
Date:     Thu Jul 25 13:06:50 2013
Log:      Temp Toolbar button for ImageDescriber
http://code.google.com/p/brailleblaster/source/detail?r=0b51c4c80994&repo=newdesign

Modified:
 /src/main/org/brailleblaster/wordprocessor/BBToolBar.java

=======================================
--- /src/main/org/brailleblaster/wordprocessor/BBToolBar.java Tue Jul 23 08:38:11 2013 +++ /src/main/org/brailleblaster/wordprocessor/BBToolBar.java Thu Jul 25 13:06:50 2013
@@ -29,6 +29,8 @@
 package org.brailleblaster.wordprocessor;

 import org.brailleblaster.BBIni;
+import org.brailleblaster.document.BBDocument;
+import org.brailleblaster.imagedescriber.ImageDescriber;
 import org.brailleblaster.localization.LocaleHandler;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -171,6 +173,38 @@
                                // dm.daisyPrint();
                        }
                });
+
+               ToolItem imageDesc = new ToolItem(toolBar, SWT.PUSH);
+               tlabel = lh.localValue("&Image Describer");
+               imageDesc.setText(tlabel.replace("&", ""));
+               imageDesc.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+
+                               // Current document.
+                               BBDocument curDoc = null;
+
+                               if (BBIni.debugging()) {
+                                       // dm.setReturn 
(WP.OpenDocumentGetFile);
+                               }
+                               else {
+                                       int index= 
wp.getFolder().getSelectionIndex();
+                                       if(index == -1){
+                                               wp.addDocumentManager(null);
+                                               curDoc = 
wp.getList().getFirst().document;
+                                       }
+                                       else {
+                                               curDoc = 
wp.getList().get(index).document;
+                                       }
+                               }
+
+                               // Run Image Describer on current document.
+                               if(curDoc.getDOM() != null) {
+                                       ImageDescriber imgDesc = new 
ImageDescriber(curDoc);
+                               }
+
+                       } // widgetSelected...
+
+               }); // addSelectionListener(new SelectionAdapter()...

                toolBar.pack();


Other related posts:

  • » [brailleblaster] [brailleblaster.newdesign] push by RandomCh...@xxxxxxxxx - Temp Toolbar button for ImageDescriber on 2013-07-25 19:00 GMT - brailleblaster