package org.openslx.dozmod.gui.window.layout;
import org.eclipse.swt.SWT;
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));
// bold title at start.
Label titleLabel = new Label(this, SWT.NONE);
titleLabel.setText(infoTitle);
FontData fontData = titleLabel.getFont().getFontData()[0];
Font font = new Font(Gui.display, 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);
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));
}
}