1 /*******************************************************************************
2 * Copyright (c) 2013 hangum.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser Public License v2.1
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9 * hangum - initial API and implementation
10 ******************************************************************************/
11 package com
.hangum
.tadpole
.application
.start
.dialog
.about
;
13 import org
.eclipse
.jface
.dialogs
.Dialog
;
14 import org
.eclipse
.jface
.dialogs
.IDialogConstants
;
15 import org
.eclipse
.rap
.rwt
.RWT
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.graphics
.Point
;
18 import org
.eclipse
.swt
.layout
.GridData
;
19 import org
.eclipse
.swt
.layout
.GridLayout
;
20 import org
.eclipse
.swt
.widgets
.Composite
;
21 import org
.eclipse
.swt
.widgets
.Control
;
22 import org
.eclipse
.swt
.widgets
.Label
;
23 import org
.eclipse
.swt
.widgets
.Shell
;
24 import org
.eclipse
.swt
.widgets
.Text
;
26 import com
.hangum
.tadpole
.application
.start
.BrowserActivator
;
27 import com
.hangum
.tadpole
.application
.start
.Messages
;
28 import com
.hangum
.tadpole
.commons
.libs
.core
.define
.SystemDefine
;
29 import com
.hangum
.tadpole
.commons
.libs
.core
.message
.CommonMessages
;
30 import com
.hangum
.tadpole
.commons
.libs
.core
.utils
.LicenseValidator
;
31 import com
.hangum
.tadpole
.commons
.util
.GlobalImageUtils
;
32 import com
.swtdesigner
.ResourceManager
;
40 public class AboutDialog
extends Dialog
{
46 public AboutDialog(Shell parentShell
) {
52 public void configureShell(Shell newShell
) {
53 super.configureShell(newShell
);
54 newShell
.setText(Messages
.get().AboutDialog_0
);
55 newShell
.setImage(GlobalImageUtils
.getTadpoleIcon());
59 * Create contents of the dialog.
63 protected Control
createDialogArea(Composite parent
) {
64 Composite container
= (Composite
) super.createDialogArea(parent
);
65 GridLayout gridLayout
= (GridLayout
) container
.getLayout();
66 gridLayout
.verticalSpacing
= 5;
67 gridLayout
.horizontalSpacing
= 5;
68 gridLayout
.marginHeight
= 5;
69 gridLayout
.marginWidth
= 5;
70 gridLayout
.numColumns
= 2;
72 Composite composite
= new Composite(container
, SWT
.NONE
);
73 composite
.setLayout(new GridLayout(1, false));
74 composite
.setLayoutData(new GridData(SWT
.LEFT
, SWT
.TOP
, false, false, 1, 1));
76 Label lblNewLabelImage
= new Label(composite
, SWT
.NONE
);
77 GridData gd_lblNewLabelImage
= new GridData(SWT
.LEFT
, SWT
.CENTER
, false, false, 1, 1);
78 gd_lblNewLabelImage
.heightHint
= 199;
79 gd_lblNewLabelImage
.widthHint
= 150;
80 gd_lblNewLabelImage
.minimumHeight
= 184;
81 gd_lblNewLabelImage
.minimumWidth
= 300;
82 lblNewLabelImage
.setLayoutData(gd_lblNewLabelImage
);
83 lblNewLabelImage
.setImage(ResourceManager
.getPluginImage(BrowserActivator
.ID
, "resources/icons/TadpoleForDBTools.png")); //$NON-NLS-1$
85 Composite composite_1
= new Composite(container
, SWT
.NONE
);
86 composite_1
.setLayout(new GridLayout(1, false));
87 composite_1
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, true, 1, 1));
90 Text txtProductName
= new Text(composite_1
, SWT
.NONE
);
91 txtProductName
.setText(LicenseValidator
.getCustomerInfo());
92 txtProductName
.setEditable(false);
95 /* Software Version */
96 Text txtVersion
= new Text(composite_1
, SWT
.NONE
) ;
97 txtVersion
.setText(CommonMessages
.get().Version
+ ": " + SystemDefine
.getDBHubSystemInfo());
98 txtVersion
.setEditable(false);
102 if(LicenseValidator
.isEnterprise()) {
103 Text txtLicenseType
= new Text(composite_1
, SWT
.NONE
);
104 txtLicenseType
.setText(CommonMessages
.get().Customer
+ ": " + LicenseValidator
.getLicense().getCustomer());
106 Text txtActivationDate
= new Text(composite_1
, SWT
.NONE
);
107 txtActivationDate
.setText(CommonMessages
.get().ActivationDate
+ ": " + LicenseValidator
.getActivationDate());
109 Text txtExpirationDate
= new Text(composite_1
, SWT
.NONE
);
110 txtExpirationDate
.setText(CommonMessages
.get().ExpirationDate
+ ": " + LicenseValidator
.getExpirationDate());
112 Text txtAccountCount
= new Text(composite_1
, SWT
.NONE
);
113 txtAccountCount
.setText(CommonMessages
.get().NumberOfUsers
+ ": " + LicenseValidator
.getLicense().getPersonLimit());
115 Text txtRemaining
= new Text(composite_1
, SWT
.NONE
);
116 if(LicenseValidator
.getRemaining() < 0) {
117 txtRemaining
.setText(CommonMessages
.get().Remaining
+ ": Expired");
119 txtRemaining
.setText(CommonMessages
.get().Remaining
+ ": " + LicenseValidator
.getRemaining() + " " + CommonMessages
.get().Days
);
123 Text txtLicenseType
= new Text(composite_1
, SWT
.NONE
);
124 txtLicenseType
.setText("License Type: " + CommonMessages
.get().OpensourceLicense
);
126 Text txtActivationDate
= new Text(composite_1
, SWT
.NONE
);
127 txtActivationDate
.setText(CommonMessages
.get().ActivationDate
+ ": -");
129 Text txtExpirationDate
= new Text(composite_1
, SWT
.NONE
);
130 txtExpirationDate
.setText(CommonMessages
.get().ExpirationDate
+ ": -");
132 Text txtRemaining
= new Text(composite_1
, SWT
.NONE
);
133 txtRemaining
.setText(CommonMessages
.get().Remaining
+ ": Unlimited");
137 new Label(composite_1
, SWT
.NONE
);
139 Label lblNewLabelUseLicense
= new Label(composite_1
, SWT
.NONE
);
140 lblNewLabelUseLicense
.setData( RWT
.MARKUP_ENABLED
, Boolean
.TRUE
);
141 lblNewLabelUseLicense
.setText(Messages
.get().UseLicense
);
143 Label lblNewLabel4
= new Label(composite_1
, SWT
.NONE
);
144 lblNewLabel4
.setData( RWT
.MARKUP_ENABLED
, Boolean
.TRUE
);
145 lblNewLabel4
.setText(CommonMessages
.get().ThankYouForUsingTadpoleDBHub
);
147 Label lblCompanyInfo
= new Label(composite_1
, SWT
.NONE
);
148 lblCompanyInfo
.setLayoutData(new GridData(SWT
.LEFT
, SWT
.LEFT
, true, false, 1, 1));
149 lblCompanyInfo
.setText(CommonMessages
.get().CompanyInfo
);
151 Label lblNewLabel0
= new Label(composite_1
, SWT
.NONE
);
152 lblNewLabel0
.setData( RWT
.MARKUP_ENABLED
, Boolean
.TRUE
);
153 lblNewLabel0
.setText(CommonMessages
.get().TadpoleHubWebsite
+ " " + CommonMessages
.get().EmailCustomerSupport
);
155 // Label lblNewLabel2 = new Label(composite_1, SWT.NONE);
156 // lblNewLabel2.setData( RWT.MARKUP_ENABLED, Boolean.TRUE );
157 // lblNewLabel2.setText(CommonMessages.get().TadpoleHubWebsite);
163 * Create contents of the button bar.
167 protected void createButtonsForButtonBar(Composite parent
) {
168 createButton(parent
, IDialogConstants
.OK_ID
, CommonMessages
.get().Close
, true);
172 * Return the initial size of the dialog.
175 protected Point
getInitialSize() {
176 return new Point(635, 400);