/******************************************************************************* * Copyright (c) 2012 Marco Descher. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Marco Descher - initial API and implementation ******************************************************************************/ package at.medevit.plugin.alpha.dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell; import at.medevit.icons.core.Icon; import at.medevit.icons.core.IconSize; public class FunTitleAreaDialog extends TitleAreaDialog { /** * Create the dialog. * @param parentShell */ public FunTitleAreaDialog(Shell parentShell) { super(parentShell); setTitleImage(Icon.DIALOG_FUN.getImage(IconSize._75x66_TitleDialogIconSize)); } /** * Create contents of the dialog. * @param parent */ @Override protected Control createDialogArea(Composite parent) { setMessage("Look at this face, this is a happy face!"); setTitle("Look at this face, this is a happy face!"); Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(GridData.FILL_BOTH)); return area; } /** * Create contents of the button bar. * @param parent */ @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } /** * Return the initial size of the dialog. */ @Override protected Point getInitialSize() { return new Point(450, 300); } }