Browse Source

Merge branch 'release/10.0' of https://cloud.finedevelop.com/scm/~hades/design into release/10.0

feature/big-screen
hades 5 years ago
parent
commit
569055f65d
  1. 12
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 14
      designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
  3. 9
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 9
      designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java
  5. 36
      designer-base/src/main/java/com/fr/start/ServerStarter.java
  6. 4
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java
  7. 4
      designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java
  8. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java
  9. 22
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

12
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -82,6 +82,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static final String VERSION_80 = "80";
private static final int CACHINGTEMPLATE_LIMIT = 5;
private static final String WEB_NAME = "webapps";
/**
* 指定默认工作空间
*/
public static final String DEFAULT_WORKSPACE_PATH = "fr.designer.workspace.default";
private static DesignerEnvManager designerEnvManager; // gui.
private String activationKey = null;
@ -555,6 +559,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private String getDefaultenvPath(String installHome) {
String defaultWorkspacePath = System.getProperty(DEFAULT_WORKSPACE_PATH);
if (defaultWorkspacePath != null) {
return defaultWorkspacePath;
}
//这里需要转成反斜杠和生成默认路径一致
return new File(StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)).getPath();
}
@ -1397,6 +1405,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
/**
* 对国际化进行校验
* 非简繁英日韩的默认环境 设计器全部默认为英文版本
*
* @param locale
* @return
*/
@ -1548,8 +1557,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
readVcsAttr(reader);
} else if (DesignerPort.XML_TAG.equals(name)) {
readDesignerPort(reader);
}
else {
} else {
readLayout(reader, name);
}
}

14
designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

@ -260,6 +260,13 @@ public class ActionFactory {
}
}
public static void referCellInsertActionClass(Class<?>[] cls) {
if (cls != null) {
actionClasses.clear();
Collections.addAll(actionClasses, cls);
}
}
/**
* 生成单元格插入相关的Action
* 表单中报表块编辑需要屏蔽掉"插入子报表"
@ -318,6 +325,13 @@ public class ActionFactory {
}
}
public static void referFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) {
floatActionClasses.clear();
Collections.addAll(floatActionClasses, cls);
}
}
/**
* 生成悬浮元素插入相关的Action
*

9
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -1284,4 +1284,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
progressDialog.dispose();
}
/**
* 设计器是否已经打开
*
* @return 设计器是否已经打开
*/
public boolean isDesignerOpened() {
return designerOpened;
}
}

9
designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java

@ -58,7 +58,14 @@ public class DesignerPushUpdateManager {
private String getFullLatestVersion() {
try {
String res = HttpToolbox.get(CloudCenter.getInstance().acquireUrlByKind("jar10.update"));
String url = CloudCenter.getInstance().acquireUrlByKind("jar10.update");
if(StringUtils.isBlank(url)){
return StringUtils.EMPTY;
}
String res = HttpToolbox.get(url);
if(StringUtils.isBlank(res)){
return StringUtils.EMPTY;
}
return new JSONObject(res).optString("buildNO");
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

36
designer-base/src/main/java/com/fr/start/ServerStarter.java

@ -3,10 +3,9 @@ package com.fr.start;
import com.fr.base.ServerConfig;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.stable.StableUtils;
import com.fr.start.server.FineEmbedServer;
import com.fr.start.server.FineEmbedServerMonitor;
import com.fr.workspace.WorkContext;
@ -25,23 +24,11 @@ public class ServerStarter {
if (!WorkContext.getCurrent().isLocal()) {
//有问题,这里拿不到远程的http端口
BrowseUtils.browser(WorkContext.getCurrent().getPath());
} else if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用
String web = GeneralContext.getCurrentAppNameOfEnv();
browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + web + "/" + ServerConfig.getInstance().getServletName());
} else {
initDemoServerAndBrowser();
}
}
private static void initDemoServerAndBrowser() {
try {
FineEmbedServer.start();
} finally {
//先访问Demo, 后访问报表, 不需要重置服务器.
BrowseUtils.browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName());
browserURLWithLocalEnv("http://localhost:"
+ DesignerEnvManager.getEnvManager().getEmbedServerPort()
+ "/" + GeneralContext.getCurrentAppNameOfEnv()
+ "/" + ServerConfig.getInstance().getServletName());
}
}
@ -51,8 +38,8 @@ public class ServerStarter {
* @param url 指定路径
*/
public static void browserURLWithLocalEnv(final String url) {
if (!FineEmbedServerMonitor.getInstance().isComplete()) {
// 内置服务器没有启动并且设计器已经打开,可以使用带进度条的启动方式
if (!FineEmbedServer.isRunning() && DesignerContext.getDesignerFrame().isDesignerOpened()) {
FineEmbedServerMonitor.getInstance().monitor();
ExecutorService service = Executors.newSingleThreadExecutor(new NamedThreadFactory("ServerStarter"));
service.submit(new Runnable() {
@ -68,8 +55,15 @@ public class ServerStarter {
}
});
service.shutdown();
} else {
} else if (!FineEmbedServer.isRunning()) {
// 普通方式启动内置服务器
try {
FineEmbedServer.start();
} finally {
BrowseUtils.browser(url);
}
} else {
// 已经启动内置服务器只需打开链接
BrowseUtils.browser(url);
}
}

4
designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java

@ -113,7 +113,9 @@ public class MatchAreaTable extends JTable {
}
private void initComboBox(Object value, boolean editor) {
comboBox = new TableTreeComboBox(new JTree(root));
//地图不显示第一层,钻取地图显示第一层。
boolean showRoot = root.getUserObject() != null;
comboBox = new TableTreeComboBox(new JTree(root), showRoot);
comboBox.setEditable(true);
comboBox.setSelectedItem(value);

4
designer-chart/src/main/java/com/fr/design/chartx/component/TableTreeComboBox.java

@ -32,8 +32,8 @@ public class TableTreeComboBox extends FRTreeComboBox {
private JTextField textField;
public TableTreeComboBox(JTree tree) {
super(tree, null);
public TableTreeComboBox(JTree tree, boolean showRoot) {
super(tree, null, showRoot, false);
textField = (JTextField) (this.getEditor().getEditorComponent());
textField.addKeyListener(treeKeyListener);
tree.setCellRenderer(tableNameTreeRenderer);

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java

@ -67,6 +67,10 @@ public class MapPlotPane extends AbstractDeprecatedChartTypePane {
return new String[0];
}
public void reLayout(String chartID) {
}
/**
* 界面标题
* @return 界面标题

22
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -63,6 +63,7 @@ import com.fr.design.update.actions.RecoverForDesigner;
import com.fr.design.update.push.DesignerPushUpdateManager;
import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane;
import com.fr.form.stable.ElementCaseThumbnailProcessor;
import com.fr.general.GeneralContext;
import com.fr.general.xml.GeneralXMLTools;
import com.fr.js.EmailJavaScript;
import com.fr.js.JavaScriptImpl;
@ -75,6 +76,11 @@ import com.fr.locale.LocaleScope;
import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler;
import com.fr.module.Activator;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.quickeditor.cellquick.CellBiasTextPainterEditor;
import com.fr.quickeditor.cellquick.CellDSColumnEditor;
import com.fr.quickeditor.cellquick.CellFormulaQuickEditor;
@ -181,6 +187,7 @@ public class DesignerActivator extends Activator {
ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement());
DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes());
createPluginListener();
justStartModules4Designer();
CalculatorProviderContext.setValueConverter(valueConverter());
@ -193,6 +200,21 @@ public class DesignerActivator extends Activator {
InformationCollector.getInstance().collectStartTime();
}
private void createPluginListener() {
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
ActionFactory.referCellInsertActionClass(actionsForInsertCellElement());
ActionFactory.referFloatInsertActionClass(actionsForInsertFloatElement());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign, ElementUIProvider.MARK_STRING);
}
});
}
private static Class<?>[] actionsForInsertCellElement() {
List<Class<?>> classes = new ArrayList<>();
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);

Loading…
Cancel
Save