/*
* Created on 2004/10/08
* Author aki@www.xucker.jpn.org
* License Apache2.0 or Common Public License
*/
package org.jpn.xucker.dualsubmit;
import org.eclipse.swt.SWT;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
/**
*
*
*/
public class DefaultApplication {
private Shell shell;
public String getApplicationName() {
return applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
public String getHomePageUrl() {
return homePageUrl;
}
public void setHomePageUrl(String homePageUrl) {
this.homePageUrl = homePageUrl;
}
public Shell getShell() {
return shell;
}
public void setShell(Shell shell) {
this.shell = shell;
}
public double getVersion() {
return version;
}
public void setVersion(double version) {
this.version = version;
}
private String homePageUrl;
private String applicationName;
private double version;
private String exeName;
public String getExeName() {
return exeName;
}
public void setExeName(String exeName) {
this.exeName = exeName;
}
public void updateWindowTitle(){
shell.setText(applicationName + " ver" + version);
}
/**
* @param shell
*/
public DefaultApplication(Shell shell) {
this.shell=shell;
}
public void execHomepage() {
Program program = Program.findProgram("html");
if (program != null) {
program.execute(homePageUrl);
}
}
public void execVersion() {
MessageBox box = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION);
box.setMessage(applicationName + " ver" + version + "\r\n\r\n"
+ "License CPL or Apache2.0\r\n (c)AbL[ 2004\r\n"
+ homePageUrl);
//int result=box.open();
//never use result int,for PMD
box.open();
}
}
|