|
|
|
@ -7,6 +7,7 @@ import com.fr.design.i18n.Toolkit;
|
|
|
|
|
import com.fr.design.mainframe.CenterRegionContainerPane; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import com.fr.design.mainframe.guide.base.GuideManager; |
|
|
|
|
import com.fr.design.mainframe.guide.scene.ClickScene; |
|
|
|
|
import com.fr.design.mainframe.guide.scene.DisplayScene; |
|
|
|
@ -15,6 +16,8 @@ import com.fr.design.mainframe.guide.scene.GuideSceneLifecycleAdaptor;
|
|
|
|
|
import com.fr.design.mainframe.guide.tip.BubbleTip; |
|
|
|
|
import com.fr.design.mainframe.guide.tip.GuideTip; |
|
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
|
import com.fr.design.worker.save.CallbackSaveWorker; |
|
|
|
|
import com.fr.design.worker.save.EmptyCallBackSaveWorker; |
|
|
|
|
|
|
|
|
|
import java.awt.Window; |
|
|
|
|
|
|
|
|
@ -43,9 +46,28 @@ public class GuideSceneHelper {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onComplete() { |
|
|
|
|
public boolean onComplete() { |
|
|
|
|
GuideManager.getInstance().getCurrentGuide().getGuideView().dismissGuide(); |
|
|
|
|
WebPreviewUtils.preview(DesignerContext.getDesignerFrame().getSelectedJTemplate()); |
|
|
|
|
JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate(); |
|
|
|
|
jt.stopEditing(); |
|
|
|
|
if (!jt.isSaved()) { |
|
|
|
|
CallbackSaveWorker worker = jt.save2Env(); |
|
|
|
|
if (worker instanceof EmptyCallBackSaveWorker) { |
|
|
|
|
GuideManager.getInstance().getCurrentGuide().terminate(); |
|
|
|
|
} else { |
|
|
|
|
worker.addSuccessCallback(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
WebPreviewUtils.preview(jt); |
|
|
|
|
GuideManager.getInstance().getCurrentGuide().complete(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
worker.start(jt.getRuntimeId()); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
WebPreviewUtils.preview(jt); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return scene; |
|
|
|
@ -56,7 +78,6 @@ public class GuideSceneHelper {
|
|
|
|
|
scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { |
|
|
|
|
@Override |
|
|
|
|
public boolean prepared() { |
|
|
|
|
|
|
|
|
|
XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName); |
|
|
|
|
scene.addClickTarget(GuideCreateUtils.getFormDesigner(), GuideCreateUtils.getXCreatorBoundsRelative2FormDesigner(xCreator), ClickScene.ClickType.LEFT); |
|
|
|
|
scene.addBubbleTip(Toolkit.i18nText("Fine-Design_Guide_Scene_Base_Tip_Select_Widget"), BubbleTip.Direction.BOTTOM); |
|
|
|
@ -64,12 +85,12 @@ public class GuideSceneHelper {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onComplete() { |
|
|
|
|
super.onComplete(); |
|
|
|
|
public boolean onComplete() { |
|
|
|
|
FormDesigner designer = GuideCreateUtils.getFormDesigner(); |
|
|
|
|
XCreator xCreator = GuideCreateUtils.getXCreatorFormDesigner(widgetName); |
|
|
|
|
designer.getSelectionModel().reset(); |
|
|
|
|
designer.getSelectionModel().selectACreator(xCreator); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return scene; |
|
|
|
|