no message
This commit is contained in:
48
src/_VisualDVM/Passes/All/UpdateComponent.java
Normal file
48
src/_VisualDVM/Passes/All/UpdateComponent.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Repository.Component.Component;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Passes.Pass;
|
||||
public class UpdateComponent extends Pass<Component> {
|
||||
@Override
|
||||
protected PassCode necessary() {
|
||||
return PassCode.CreateComponentBackUp;
|
||||
}
|
||||
@Override
|
||||
protected boolean resetsNecessary() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
PassCode subPassCode = null;
|
||||
//<editor-fold desc="получение нового файла компонента">
|
||||
switch (Global.mainModule.getComponent().getComponentType()) {
|
||||
case Sapfor_F:
|
||||
case Visualizer_2:
|
||||
subPassCode = Utils_.isWindows() ? PassCode.DownloadComponent : PassCode.BuildComponent;
|
||||
break;
|
||||
case Visualiser:
|
||||
case Instruction:
|
||||
case PerformanceAnalyzer:
|
||||
subPassCode = PassCode.DownloadComponent;
|
||||
break;
|
||||
}
|
||||
if ((subPassCode != null) && Global.mainModule.getPass(subPassCode).Do()) {
|
||||
//</editor-fold>
|
||||
if (!Global.mainModule.getComponent().getNewFile().exists())
|
||||
throw new PassException("Не удалось получить новый файл для компонента " + Global.mainModule.getComponent().getComponentType().getDescription());
|
||||
//непосредственное обновление.
|
||||
Global.mainModule.getComponent().Update();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
Global.mainModule.getComponent().CheckIfNeedsUpdateOrPublish();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
Global.RefreshUpdatesStatus();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user