Browse Source

PFC-607 插件安装删除更新不重启支持

1、修复bug
2、复用之前切换环境时设计器调整的代码,每次设计器插件变动时刷新
master
juhaoyu 7 years ago
parent
commit
f1b45a27e8
  1. 62
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  2. 19
      designer_base/src/com/fr/design/utils/DesignUtils.java

62
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -27,6 +27,7 @@ import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.MenuManager;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE;
import com.fr.file.FILEFactory;
@ -172,15 +173,35 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null);
}
/**
* @param ad
* @return
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad){
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
{
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
DesignerContext.getDesignerFrame().refreshEnv(FRContext.getCurrentEnv());
DesignerContext.getDesignerFrame().repaint();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
}
});
}
/**
* @param ad
* @return
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@ -188,13 +209,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(TitlePlaceProcessor.MARK_STRING);
return context.contain(PluginModule.ExtraDesign);
}
});
refreshNorthEastPane(northEastPane, ad);
@ -664,24 +686,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
}
}
{
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
DesignerContext.getDesignerFrame().refreshEnv(FRContext.getCurrentEnv());
DesignerContext.getDesignerFrame().repaint();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
}
});
}
/**
* 报表运行环境改变时,需要刷新某些面板

19
designer_base/src/com/fr/design/utils/DesignUtils.java

@ -181,9 +181,18 @@ public class DesignUtils {
// 更新CurrentEnv于FRContext & DesignerEnvManager
FRContext.setCurrentEnv(env);
refreshDesignerFrame(env);
// 当换了运行环境,重置服务器,让它下次预览时重启
if (env instanceof LocalEnv && !ComparatorUtils.equals(env.getPath(), oldEnvPath)) {
StartServer.currentEnvChanged();
}
}
public static void refreshDesignerFrame(Env env) {
final Env run_env = env;
// 刷新DesignerFrame里面的面板
SwingUtilities.invokeLater(new Runnable() {
@ -195,12 +204,8 @@ public class DesignUtils {
DesignerContext.getDesignerFrame().repaint();// kunsnat: 切换环境后 刷新下 报表. 比如图表某些风格改变.
}
});
// 当换了运行环境,重置服务器,让它下次预览时重启
if (env instanceof LocalEnv && !ComparatorUtils.equals(env.getPath(), oldEnvPath)) {
StartServer.currentEnvChanged();
}
}
/**
* p:初始化look and feel, 把一切放到这个里面.可以让多个地方调用.
*/

Loading…
Cancel
Save