summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java111
1 files changed, 0 insertions, 111 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
index 93d9d204..efc75236 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
@@ -9,19 +9,15 @@ import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
-import java.beans.Encoder;
-import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.List;
import javax.swing.AbstractAction;
-import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
@@ -29,12 +25,6 @@ import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.DefaultEditorKit;
-import javax.swing.text.StyledEditorKit;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.HTMLDocument;
-import javax.swing.text.html.HTMLEditorKit;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
@@ -228,101 +218,6 @@ import java.util.*;
}
});
- cbTxtSize.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- int size = Integer.parseInt((String) cbTxtSize.getSelectedItem());
- Action act = new StyledEditorKit.FontSizeAction(String.valueOf(size),size);
- act.actionPerformed(new ActionEvent(act,ActionEvent.ACTION_PERFORMED,
- (String)act.getValue(Action.ACTION_COMMAND_KEY)));
- }
- });
-
- cbTxtColor.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- String color = (String) cbTxtColor.getSelectedItem();
- Action act = null;
-
- switch(color) {
- case "Black":
- act = new StyledEditorKit.ForegroundAction("Black", Color.black);
- break;
- case "Blue":
- act = new StyledEditorKit.ForegroundAction("Blue", Color.blue);
- break;
- case "Yellow":
- act = new StyledEditorKit.ForegroundAction("Yellow", Color.yellow);
- break;
- case "Red":
- act = new StyledEditorKit.ForegroundAction("Red", Color.red);
- break;
- case "Green":
- act = new StyledEditorKit.ForegroundAction("Green", Color.green);
- break;
- }
-
- act.actionPerformed(new ActionEvent(act,ActionEvent.ACTION_PERFORMED,
- (String)act.getValue(Action.ACTION_COMMAND_KEY)));
- }
- });
-
- // change between html and Wysiwyg
- btnWysiwyg.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- String tmp = txtDescription.getText();
- if (txtDescription.getContentType().equals("text/html")) {
- txtDescription.setContentType("text/plain");
- txtDescription.setText(tmp);
- btnWysiwyg.setText("Wysiwyg");
- if(ImagePerms.canEdit(image) || ImagePerms.canAdmin(image)) {
- btnSaveChanges.setEnabled(true);
- }
-
- btnBold.setEnabled(false);
- btnUnderline.setEnabled(false);
- btnItalic.setEnabled(false);
- cbTxtColor.setEnabled(false);
- cbTxtSize.setEnabled(false);
- } else {
- txtDescription.setContentType("text/html");
- txtDescription.setText(tmp);
- btnWysiwyg.setText("Html");
-
- btnBold.setEnabled(true);
- btnUnderline.setEnabled(true);
- btnItalic.setEnabled(true);
- cbTxtColor.setEnabled(true);
- cbTxtSize.setEnabled(true);
- }
- }
- });
-
- // insertion of <br> in needed because textpane is not able to
- // to insert <br> when enter is pressed.
- txtDescription.addKeyListener(new KeyListener() {
- @Override
- public void keyPressed(KeyEvent e) {
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_ENTER && txtDescription.getContentType().equals("text/html")) {
- try {
- kit.insertHTML((HTMLDocument) txtDescription.getDocument(), txtDescription.getCaretPosition(), "<br>", 0, 0,
- HTML.Tag.BR);
- txtDescription.setCaretPosition(txtDescription.getCaretPosition()); // This moves caret to next line
- } catch (BadLocationException | IOException ex) {
- ex.printStackTrace();
- }
- }
- }
- });
tblVersions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
@@ -1026,12 +921,6 @@ import java.util.*;
editable = editable && (ImagePerms.canEdit(image) || ImagePerms.canAdmin(image));
txtTitle.setEditable(editable);
txtDescription.setEditable(editable);
- btnBold.setEnabled(editable);
- btnItalic.setEnabled(editable);
- btnUnderline.setEnabled(editable);
- btnWysiwyg.setEnabled(editable);
- cbTxtColor.setEnabled(editable);
- cbTxtSize.setEnabled(editable);
txtTags.setEditable(editable);
cboOperatingSystem.setEnabled(editable);
// cboShareMode.setEnabled(editable);