- 시작하는 제품에 따라 제품이 보여지고 관리되도록 수정.
[Tadpole.git] / com.hangum.tadpole.applicaion.start / src / com / hangum / tadpole / application / start / action / NewVersionCheckAction.java
blobc106a438a057d90cb47583ba74d67830b7034f16
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
7 *
8 * Contributors:
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;
25 /**
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);
38 this.window = window;
41 public void run() {
42 if(window != null) {
43 boolean isNew = NewVersionChecker.getInstance().getVersionInfoData();
44 if(isNew) {
45 NewVersionObject newVersionObj = NewVersionChecker.getInstance().getNewVersionObj();
46 NewVersionViewDialog dialog = new NewVersionViewDialog(null, newVersionObj);
47 dialog.open();
48 } else {
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));