summaryrefslogblamecommitdiffstats
path: root/dozentenmodul/src/main/java/gui/core/VMWareInfoComposite.java
blob: 3737817fd442a86215082711796245a0c385fee3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                    

                                                                                                                


                                                                                                                                                     
                                                                                                            



                                                           
                                            

                                                      
                                            

                                                         
                                       
                                                             
                                          



                                                                                                       
                                        
 
                           
                                                                       
                                            



                                                                                                 
                                                                   









                                                                                        
                                                                 




















                                                                                        
                                             
 
                                                  








                                                                                          
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 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:");	
		Button 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:");	
		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 still looks very ugly

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

}