summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornadith <nadmalinda@gmail.com>2016-10-14 08:06:10 +0530
committerjan iversen <jani@documentfoundation.org>2016-10-16 12:46:15 +0000
commit71901bfedd9f0f6f31be8a9ff54253d56c10b5f3 (patch)
tree1777ded90f70493a122e709cad2fd635d2c8e42b
parent6d4dd15ee2fa3206988c0facbf47c1a9ab527f30 (diff)
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@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
-rw-r--r--scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java15
1 files changed, 9 insertions, 6 deletions
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 9c1f583a4317..87553b7faaf0 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);