1 /*******************************************************************************
2 * Copyright (c) 2016 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
.action
;
13 import org
.eclipse
.jface
.action
.Action
;
14 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
15 import org
.eclipse
.ui
.IWorkbenchWindow
;
17 import com
.hangum
.tadpole
.application
.start
.BrowserActivator
;
18 import com
.hangum
.tadpole
.application
.start
.Messages
;
19 import com
.hangum
.tadpole
.application
.start
.update
.checker
.NewVersionChecker
;
20 import com
.hangum
.tadpole
.application
.start
.update
.checker
.NewVersionObject
;
21 import com
.hangum
.tadpole
.application
.start
.update
.checker
.NewVersionViewDialog
;
22 import com
.hangum
.tadpole
.commons
.libs
.core
.define
.SystemDefine
;
23 import com
.swtdesigner
.ResourceManager
;
26 * New version check action
28 public class NewVersionCheckAction
extends Action
{
30 private final IWorkbenchWindow window
;
32 public NewVersionCheckAction(IWorkbenchWindow window
) {
33 super(Messages
.get().NewVersionCheckAction_0
);
34 setId(this.getClass().getName());
35 setImageDescriptor( ResourceManager
.getPluginImageDescriptor(BrowserActivator
.ID
, "resources/icons/refresh.png"));
36 setToolTipText(Messages
.get().NewVersionCheckAction_0
);
43 boolean isNew
= NewVersionChecker
.getInstance().getVersionInfoData();
45 NewVersionObject newVersionObj
= NewVersionChecker
.getInstance().getNewVersionObj();
46 NewVersionViewDialog dialog
= new NewVersionViewDialog(null, newVersionObj
);
49 MessageDialog
.openInformation(null, Messages
.get().NewVersionCheckAction_0
,
50 String
.format(Messages
.get().NewVersionCheckAction_2
, SystemDefine
.DBHUB_MAJOR_VERSION
, SystemDefine
.DBHUB_SUB_VERSION
, SystemDefine
.DBHUB_RELEASE_DATE
));