summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
diff options
context:
space:
mode:
authorMürsel Türk2020-07-07 12:02:55 +0200
committerMürsel Türk2020-07-07 12:02:55 +0200
commitde374cea11032e8ea839ee349d7d68a68ffdea70 (patch)
treed30db205733d28004d2bdc7faa59f897e6f28460 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
parent[client] Add resource bundle files for activity classes. Update the activity ... (diff)
downloadtutor-module-de374cea11032e8ea839ee349d7d68a68ffdea70.tar.gz
tutor-module-de374cea11032e8ea839ee349d7d68a68ffdea70.tar.xz
tutor-module-de374cea11032e8ea839ee349d7d68a68ffdea70.zip
[client] Add resource bundle files for configurator classes. Update the configurator classes accordingly.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java54
1 files changed, 25 insertions, 29 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
index 77f2e381..95c45282 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java
@@ -38,6 +38,7 @@ import org.openslx.dozmod.gui.control.table.CheckListTable.Wrapper;
import org.openslx.dozmod.gui.control.table.NetshareTable;
import org.openslx.dozmod.gui.control.table.QScrollPane;
import org.openslx.dozmod.gui.helper.GridManager;
+import org.openslx.dozmod.gui.helper.I18n;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.thrift.cache.MetaDataCache;
import org.openslx.dozmod.util.FormatHelper;
@@ -79,7 +80,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
chkIsPrinter.setEnabled(editable);
chkShowPass.setEnabled(editable);
if (editable)
- btnAdd.setText("Ändern");
+ btnAdd.setText(I18n.CONFIGURATOR.getString("NetShare.Button.add.text.0"));
// clear the contents of the fields and return, if no share was selected.
if (item == null) {
@@ -145,7 +146,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
input.path = tfSharePath.getText();
if (input.path == null || input.path.isEmpty()) {
- lblError.setText("Kein Pfad angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noPath"));
return;
}
String inputShareName = tfShareName.getText();
@@ -156,7 +157,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
NetShareAuth inputNetShareAuth = cboNetshareAuth
.getItemAt(cboNetshareAuth.getSelectedIndex());
if (inputNetShareAuth == null) {
- lblError.setText("Kein Authentifizierungstyp angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noAuth"));
return;
}
input.auth = inputNetShareAuth;
@@ -170,7 +171,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
input.username = tfUsername.getText();
input.password = new String(tfPassword.getPassword());
if (input.username.isEmpty()) {
- lblError.setText("Kein Nutzername angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noUsername"));
return;
}
break;
@@ -179,7 +180,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
break;
}
if (input == null) {
- lblError.setText("Fehlerhafte Eingabe");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.incorrectInput"));
LOGGER.debug("Bad input, aborting.");
return;
}
@@ -189,7 +190,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
.getItemAt(cboNetshareMountPoint.getSelectedIndex());
if (!chkIsPrinter.isSelected()) {
if (inputMountPoint == null) {
- lblError.setText("Kein Laufwerk angegeben!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.noMountPoint"));
return;
}
input.mountpoint = String.valueOf(inputMountPoint);
@@ -201,10 +202,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// which we might want to implement one day...
if (input.password != null && !input.password.isEmpty()) {
if (!Gui.showMessageBox(
- "Das eingebene Passwort wird im Klartext gespeichert "
- + "und ist in der VM für jeden Nutzer sichtbar.\n"
- + "Verwenden Sie auf keinen Fall sicherheitskritische Passwörter!"
- + "\n\nMöchten Sie diesen Netzlaufwerk trotzdem hinzufügen?",
+ I18n.CONFIGURATOR.getString("NetShare.Message.yesNo.password"),
MessageType.QUESTION_YESNO, LOGGER, null)) {
return;
}
@@ -218,7 +216,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
if (oldEntry != null && oldList.contains(oldEntry)) {
// editing existing one, delete it from the internal data
if (!oldList.remove(oldEntry)) {
- lblError.setText("Änderung fehlgeschlagen!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.changeFailed"));
LOGGER.error("Failed to remove selected share for replacement: " + oldEntry);
return;
}
@@ -228,7 +226,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
// creating a new one, either way add it to the list and update
// the table, if its not present already
if (oldList.contains(newEntry)) {
- lblError.setText("Existiert bereits!");
+ lblError.setText(I18n.CONFIGURATOR.getString("NetShare.Label.error.alreadyExists"));
LOGGER.error("Network share already in the list, aborting.");
return;
}
@@ -287,7 +285,7 @@ public class NetshareConfigurator extends NetshareConfiguratorLayout {
cboNetshareMountPoint.setSelectedItem(null);
chkIsPrinter.setSelected(false);
chkShowPass.setSelected(false);
- btnAdd.setText("Hinzufügen");
+ btnAdd.setText(I18n.CONFIGURATOR.getString("NetShare.Button.add.text.1"));
}
public List<NetShare> getState() {
@@ -335,10 +333,6 @@ class NetshareConfiguratorLayout extends JPanel {
private static final long serialVersionUID = 6479525981542743622L;
- private final static String txtNetshareDesc = "<html>Hier können Sie Netzlaufwerke angeben,"
- + " die automatisch beim Start der Veranstaltung eingebunden werden sollen."
- + " Der Platzhalter <em>%loginuser%</em> wird im Pfad durch den Loginnamen des Nutzers ersetzt.</html>";
-
protected final JLabel lblError;
protected final NetshareTable tblNetshare = new NetshareTable();
protected final JTextField tfSharePath, tfShareName, tfUsername;
@@ -369,7 +363,8 @@ class NetshareConfiguratorLayout extends JPanel {
public NetshareConfiguratorLayout() {
GridManager grid = new GridManager(this, 3, true, new Insets(3, 3, 3, 3));
// top info panel
- grid.add(new JLabel(txtNetshareDesc), 3).fill(true, false).expand(true, false);
+ grid.add(new JLabel(I18n.CONFIGURATOR.getString("NetShare.Label.description.text")), 3)
+ .fill(true, false).expand(true, false);
grid.nextRow();
// middle netshare list
grid.add(new QScrollPane(tblNetshare), 3).fill(true, true).expand(true, true);
@@ -377,17 +372,18 @@ class NetshareConfiguratorLayout extends JPanel {
JPanel pnlNewShare = new JPanel();
GridManager gridNewShare = new GridManager(pnlNewShare, 6, true, new Insets(0, 3, 0, 3));
- pnlNewShare.setBorder(BorderFactory.createTitledBorder("Eigenes Netzlaufwerk definieren"));
+ pnlNewShare.setBorder(BorderFactory.createTitledBorder(
+ I18n.CONFIGURATOR.getString("NetShare.TitledBorder.newShare.title")));
JPanel pnlSharePath = new JPanel();
pnlSharePath.setLayout(new BoxLayout(pnlSharePath, BoxLayout.LINE_AXIS));
- gridNewShare.add(new QLabel("Pfad"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.sharePath.text")));
tfSharePath = new JTextField();
pnlSharePath.add(tfSharePath);
pnlSharePath.add(Box.createGlue());
pnlSharePath.add(Box.createHorizontalStrut(5));
- chkIsPrinter = new JCheckBox("Drucker");
+ chkIsPrinter = new JCheckBox(I18n.CONFIGURATOR.getString("NetShare.CheckBox.isPrinter.text"));
pnlSharePath.add(chkIsPrinter);
pnlSharePath.add(Box.createHorizontalStrut(5));
gridNewShare.add(pnlSharePath, 5).fill(true, false).expand(true, false);
@@ -399,30 +395,30 @@ class NetshareConfiguratorLayout extends JPanel {
pnlShareName.setLayout(new BoxLayout(pnlShareName, BoxLayout.LINE_AXIS));
pnlShareName.add(tfShareName);
pnlShareName.add(Box.createHorizontalStrut(3));
- pnlShareName.add(new QLabel("Laufwerk"));
+ pnlShareName.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.shareMountPoint.text")));
pnlShareName.add(Box.createHorizontalStrut(3));
pnlShareName.add(cboNetshareMountPoint);
- gridNewShare.add(new QLabel("Anzeigename"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.shareName.text")));
gridNewShare.add(pnlShareName, 5).fill(true, false).expand(true, false);
gridNewShare.nextRow();
- gridNewShare.add(new QLabel("Authentifizierung"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.shareAuth.text")));
gridNewShare.add(cboNetshareAuth, 5).fill(true, false).expand(true, false);
gridNewShare.nextRow();
- gridNewShare.add(new QLabel("Benutzername"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.username.text")));
tfUsername = new JTextField(20);
gridNewShare.add(tfUsername, 2).fill(true, false).expand(true, false);
- gridNewShare.add(new QLabel("Passwort"));
+ gridNewShare.add(new QLabel(I18n.CONFIGURATOR.getString("NetShare.Label.password.text")));
tfPassword = new JPasswordField(20);
gridNewShare.add(tfPassword, 2).fill(true, false).expand(true, false);
gridNewShare.nextRow();
- chkShowPass = new JCheckBox("Passwort anzeigen");
+ chkShowPass = new JCheckBox(I18n.CONFIGURATOR.getString("NetShare.CheckBox.showPassword.text"));
gridNewShare.add(Box.createGlue(), 5);
gridNewShare.add(chkShowPass).anchor(GridBagConstraints.EAST);
gridNewShare.nextRow();
grid.add(pnlNewShare, 3).fill(true, false).expand(true, false);
grid.nextRow();
- btnAdd = new JButton("Hinzufügen");
- btnDel = new JButton("Entfernen");
+ btnAdd = new JButton(I18n.CONFIGURATOR.getString("NetShare.Button.add.text.1"));
+ btnDel = new JButton(I18n.CONFIGURATOR.getString("NetShare.Button.delete.text"));
lblError = new QLabel("");
lblError.setForeground(Color.RED);
grid.add(lblError).fill(true, false).expand(true, false);