summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java
blob: 7ccd68c5607ac5dd0531614b530734f03def94ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
package gui.core;

import gui.GuiManager;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;


public class VMWareInfoComposite extends Composite {
	String title = "Hinweis VMWare Player";
	String infoText = "Für die Arbeit mit der bwLehrpool Suite wird zwingend ein VMWare Player benötigt. "
			+ "Diesen können Sie sich unter folgendem Link kostenfrei downloaden. "
			+ "Wenn Sie bereits den VMWare Player oder die VMWare Workstation installiert haben, können Sie diesen Hinweis ignorieren.";

	String checkboxText = "Ja, ich aktzeptiere die Vereinbarung. Benachrichtigung nicht mehr anzeigen.";

	String infoTitle = "bwLehrpool Suite";

	protected Button windowsDLButton;
	protected Button linuxDLButton;
	protected Button readCheck; 
	protected Button continueButton; 

	public VMWareInfoComposite(final Shell mainShell) {
		super(mainShell, SWT.NONE);

		// set the title of the bar.
		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(infoTitle);
		FontData fontData = titleLabel.getFont().getFontData()[0];
		Font font = new Font(GuiManager.getDisplay(), new FontData(fontData.getName(), fontData
				.getHeight(), SWT.BOLD));
		titleLabel.setFont(font);
		// TODO dispose of font?

		// infotext
		Label infoLabel = new Label(this, SWT.NONE | SWT.WRAP);
		infoLabel.setText(infoText);
		GridData gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
		infoLabel.setLayoutData(gridData);


		// composite for the windows vmware-download button
		Composite windowsComposite = new Composite(this, SWT.NONE);
		windowsComposite.setLayout(new GridLayout());
		gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
		windowsComposite.setLayoutData(gridData);

		new Label(windowsComposite, SWT.NONE).setText("Windows:");	
		windowsDLButton = new Button(windowsComposite, SWT.PUSH);
		windowsDLButton.setText("VMWare Player Herunterladen");


		// composite for the linux vmware-download button
		Composite linuxComposite = new Composite(this, SWT.NONE);
		linuxComposite.setLayout(new GridLayout());
		gridData = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
		linuxComposite.setLayoutData(gridData);

		new Label(windowsComposite, SWT.NONE).setText("Linux:");	
		linuxDLButton = new Button(windowsComposite, SWT.PUSH);
		linuxDLButton.setText("VMWare Player Herunterladen");



		readCheck = new Button(this, SWT.CHECK);
		readCheck.setText("Diese Benachrichtigung nicht mehr anzeigen.");
		gridData = new GridData(GridData.BEGINNING, GridData.END, false, false);
		readCheck.setLayoutData(gridData);

		continueButton = new Button(this, SWT.PUSH);
		continueButton.setText("Weiter");
		gridData = new GridData(GridData.BEGINNING, GridData.END, false, false);
		continueButton.setLayoutData(gridData);

		// TODO still looks very ugly

		// function for agreement checkbox
		continueButton.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				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()));
	}

}