diff --git a/plugins/org.jkiss.dbeaver.core.application/src/org/jkiss/dbeaver/core/application/about/AboutBoxDialog.java b/plugins/org.jkiss.dbeaver.core.application/src/org/jkiss/dbeaver/core/application/about/AboutBoxDialog.java index a3b60dce762b5397e605aed6bb5f328786f59bd1..ad3aae213923d10fbed2d60e0e0240593ea95042 100644 --- a/plugins/org.jkiss.dbeaver.core.application/src/org/jkiss/dbeaver/core/application/about/AboutBoxDialog.java +++ b/plugins/org.jkiss.dbeaver.core.application/src/org/jkiss/dbeaver/core/application/about/AboutBoxDialog.java @@ -19,8 +19,6 @@ package org.jkiss.dbeaver.core.application.about; import org.eclipse.core.runtime.IProduct; import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.resource.JFaceColors; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.BusyIndicator; @@ -42,11 +40,12 @@ import org.jkiss.dbeaver.core.CoreMessages; import org.jkiss.dbeaver.core.DBeaverCore; import org.jkiss.dbeaver.core.application.DBeaverApplication; import org.jkiss.dbeaver.ui.UIUtils; +import org.jkiss.dbeaver.ui.dialogs.InformationDialog; /** * About box */ -public class AboutBoxDialog extends Dialog +public class AboutBoxDialog extends InformationDialog { public static final String PRODUCT_PROP_SUB_TITLE = "subTitle"; //$NON-NLS-1$ public static final String PRODUCT_PROP_COPYRIGHT = "copyright"; //$NON-NLS-1$ @@ -63,6 +62,11 @@ public class AboutBoxDialog extends Dialog TITLE_FONT = new Font(shell.getDisplay(), CoreMessages.dialog_about_font, 10, SWT.NORMAL); } + @Override + protected boolean isBanner() { + return true; + } + @Override public boolean close() { NAME_FONT.dispose(); @@ -189,18 +193,4 @@ public class AboutBoxDialog extends Dialog return parent; } - @Override - protected void createButtonsForButtonBar(Composite parent) { - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalAlignment = GridData.CENTER; - parent.setLayoutData(gd); - parent.setBackground(JFaceColors.getBannerBackground(parent.getDisplay())); - Button button = createButton( - parent, - IDialogConstants.OK_ID, - IDialogConstants.OK_LABEL, - true); - button.setFocus(); - } - } \ No newline at end of file diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/InformationDialog.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/InformationDialog.java new file mode 100644 index 0000000000000000000000000000000000000000..e0021d06ecd7f85f7946f94f110ca6c726b680dd --- /dev/null +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/InformationDialog.java @@ -0,0 +1,63 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2016 Serge Rieder (serge@jkiss.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License (version 2) + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.jkiss.dbeaver.ui.dialogs; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.resource.JFaceColors; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; + +/** + * Information dialog (empty with OK button on the center) + */ +public class InformationDialog extends Dialog +{ + public InformationDialog(Shell shell) + { + super(shell); + } + + @Override + protected boolean isResizable() + { + return true; + } + + protected boolean isBanner() { + return false; + } + @Override + protected void createButtonsForButtonBar(Composite parent) { + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalAlignment = GridData.CENTER; + parent.setLayoutData(gd); + if (isBanner()) { + parent.setBackground(JFaceColors.getBannerBackground(parent.getDisplay())); + } + Button button = createButton( + parent, + IDialogConstants.OK_ID, + IDialogConstants.OK_LABEL, + true); + button.setFocus(); + } + +} \ No newline at end of file