summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dozentenmodul/src/main/java/gui/GuiManager.java2
-rw-r--r--dozentenmodul/src/main/java/gui/core/DisclaimerComposite.java28
-rw-r--r--dozentenmodul/src/main/java/gui/core/LoginComposite.java72
-rw-r--r--dozentenmodul/src/main/java/gui/core/MainWindowComposite.java28
-rw-r--r--dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java74
5 files changed, 162 insertions, 42 deletions
diff --git a/dozentenmodul/src/main/java/gui/GuiManager.java b/dozentenmodul/src/main/java/gui/GuiManager.java
index ae1c2038..ae97d90b 100644
--- a/dozentenmodul/src/main/java/gui/GuiManager.java
+++ b/dozentenmodul/src/main/java/gui/GuiManager.java
@@ -76,7 +76,7 @@ public abstract class GuiManager {
mainShell.setText("Dozmod");
mainShell.setMenuBar(menuBar);
-
+
// Set layout for the mainshell, items added to the shell should get a gridData
mainShell.setLayout(new GridLayout(1, true));
diff --git a/dozentenmodul/src/main/java/gui/core/DisclaimerComposite.java b/dozentenmodul/src/main/java/gui/core/DisclaimerComposite.java
index 2c268353..b8296295 100644
--- a/dozentenmodul/src/main/java/gui/core/DisclaimerComposite.java
+++ b/dozentenmodul/src/main/java/gui/core/DisclaimerComposite.java
@@ -31,11 +31,14 @@ public class DisclaimerComposite extends Composite {
String _checkboxText = "Ja, ich aktzeptiere die Vereinbarung. Benachrichtigung nicht mehr anzeigen.";
+ String title = "bwLehrpool Suite";
+ String noticeLabel = "Hinweis";
+
public DisclaimerComposite(final Shell mainShell) {
- super(mainShell, SWT.NO_BACKGROUND);
+ super(mainShell, SWT.NONE);
- mainShell.setText("bwLehrpool Suite");
+ mainShell.setText(title);
// layout of this composite
this.setLayout(new GridLayout(1, true));
@@ -46,7 +49,7 @@ public class DisclaimerComposite extends Composite {
noticeGroup.setLayout(new GridLayout());
GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
noticeGroup.setLayoutData(gridData);
- noticeGroup.setText("Hinweis");
+ noticeGroup.setText(noticeLabel);
Label noticeLabel = new Label(noticeGroup, SWT.NONE);
noticeLabel.setText(notice);
@@ -71,7 +74,7 @@ public class DisclaimerComposite extends Composite {
Button agreeBox = new Button(checkboxComposite, SWT.CHECK);
agreeBox.setText(_checkboxText);
-
+
final Button continueButton = new Button(this, SWT.PUSH);
continueButton.setText("Weiter");
continueButton.setEnabled(false);
@@ -93,10 +96,25 @@ public class DisclaimerComposite extends Composite {
continueButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- GuiManager.addContent(new VMWareInfoComposite(mainShell));
+ clickedContinueButton();
}
});
}
+ //
+ // logical functions for GUI
+ //
+
+
+ /**
+ * function for the continueButton
+ */
+ protected void clickedContinueButton() {
+ GuiManager.addContent(new VMWareInfoComposite(getShell()));
+ }
+
+
+
+
}
diff --git a/dozentenmodul/src/main/java/gui/core/LoginComposite.java b/dozentenmodul/src/main/java/gui/core/LoginComposite.java
index 8f74bf3c..5a387e8f 100644
--- a/dozentenmodul/src/main/java/gui/core/LoginComposite.java
+++ b/dozentenmodul/src/main/java/gui/core/LoginComposite.java
@@ -2,7 +2,6 @@ package gui.core;
import gui.GuiManager;
-import org.apache.thrift.TException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -17,29 +16,30 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.openslx.bwlp.thrift.iface.Organization;
-import org.openslx.thrifthelper.ThriftManager;
-
public class LoginComposite extends Composite {
private Image titleImage;
-
+
// textfield of the username
private Text usernameText;
-
+
// textfield of the password
private Text passwordText;
+
+ String title = "Dozmod - Login";
+ String authenticationGroupLabel = "Authentifizierungsart";
+
+
/**
* Create a new login composite
* @param mainShell The shell it should be added to
-
*/
public LoginComposite(final Shell mainShell) {
- super(mainShell, SWT.NO_BACKGROUND);
-
+ super(mainShell, SWT.NONE);
+
// title for composite
- mainShell.setText("Dozmod - Login");
+ mainShell.setText(title);
// left authentication selection and right loginmask
GridLayout gridLayout = new GridLayout(2, true);
@@ -58,7 +58,7 @@ public class LoginComposite extends Composite {
// group for the authentication method.
// groups have borders and a title
Group authGroup = new Group(this, SWT.NONE);
- authGroup.setText("Authentifizierungsart");
+ authGroup.setText(authenticationGroupLabel);
gridLayout = new GridLayout();
gridLayout.numColumns = 1;
authGroup.setLayout(gridLayout);
@@ -104,16 +104,7 @@ public class LoginComposite extends Composite {
final Combo idpCombo = new Combo(loginGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
idpCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- // entries in the combo
- try {
- for (Organization o : ThriftManager.getMasterClient().getOrganizations()) {
- idpCombo.add(o.displayName);
- }
- } catch (TException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
+ fillIdPCombo(idpCombo);
new Label(loginGroup, SWT.NONE).setText("Benutzername:");
@@ -128,14 +119,12 @@ public class LoginComposite extends Composite {
Button saveUsernameCheck = new Button(loginGroup, SWT.CHECK);
saveUsernameCheck.setText("Benutzername speichern");
+
// actions of the login button
loginButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- System.out.println("BAM!");
- GuiManager.addContent(new DisclaimerComposite(mainShell));
-
-
+ clickedLoginButton();
}
});
@@ -143,7 +132,7 @@ public class LoginComposite extends Composite {
saveUsernameCheck.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- System.out.println("Checkboxtoggle");
+ clickedSaveUsernameCheck();
}
});
@@ -162,7 +151,6 @@ public class LoginComposite extends Composite {
public void widgetSelected(SelectionEvent e) {
idpText.setVisible(false);
idpCombo.setVisible(false);
-
}
});
@@ -179,6 +167,35 @@ public class LoginComposite extends Composite {
+ //
+ // logical functions for GUI
+ //
+
+ /**
+ * function to execute when checking the saveUsername checkbox
+ */
+ protected void clickedSaveUsernameCheck() {
+ System.out.println("Checkboxtoggle");
+ }
+
+
+ /**
+ * function to execute when clicking the login button
+ */
+ protected void clickedLoginButton() {
+ GuiManager.addContent(new DisclaimerComposite(getShell()));
+ }
+
+
+ /**
+ * fill the idpCombo with idpCombo.add(String)
+ * @param idpCombo
+ */
+ protected void fillIdPCombo(Combo idpCombo) {
+ idpCombo.add("No Entries!");
+ }
+
+
private void loadImage(){
try {
titleImage = new Image(GuiManager.getDisplay(), getClass().getResourceAsStream("/img/Logo_bwLehrpool.png"));
@@ -191,5 +208,4 @@ public class LoginComposite extends Composite {
}
}
-
}
diff --git a/dozentenmodul/src/main/java/gui/core/MainWindowComposite.java b/dozentenmodul/src/main/java/gui/core/MainWindowComposite.java
index 49132751..278e420e 100644
--- a/dozentenmodul/src/main/java/gui/core/MainWindowComposite.java
+++ b/dozentenmodul/src/main/java/gui/core/MainWindowComposite.java
@@ -17,12 +17,12 @@ import org.eclipse.swt.widgets.Shell;
public class MainWindowComposite extends Composite {
// text for info for the vms selection
String vmInfo = "Infotext VMs.";
-
+
// text for the info for the lecture selection
String lecturesInfo = "Infotext Veranstaltungen.";
public MainWindowComposite(final Shell mainShell) {
- super(mainShell, SWT.NO_BACKGROUND);
+ super(mainShell, SWT.NONE);
this.setLayout(new GridLayout(2, true));
@@ -69,7 +69,7 @@ public class MainWindowComposite extends Composite {
vmButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- System.out.println("VM-Button clicked!");
+ clickedVMButton();
}
});
@@ -77,9 +77,29 @@ public class MainWindowComposite extends Composite {
lecturesButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- System.out.println("lecturesButton clicked!");
+ clickedLecturesButton();
}
});
}
+
+
+
+ //
+ // logical functions for GUI
+ //
+
+ /**
+ * function for the VMButton
+ */
+ protected void clickedVMButton() {
+ System.out.println("VM-Button clicked!");
+ }
+
+ /**
+ * function for the lecturesButton
+ */
+ protected void clickedLecturesButton() {
+ System.out.println("lecturesButton clicked!");
+ }
}
diff --git a/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java b/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java
index 3737817f..594634f8 100644
--- a/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java
+++ b/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java
@@ -23,18 +23,20 @@ public class VMWareInfoComposite extends Composite {
String checkboxText = "Ja, ich aktzeptiere die Vereinbarung. Benachrichtigung nicht mehr anzeigen.";
+ String infoTitle = "bwLehrpool Suite";
+
public VMWareInfoComposite(final Shell mainShell) {
- super(mainShell, SWT.NO_BACKGROUND);
+ super(mainShell, SWT.NONE);
// set the title of the bar.
- mainShell.setText("bwLehrpool Suite");
+ mainShell.setText(title);
// layout for this composite
this.setLayout(new GridLayout(1, false));
// bold title at start.
Label titleLabel = new Label(this, SWT.NONE);
- titleLabel.setText(title);
+ titleLabel.setText(infoTitle);
FontData fontData = titleLabel.getFont().getFontData()[0];
Font font = new Font(GuiManager.getDisplay(), new FontData(fontData.getName(), fontData
.getHeight(), SWT.BOLD));
@@ -87,9 +89,73 @@ public class VMWareInfoComposite extends Composite {
continuteButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- GuiManager.addContent(new MainWindowComposite(mainShell));
+ clickedContinueButton();
}
});
+
+ // actions of the login button
+ linuxDLButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ clickedLinuxDLButton();
+
+ }
+ });
+
+ // actions of the login button
+ windowsDLButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ clickedWindowsDLButton();
+
+ }
+ });
+
+ // actions of the login button
+ readCheck.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ clickedReadCheckButton();
+
+ }
+ });
+ }
+
+
+ //
+ // logical functions for GUI
+ //
+
+
+ /**
+ * function for the readCheckbox
+ */
+ protected void clickedReadCheckButton() {
+ // TODO Auto-generated method stub
+ }
+
+
+ /**
+ * function for the windowsDLButton
+ */
+ protected void clickedWindowsDLButton() {
+ // TODO Auto-generated method stub
+ }
+
+
+ /**
+ * function for the linuxDLButton
+ */
+ protected void clickedLinuxDLButton() {
+ // TODO Auto-generated method stub
+ }
+
+
+ /**
+ * function for the continueButton
+ */
+ protected void clickedContinueButton() {
+ GuiManager.addContent(new MainWindowComposite(this.getShell()));
}
} \ No newline at end of file