[Libreoffice-commits] core.git: scripting/java

nadith nadmalinda at gmail.com
Sun Oct 16 12:46:35 UTC 2016


 scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java |   15 ++++++----
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 71901bfedd9f0f6f31be8a9ff54253d56c10b5f3
Author: nadith <nadmalinda at gmail.com>
Date:   Fri Oct 14 08:06:10 2016 +0530

    tdf#98004 - Enhansment on Editor(Beanshell)
    
    Add a toolbar A little enhasment for the editor has been done.
    Added a toolbar for set of buttons that was previously in a JPanel
    and now it is in Jtoolbar in the editor
    
    Change-Id: Ie04232e7824c051f272d69cc109eec0e70ccf921
    Reviewed-on: https://gerrit.libreoffice.org/29806
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>

diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index 9c1f583..87553b7 100644
--- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -46,6 +46,9 @@ import javax.swing.JFrame;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 
+import javax.swing.JToolBar;
+import javax.swing.BorderFactory;
+
 public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener {
 
     private JFrame frame;
@@ -271,21 +274,21 @@ public class ScriptEditorForBeanShell implements ScriptEditor, ActionListener {
         );
 
         String[] labels = {"Run", "Clear", "Save", "Close","Undo","Redo"};
-        JPanel p = new JPanel();
-        p.setLayout(new FlowLayout());
-
+        JToolBar toolbar = new JToolBar();
+        toolbar.setRollover(true);
         for (String label : labels) {
             JButton b = new JButton(label);
+            b.setToolTipText(label);
             b.addActionListener(this);
-            p.add(b);
-
+            toolbar.add(b);
+            toolbar.addSeparator();
             if (label.equals("Save") && filename == null) {
                 b.setEnabled(false);
             }
         }
 
         frame.getContentPane().add((JComponent)view, BorderLayout.CENTER);
-        frame.add(p, BorderLayout.NORTH);
+        frame.add(toolbar, BorderLayout.NORTH);
         frame.pack();
         frame.setSize(590, 480);
         frame.setLocation(300, 200);


More information about the Libreoffice-commits mailing list