summaryrefslogblamecommitdiffstats
path: root/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java
blob: aec2c9706068b73b62caf6bcec09e2d3d6d9cbaf (plain) (tree)





























































































                                                                                                                                                     
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.";

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

		// Set the title of the bar.
		mainShell.setText("bwLehrpool Suite");

		// Layout for this composite
		this.setLayout(new GridLayout(1, false));

		// Bold title at start.
		Label titleLabel = new Label(this, SWT.NONE);
		titleLabel.setText(_title);
		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 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:");	
		Button windowsDLButton = new Button(windowsComposite, SWT.PUSH);
		windowsDLButton.setText("VMWare Player Herunterladen");



		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:");	
		Button linuxDLButton = new Button(windowsComposite, SWT.PUSH);
		linuxDLButton.setText("VMWare Player Herunterladen");



		Button 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);

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

		// TODO finish

		// Function for agreement checkbox
		continuteButton.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				GuiManager.addContent(new MainWindowComposite(mainShell));
			}
		});
	}

}