summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java45
1 files changed, 37 insertions, 8 deletions
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 358fdd0d..a0104ade 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
@@ -2,9 +2,15 @@ package org.openslx.dozmod.gui.wizard.layout;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
+import javax.swing.JButton;
+import javax.swing.text.StyledEditorKit;
+import java.awt.Dimension;
+import java.awt.GridLayout;
import org.openslx.bwlp.thrift.iface.OperatingSystem;
import org.openslx.dozmod.gui.Gui;
import org.openslx.dozmod.gui.control.ComboBox;
@@ -19,13 +25,17 @@ import org.openslx.thrifthelper.Comparators;
public abstract class ImageMetaDataPageLayout extends WizardPage {
protected final JComboBox<OperatingSystem> cboOperatingSystem;
- protected final JTextArea txtDescription;
+ protected final JEditorPane txtDescription;
protected final JTextArea startCommand;
protected final QLabel sCommandCaption;
protected final JScrollPane startCommandPane;
protected final JCheckBox chkLicenseRestricted;
protected final JCheckBox chkIsTemplate;
+ protected final JButton btnBold;
+ protected final JButton btnItalic;
+ protected final JButton btnUnderline;
+
/**
* wizard page for entering image data at creating or editing an image
*
@@ -62,16 +72,35 @@ public abstract class ImageMetaDataPageLayout extends WizardPage {
grid.add(startCommandPane).fill(true, false).expand(true, false);
grid.nextRow();
+ // buttons for text editing
+ JPanel editingPanel = new JPanel();
+ editingPanel.setLayout(new GridLayout(1, 3));
+ JPanel emptyPanel = new JPanel();
+ grid.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("");
+ editingPanel.add(btnBold);
+ editingPanel.add(btnItalic);
+ editingPanel.add(btnUnderline);
+ grid.add(editingPanel);
+
+ grid.nextRow();
+
+ // description
QLabel descriptionCaption = new QLabel("Beschreibung");
- txtDescription = new JTextArea(5, 50);
- txtDescription.setMinimumSize(Gui.getScaledDimension(0, 70));
- txtDescription.setLineWrap(true);
- txtDescription.setWrapStyleWord(true);
- JScrollPane descPane = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+ txtDescription = new JEditorPane();
+ txtDescription.setContentType("text/html");
+ JScrollPane descPane = new JScrollPane(txtDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- descPane.setMinimumSize(txtDescription.getMinimumSize());
grid.add(descriptionCaption);
- grid.add(descPane).fill(true, false).expand(true, false);
+ grid.add(descPane).fill(true, true).expand(true, true);
grid.nextRow();
chkLicenseRestricted = new JCheckBox("VM enthält lizenzpflichtige Software");