From ef289359d4e958f1e5bc4f67e633f8e73138c6ec Mon Sep 17 00:00:00 2001 From: Stephan Schwär Date: Fri, 23 Apr 2021 11:51:12 +0200 Subject: [client] Revert decription fields to JTextArea --- .../gui/window/layout/ImageDetailsWindowLayout.java | 9 +++++---- .../window/layout/LectureDetailsWindowLayout.java | 8 +++++--- .../gui/wizard/layout/ImageMetaDataPageLayout.java | 6 ++++-- .../gui/wizard/layout/LectureCreationPageLayout.java | 20 ++++++++++---------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java index f1a4d4c6..dfb6f751 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java @@ -8,12 +8,12 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDialog; -import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; +import javax.swing.JTextArea; import javax.swing.JTextField; import org.openslx.bwlp.thrift.iface.OperatingSystem; @@ -45,7 +45,7 @@ public abstract class ImageDetailsWindowLayout extends JDialog { // private final String TAB_PERMISSIONS_TITEL = I18n.WINDOW_LAYOUT.getString("ImageDetails.Tab.permissions.title"); protected final JTextField txtTitle; - protected final JEditorPane txtDescription; + protected final JTextArea txtDescription; protected QLabel lblError; protected final PersonLabel lblOwner; @@ -108,8 +108,9 @@ public abstract class ImageDetailsWindowLayout extends JDialog { grid.nextRow(); // description - txtDescription = new JEditorPane(); - + txtDescription = new JTextArea(3, 50); + txtDescription.setLineWrap(true); + txtDescription.setWrapStyleWord(true); grid.add(new QLabel(I18n.WINDOW_LAYOUT.getString("ImageDetails.Label.description.text"))).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/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureDetailsWindowLayout.java index 2b134ba0..3876e7fb 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 @@ -14,12 +14,12 @@ import javax.swing.BoxLayout; 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; import javax.swing.JSpinner; import javax.swing.JTabbedPane; +import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.SpinnerDateModel; import javax.swing.text.DateFormatter; @@ -56,7 +56,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 JEditorPane txtDescription; + protected final JTextArea txtDescription; protected final QLabel lblImageNameInfo; protected final QLabel txtImageName; protected final JButton btnLinkImage; @@ -181,7 +181,9 @@ public abstract class LectureDetailsWindowLayout extends JDialog { grdGeneral.nextRow(); // description - txtDescription = new JEditorPane(); + txtDescription = new JTextArea(); + txtDescription.setLineWrap(true); + txtDescription.setWrapStyleWord(true); grdGeneral.add(new QLabel(I18n.WINDOW_LAYOUT.getString("LectureDetails.Label.description.text"))).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/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java index f607e3da..48b88627 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java @@ -22,7 +22,7 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { protected final QLabel lblOperatingSystem; protected final JComboBox cboOperatingSystem; - protected final JEditorPane txtDescription; + protected final JTextArea txtDescription; protected final JTextArea startCommand; protected final QLabel sCommandCaption; protected final JScrollPane startCommandPane; @@ -69,7 +69,9 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { // description QLabel descriptionCaption = new QLabel( I18n.PAGE_LAYOUT.getString("ImageMetaData.Label.description.text")); - txtDescription = new JEditorPane(); + txtDescription = new JTextArea(3, 50); + txtDescription.setLineWrap(true); + txtDescription.setWrapStyleWord(true); txtDescription.setMinimumSize(Gui.getScaledDimension(0, 70)); JScrollPane descPane = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureCreationPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureCreationPageLayout.java index eee4f533..b7608f58 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureCreationPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/LectureCreationPageLayout.java @@ -4,11 +4,12 @@ import java.util.Calendar; import javax.swing.JScrollPane; import javax.swing.JSpinner; +import javax.swing.JTextArea; import javax.swing.JTextField; -import javax.swing.JEditorPane; import javax.swing.SpinnerDateModel; import javax.swing.text.DateFormatter; + import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.control.QDatePickerImpl; import org.openslx.dozmod.gui.control.QLabel; @@ -17,7 +18,6 @@ import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.WizardPage; -import java.awt.Dimension; public abstract class LectureCreationPageLayout extends WizardPage { @@ -27,7 +27,7 @@ public abstract class LectureCreationPageLayout extends WizardPage { private static final long serialVersionUID = 422592252404059239L; protected final JTextField txtName; - protected final JEditorPane txtDescription; + protected final JTextArea txtDescription; protected final QDatePickerImpl dtpStartDate; protected final QDatePickerImpl dtpEndDate; protected final JSpinner spnStartTime; @@ -51,14 +51,14 @@ public abstract class LectureCreationPageLayout extends WizardPage { grid.nextRow(); // description - txtDescription = new JEditorPane(); - txtDescription.setPreferredSize(new Dimension(600,800)); - JScrollPane descPane = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - txtDescription.setMinimumSize(Gui.getScaledDimension(0, 60)); - descPane.setMinimumSize(txtDescription.getMinimumSize()); + txtDescription = new JTextArea(3, 50); + txtDescription.setLineWrap(true); + txtDescription.setWrapStyleWord(true); + txtDescription.setMinimumSize(Gui.getScaledDimension(0, 70)); grid.add(new QLabel(I18n.PAGE_LAYOUT.getString("LectureCreation.Label.description.text"))); - grid.add(descPane, 2).fill(true, false).expand(true, false); + JScrollPane descPane = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + grid.add(descPane, 2).fill(true, true).expand(true, true); grid.nextRow(); // Start date/time -- cgit v1.2.3-55-g7522