diff options
author | Kuersat Akmaz | 2020-11-30 22:14:07 +0100 |
---|---|---|
committer | Kuersat Akmaz | 2020-11-30 22:14:07 +0100 |
commit | 2176ce2893fc40284aaa70978324aebc5ba19e50 (patch) | |
tree | a23c5042a651914e1637b5911392f43d880b7ecc /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java | |
parent | [client] added fixed htmleditor to imagedetailswindow (diff) | |
download | tutor-module-2176ce2893fc40284aaa70978324aebc5ba19e50.tar.gz tutor-module-2176ce2893fc40284aaa70978324aebc5ba19e50.tar.xz tutor-module-2176ce2893fc40284aaa70978324aebc5ba19e50.zip |
[client] fixed htmleditor in LectureDetailsWindown
Issue : #3732
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java | 56 |
1 files changed, 45 insertions, 11 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java index 0f01fd61..113502d8 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java @@ -2,12 +2,14 @@ package org.openslx.dozmod.gui.window.layout; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Dimension; import java.awt.Font; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.Insets; import java.util.Calendar; import java.awt.GridLayout; +import java.awt.FlowLayout; import javax.swing.BorderFactory; import javax.swing.Box; @@ -15,6 +17,7 @@ import javax.swing.BoxLayout; import javax.swing.GroupLayout; import javax.swing.JButton; import javax.swing.JCheckBox; +import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JFrame; @@ -27,6 +30,7 @@ import javax.swing.JTextField; import javax.swing.SpinnerDateModel; import javax.swing.text.DateFormatter; import javax.swing.text.StyledEditorKit; +import javax.swing.text.html.HTMLEditorKit; import org.jdatepicker.JDatePicker; import org.openslx.bwlp.thrift.iface.ImageVersionDetails; @@ -113,6 +117,11 @@ public abstract class LectureDetailsWindowLayout extends JDialog { protected final JButton btnBold; protected final JButton btnItalic; protected final JButton btnUnderline; + protected final JButton btnWysiwyg; + + protected final JComboBox cbTxtSize; + protected final JComboBox cbTxtColor; + protected final HTMLEditorKit kit; public LectureDetailsWindowLayout(Frame modalParent) { @@ -185,27 +194,51 @@ public abstract class LectureDetailsWindowLayout extends JDialog { // buttons for text editing JPanel editingPanel = new JPanel(); - editingPanel.setLayout(new GridLayout(1,3)); + + editingPanel.setLayout(new FlowLayout(FlowLayout.LEADING)); JPanel emptyPanel = new JPanel(); grdGeneral.add(emptyPanel); - btnBold = new JButton( new StyledEditorKit.BoldAction()); - btnBold.setIcon(Gui.getScaledIconResource("/img/bold.png", "B", 24, this)); + btnBold = new JButton(new StyledEditorKit.BoldAction()); + btnBold.setIcon(Gui.getScaledIconResource("/img/bold.png", "B", 15, this)); btnBold.setText(""); - btnItalic = new JButton(new StyledEditorKit.ItalicAction() ); - btnItalic.setIcon(Gui.getScaledIconResource("/img/italic.png", "B", 24, this)); + btnItalic = new JButton(new StyledEditorKit.ItalicAction()); + btnItalic.setIcon(Gui.getScaledIconResource("/img/italic.png", "B", 15, this)); btnItalic.setText(""); - btnUnderline = new JButton(new StyledEditorKit.UnderlineAction() ); - btnUnderline.setIcon(Gui.getScaledIconResource("/img/underline.png", "B", 24, this)); + btnUnderline = new JButton(new StyledEditorKit.UnderlineAction()); + btnUnderline.setIcon(Gui.getScaledIconResource("/img/underline.png", "B", 15, this)); btnUnderline.setText(""); - grdGeneral.add(btnBold); - grdGeneral.add(btnItalic); - grdGeneral.add(btnUnderline); + editingPanel.add(btnBold); + editingPanel.add(btnItalic); + editingPanel.add(btnUnderline); + + String[] textsizes = {"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29"}; + cbTxtSize = new JComboBox<>(textsizes); + cbTxtSize.setPreferredSize(new Dimension(65,25)); + editingPanel.add(cbTxtSize); + + Object[] colors = {"Black", "Blue", "Red", "Yellow", "Green"}; + cbTxtColor = new JComboBox<>(colors); + cbTxtColor.setPreferredSize(new Dimension(100,25)); + editingPanel.add(cbTxtColor); + grdGeneral.add(editingPanel); - + + + emptyPanel.setLayout(new FlowLayout()); + btnWysiwyg = new JButton("HTML"); + btnWysiwyg.setPreferredSize(new Dimension(100,25)); + emptyPanel.add(btnWysiwyg); + + grdGeneral.add(emptyPanel); + grdGeneral.add(new JPanel()); + grdGeneral.add(new JPanel()); + grdGeneral.nextRow(); // description txtDescription = new JEditorPane(); + kit = new HTMLEditorKit(); + txtDescription.setEditorKit(kit); txtDescription.setContentType("text/html"); grdGeneral.add(new QLabel("Beschreibung")).anchor(GridBagConstraints.FIRST_LINE_START); JScrollPane jsp = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, @@ -215,6 +248,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog { grdGeneral.add(jsp, 4).expand(true, true).fill(true, true); grdGeneral.nextRow(); + // ID. NOTE: currently disabled txtId = new JTextField(); txtId.setEditable(false); |