summaryrefslogblamecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/VirtualizerNoticeWindowLayout.java
blob: dab012d379d084ae24541da0b995bf6a6e977372 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
                                             

                           

                                              







                                         
                                  
 
                                                                       

                                                                                                                              


                                                                                                                                                     
                                                            
 

                                         

                                        
 
                                                                     
                                           
 
                                            
                                         
 
                                            
                                                         


                                             
 
                                       
                                                             
                                              
                                                                          
                                                                                                                          
                                         
 
                           
                                                                       
                                            
                                                                                                      
 
                                                                   

                                                                           
                                                                                                             
 
                                                                          
                                                                         

                                                                       
                                                                 

                                                                         
                                                                                                           
 
                                                                        
                                                                       

                                                                     
                                                        
                                                                                 
                                                                                                      
 

                                                            
                                                                                                           
 







                                                                    
         

 
 
package org.openslx.dozmod.gui.window.layout;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
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;
import org.openslx.dozmod.gui.Gui;

public abstract class VirtualizerNoticeWindowLayout extends Composite {
	private final String title = "Hinweis VMWare Player";
	private final 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.";

	private final String infoTitle = "bwLehrpool Suite";

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

	public VirtualizerNoticeWindowLayout(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));
		GridData gd = new GridData();
		gd.widthHint = 500;
		this.setLayoutData(gd);

		// bold title at start.
		Label titleLabel = new Label(this, SWT.NONE);
		titleLabel.setText(infoTitle);
		FontData fontData = titleLabel.getFont().getFontData()[0];
		final Font font = new Font(Gui.display, new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD));
		titleLabel.setFont(font);

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

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

		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());
		linuxComposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));

		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.");
		readCheck.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false));

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

		// Dispose of stuff we allocated
		this.addDisposeListener(new DisposeListener() {
			@Override
			public void widgetDisposed(DisposeEvent e) {
				font.dispose();
			}
		});

	}


}