package org.openslx.dozmod.gui.window.layout;
import java.awt.Button;
import java.awt.Composite;
import java.awt.GridLayout;
import java.awt.Label;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import org.openslx.dozmod.gui.Gui;
public abstract class VirtualizerNoticeWindowLayout extends JDialog {
private static final String title = "Hinweis VMWare Player";
private static 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 JButton windowsDLButton;
protected JButton linuxDLButton;
protected JButton readCheck;
protected JButton continueButton;
public VirtualizerNoticeWindowLayout(boolean modal) {
super(null, title, modal ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);
// layout for this composite
this.setLayout(new GridLayout(1, false));
GridData gd = new GridData();
gd.widthHint = 500;
this.setLayoutData(gd);
// bold title at start.
JLabel titleLabel = new JLabel(this, SWT.NONE);
titleLabel.setText(infoTitle);
JFontData fontData = titleLabel.getFont().getFontData()[0];
final JFont font = new JFont(Gui.display, new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD));
titleLabel.setFont(font);
// infotext
JLabel infoLabel = new JLabel(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();
}
});
}
}