1.kettle 源码 怎么运行repositories插件
kettle 源码 怎么运行repositories插件
1.2. 编译源码
项目加载eclipse
kettle项目拷贝eclipseworkspace目录eclipse新建java project项目名称拷贝kettle文件夹名称致
项目导入eclipse现错误图文件源码全部注释掉
编译
打build.xml,hex类源码 右边Outline 点击kettle-run as -ant build
第编译候需要网载几文件放C:\Documents and Settings\Administrator\.subfloor网络载比较慢直接文件放C:\Documents and Settings\Administrator\编译完bin目录.bat文件拷贝Kettle目录点击Spoon.bat运行运行功代表编译已近通
用源码运行Spoon
Kettle源码工程本身能linux位机器调试swt配置linux库所运行源码前需要修改winswt步骤:工程à属性àJava Build Pathàlibrariesàadd jars
linuxSWT库删除
打src-uiàorg.pentaho.di.ui.spoonàSpoon.java Run As àjava application
二.源码析
2.1. 修改kettle界面
修改初始化界面
打package org.pentaho.di.ui.spoonSpoon.Java找main函数该main函数Spoon工具入口找语句
Splash splash = new Splash(display);
该语句spoon初始化显示界面跳定义Splash.java面函数
canvas.addPaintListener(new PaintListener() {
publicvoid paintControl(PaintEvent e) {
String versionText = BaseMessages.getString(PKG, "SplashDialog.Version") + " " + Const.VERSION; //$NON-NLS-1$ //$NON-NLS-2$
StringBuilder sb = new StringBuilder();
String line = null;
try {
BufferedReader reader = new BufferedReader(newInputStreamReader(Splash.class.getClassLoader().getResourceAsStream("org/pentaho/di/ui/core/dialog/license/license.txt")));//$NON-NLS-1$
while((line = reader.readLine()) != null) {
sb.append(line + System.getProperty("line.separator")); //$NON-NLS-1$
}
} catch (Exception ex) {
sb.append(""); //$NON-NLS-1$
Log.warn(BaseMessages.getString(PKG, "SplashDialog.LicenseTextNotFound")); //$NON-NLS-1$
}
String licenseText = sb.toString();
e.gc.drawImage(kettle_image, 0, 0);
// If this is a Milestone or RC release, warn the user
if (Const.RELEASE.equals(Const.ReleaseType.MILESTONE)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.DeveloperRelease") + " - " + versionText; //$NON-NLS-1$ //$NON-NLS-2$
drawVersionWarning(e);
} elseif (Const.RELEASE.equals(Const.ReleaseType.RELEASE_CANDIDATE)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.ReleaseCandidate") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
elseif (Const.RELEASE.equals(Const.ReleaseType.PREVIEW)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.PreviewRelease") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
elseif (Const.RELEASE.equals(Const.ReleaseType.GA)) {
versionText = BaseMessages.getString(PKG, "SplashDialog.GA") + " - " + versionText; //$NON-NLS-1$//$NON-NLS-2$
}
Font verFont = new Font(e.display, "Helvetica", , SWT.BOLD); //$NON-NLS-1$
e.gc.setFont(verFont);
e.gc.drawText(versionText, , , true);
// try using the desired font size for the license text
int fontSize = 8;
Font licFont = new Font(e.display, "Helvetica", fontSize, SWT.NORMAL); //$NON-NLS-1$
e.gc.setFont(licFont);
// if the text will not fit the allowed space
while (!willLicenseTextFit(licenseText, e.gc)) {
fontSize--;
licFont = new Font(e.display, "Helvetica", fontSize, SWT.NORMAL); //$NON-NLS-1$
e.gc.setFont(licFont);
}
e.gc.drawText(licenseText, , , true);
}
});
1. 修改背景
找ui/image/面kettle_splash.png替换该
2. 修改版本信息
找e.gc.drawText(versionText, , , true); 改e.gc.drawText("海康威视数据交换平台V1.0", , , true);
3. 修改面描述性文字
找e.gc.drawText(licenseText, , , true);改e.gc.drawText("作者:海康", , , true);
4. 预览效