提交 eab3cb46 编写于 作者: S Serge Rider

Information dialogs

上级 3e702440
......@@ -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
/*
* 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册