summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuersat Akmaz2020-10-16 23:58:46 +0200
committerKuersat Akmaz2020-10-16 23:58:46 +0200
commite4d03898f1cf6e7804a272e6a82a4a390c944b06 (patch)
tree97ce6da537ac989b56134171c93cb3eacb98d4bf
parent[server] Up the safety game even more: Don't delete if disjoint (diff)
downloadtutor-module-e4d03898f1cf6e7804a272e6a82a4a390c944b06.tar.gz
tutor-module-e4d03898f1cf6e7804a272e6a82a4a390c944b06.tar.xz
tutor-module-e4d03898f1cf6e7804a272e6a82a4a390c944b06.zip
[client] added small html editor in LectureDescriptonWindow
Issue : #3732
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java37
-rw-r--r--dozentenmodul/src/main/resources/img/bold.pngbin0 -> 11833 bytes
-rw-r--r--dozentenmodul/src/main/resources/img/italic.pngbin0 -> 4482 bytes
-rw-r--r--dozentenmodul/src/main/resources/img/underline.pngbin0 -> 5621 bytes
4 files changed, 33 insertions, 4 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 0dc3cee2..0f01fd61 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
@@ -7,13 +7,16 @@ import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.util.Calendar;
+import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
+import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
+import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
@@ -23,6 +26,7 @@ import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SpinnerDateModel;
import javax.swing.text.DateFormatter;
+import javax.swing.text.StyledEditorKit;
import org.jdatepicker.JDatePicker;
import org.openslx.bwlp.thrift.iface.ImageVersionDetails;
@@ -53,7 +57,7 @@ public abstract class LectureDetailsWindowLayout extends JDialog {
// stuff ending in '...Info' are supposed to be the read-only labels for the information tab
protected final QLabel lblTitleInfo;
protected final JTextField txtTitle;
- protected final JTextArea txtDescription;
+ protected final JEditorPane txtDescription;
protected final QLabel lblImageNameInfo;
protected final QLabel txtImageName;
protected final JButton btnLinkImage;
@@ -106,6 +110,11 @@ public abstract class LectureDetailsWindowLayout extends JDialog {
protected final JPanel pnlTabNetshare;
protected final JPanel pnlTabLdapFilter;
+ protected final JButton btnBold;
+ protected final JButton btnItalic;
+ protected final JButton btnUnderline;
+
+
public LectureDetailsWindowLayout(Frame modalParent) {
super(modalParent, "Veranstaltungsdetails", ModalityType.APPLICATION_MODAL);
setResizable(true);
@@ -174,10 +183,30 @@ public abstract class LectureDetailsWindowLayout extends JDialog {
grdGeneral.add(txtTitle, 4).expand(true, false).fill(true, false);
grdGeneral.nextRow();
+ // buttons for text editing
+ JPanel editingPanel = new JPanel();
+ editingPanel.setLayout(new GridLayout(1,3));
+ JPanel emptyPanel = new JPanel();
+ grdGeneral.add(emptyPanel);
+ btnBold = new JButton( new StyledEditorKit.BoldAction());
+ btnBold.setIcon(Gui.getScaledIconResource("/img/bold.png", "B", 24, this));
+ btnBold.setText("");
+ btnItalic = new JButton(new StyledEditorKit.ItalicAction() );
+ btnItalic.setIcon(Gui.getScaledIconResource("/img/italic.png", "B", 24, this));
+ btnItalic.setText("");
+ btnUnderline = new JButton(new StyledEditorKit.UnderlineAction() );
+ btnUnderline.setIcon(Gui.getScaledIconResource("/img/underline.png", "B", 24, this));
+ btnUnderline.setText("");
+ grdGeneral.add(btnBold);
+ grdGeneral.add(btnItalic);
+ grdGeneral.add(btnUnderline);
+ grdGeneral.add(editingPanel);
+
+ grdGeneral.nextRow();
+
// description
- txtDescription = new JTextArea();
- txtDescription.setLineWrap(true);
- txtDescription.setWrapStyleWord(true);
+ txtDescription = new JEditorPane();
+ txtDescription.setContentType("text/html");
grdGeneral.add(new QLabel("Beschreibung")).anchor(GridBagConstraints.FIRST_LINE_START);
JScrollPane jsp = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
diff --git a/dozentenmodul/src/main/resources/img/bold.png b/dozentenmodul/src/main/resources/img/bold.png
new file mode 100644
index 00000000..30baeaa7
--- /dev/null
+++ b/dozentenmodul/src/main/resources/img/bold.png
Binary files differ
diff --git a/dozentenmodul/src/main/resources/img/italic.png b/dozentenmodul/src/main/resources/img/italic.png
new file mode 100644
index 00000000..c7d6393d
--- /dev/null
+++ b/dozentenmodul/src/main/resources/img/italic.png
Binary files differ
diff --git a/dozentenmodul/src/main/resources/img/underline.png b/dozentenmodul/src/main/resources/img/underline.png
new file mode 100644
index 00000000..b049a9ad
--- /dev/null
+++ b/dozentenmodul/src/main/resources/img/underline.png
Binary files differ