Browse Source

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

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

44
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.ToolBarMenuDock;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.MenuManager; import com.fr.design.menu.MenuManager;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
@ -173,11 +174,31 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.resetToolkitByPlus(null); this.resetToolkitByPlus(null);
} }
{
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 * @param ad
* @return * @return
*/ */
protected JPanel initNorthEastPane(final ToolBarMenuDock ad){ protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
//hugh: private修改为protected方便oem的时候修改右上的组件构成 //hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮 //顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -188,13 +209,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void on(PluginEvent event) { public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad); refreshNorthEastPane(northEastPane, ad);
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv());
} }
}, new PluginFilter() { }, new PluginFilter() {
@Override @Override
public boolean accept(PluginContext context) { public boolean accept(PluginContext context) {
return context.contain(TitlePlaceProcessor.MARK_STRING); return context.contain(PluginModule.ExtraDesign);
} }
}); });
refreshNorthEastPane(northEastPane, ad); 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);
}
});
}
/** /**
* 报表运行环境改变时,需要刷新某些面板 * 报表运行环境改变时,需要刷新某些面板

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

@ -182,6 +182,15 @@ public class DesignUtils {
// 更新CurrentEnv于FRContext & DesignerEnvManager // 更新CurrentEnv于FRContext & DesignerEnvManager
FRContext.setCurrentEnv(env); 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; final Env run_env = env;
// 刷新DesignerFrame里面的面板 // 刷新DesignerFrame里面的面板
@ -195,10 +204,6 @@ public class DesignUtils {
DesignerContext.getDesignerFrame().repaint();// kunsnat: 切换环境后 刷新下 报表. 比如图表某些风格改变. DesignerContext.getDesignerFrame().repaint();// kunsnat: 切换环境后 刷新下 报表. 比如图表某些风格改变.
} }
}); });
// 当换了运行环境,重置服务器,让它下次预览时重启
if (env instanceof LocalEnv && !ComparatorUtils.equals(env.getPath(), oldEnvPath)) {
StartServer.currentEnvChanged();
}
} }
/** /**

Loading…
Cancel
Save