Browse Source
* commit 'b3cf2f6af2c9457d8a71a20d537472f74e61468b': REPORT-2354 插件整合,設計器端的國際化key忘了改過來了master
superman
8 years ago
7 changed files with 24 additions and 61 deletions
@ -1,37 +0,0 @@ |
|||||||
package com.fr.design.extra.exe.callback; |
|
||||||
|
|
||||||
import com.fr.design.extra.PluginUtils; |
|
||||||
import com.fr.design.extra.exe.extratask.ExtraPluginTask; |
|
||||||
import com.fr.general.Inter; |
|
||||||
import com.fr.plugin.manage.control.PluginTaskResult; |
|
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by ibm on 2017/5/26. |
|
||||||
*/ |
|
||||||
public class DownloadCallback extends AbstractPluginTaskCallback { |
|
||||||
private ExtraPluginTask extraPluginTask; |
|
||||||
private JSCallback jsCallback; |
|
||||||
private static int HUNDRED_PERCENT = 100; |
|
||||||
|
|
||||||
public DownloadCallback(final ExtraPluginTask extraPluginTask, final JSCallback jsCallback) { |
|
||||||
this.extraPluginTask = extraPluginTask; |
|
||||||
this.jsCallback = jsCallback; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void updateProgress(String description, double aProgress) { |
|
||||||
jsCallback.execute(String.valueOf(aProgress * HUNDRED_PERCENT + "%")); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void done(PluginTaskResult result) { |
|
||||||
if (result.isSuccess()) { |
|
||||||
extraPluginTask.doExtraPluginTask(); |
|
||||||
} else { |
|
||||||
jsCallback.execute("failed"); |
|
||||||
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue