Browse Source

Merge pull request #5545 in DESIGN/design from feature/10.0 to research/10.0

* commit 'b91617f1e4df4b85bd3eca5df73ced9831ee277c':
  REPORT-57898  代码回退
  REPORT-57816 REPORT-57816
  REPORT-57449 【FR11回归】【开发者预览支持调整模板布局】新自适应-远程环境模板进入开发者调试后,设计器端此模板没有显示已锁定,双击模板会弹出已锁定的弹窗,但会打开一个空白模板,且此时模板才显示“已锁定”
  REPORT-56047 修改下判断是否为安版本的标准
  REPORT-57568 解决目录树展开收起触发打开模板的逻辑
  REPORT-57898 【权限编辑】进入权限编辑时打开frm/大屏模板/版本管理,再回到原模板,无法退出权限编辑状态
  REPORT-57590 表单参数面板剪切复制按钮禁用
  REPORT-55048 fix调整下逻辑
  REPORT-57490 websocket断开时弹窗位置问题
  REPORT-55048 https远程连接时,设计器上无法获取服务器推送过来的eventhread线程日志 fix npe问题
  REPORT-55048 https远程连接时,设计器上无法获取服务器推送过来的eventhread线程日志
  REPORT-57561 远程版本不一致功能不可用的提示-启动时连接远程目录
  REPORT-57979  前面=赋值了,set没意义,删掉
  REPORT-57872 数据集-数据库查询时候,列名之间的分隔符没了
research/10.0
superman 3 years ago
parent
commit
a5cae66aca
  1. 2
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  2. 1
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  3. 16
      designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java
  4. 20
      designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfoContext.java
  5. 3
      designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java
  6. 2
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  7. 5
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  8. 10
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java
  9. 5
      designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java
  10. 3
      designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java
  11. 6
      designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java
  12. 16
      designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CopyableEnable.java
  13. 16
      designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CutableEnable.java
  14. 16
      designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/DeletableEnable.java
  15. 8
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  16. 3
      designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java
  17. 17
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  18. 33
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  19. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

2
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -8,6 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceInfoContext;
import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.env.RemoteWorkspace;
@ -105,6 +106,7 @@ public class EnvChangeEntrance {
private boolean switch2Env(final String envName, PopTipStrategy strategy) {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName);
DesignerWorkspaceInfoContext.setWorkspaceInfo(selectedEnv);
WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection();
try {

1
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -511,7 +511,6 @@ public class JDBCDefPane extends JPanel {
this.dbtypeComboBox.setSelectedItem(OTHER_DB);
}
}
this.jdbcDatabase.setIdentity(jdbcDatabase.getIdentity());
// jdbcDatabase.getDriverSource() 只会是空或者是有值,但是为了保险起见,还是应该做个处理
String driverSource = jdbcDatabase.getDriverSource();
if (driverSource == null) {

16
designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java

@ -48,9 +48,17 @@ public class CopyableJTable extends SortableJTable {
boolean mouseDrag = false;
boolean headerSelect = false;
DefaultTableCellRenderer tableHeaderCellRenderer = new DefaultTableCellRenderer() {
class CopyableTableHeaderCellRenderer implements TableCellRenderer {
TableCellRenderer tableCellRenderer;
CopyableTableHeaderCellRenderer(TableCellRenderer tableCellRenderer) {
this.tableCellRenderer = tableCellRenderer;
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
JComponent comp = (JComponent) this.tableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (isChoose(row, column)) {
comp.setBackground(selectBackGround);
} else {
@ -58,13 +66,13 @@ public class CopyableJTable extends SortableJTable {
}
return comp;
}
};
}
public CopyableJTable(TableSorter tableModel) {
super(tableModel);
initListener();
this.getTableHeader().setDefaultRenderer(tableHeaderCellRenderer);
this.getTableHeader().setDefaultRenderer(new CopyableTableHeaderCellRenderer(this.getTableHeader().getDefaultRenderer()));
}
private void initListener() {

20
designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfoContext.java vendored

@ -0,0 +1,20 @@
package com.fr.design.env;
/**
*
* @author hades
* @version 10.0
* Created by hades on 2021/8/24
*/
public class DesignerWorkspaceInfoContext {
private static DesignerWorkspaceInfo workspaceInfo;
public static DesignerWorkspaceInfo getWorkspaceInfo() {
return workspaceInfo;
}
public static void setWorkspaceInfo(DesignerWorkspaceInfo workspaceInfo) {
DesignerWorkspaceInfoContext.workspaceInfo = workspaceInfo;
}
}

3
designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java vendored

@ -3,6 +3,7 @@ package com.fr.design.env;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@ -107,7 +108,7 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
File engineLib = new File(StableUtils.pathJoin(this.path, ProjectConstants.LIB_NAME, REPORT_ENGINE_JAR));
// 非安装版本允许自由切换
boolean notExistLib = !ComparatorUtils.equals(GeneralUtils.readFullBuildNO(), InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build"))
boolean notExistLib = !CoreConstants.DOT.equals(StableUtils.getInstallHome())
&& !engineLib.exists();
if (notExistLib) {
throw new MainVersionNotMatchException();

2
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -83,7 +83,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
@Override
public void mousePressed(MouseEvent evt) {
if (evt.getClickCount() == 2) {
if (reportletsTree.getPathForLocation(evt.getX(), evt.getY()) != null && evt.getClickCount() == 2) {
openFile();
}
}

5
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -3,6 +3,7 @@ package com.fr.design.gui.controlpane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory;
import com.fr.design.gui.ifilechooser.JavaFxNativeFileChooser;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar;
@ -277,6 +278,10 @@ public abstract class UIControlPane extends JControlPane {
this.requestFocus();
return;
}
if (JavaFxNativeFileChooser.isShowDialogState()) {
JavaFxNativeFileChooser.setShowDialogState(false);
return;
}
saveSettings();
setVisible(false);
PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);

10
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -24,6 +24,7 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
public class JavaFxNativeFileChooser implements FileChooserProvider {
private static boolean showDialogState = false;
private File[] selectedFiles = new File[0];
private FileSelectionMode fileSelectionMode = FileSelectionMode.FILE;
private String title = Toolkit.i18nText("Fine-Design_Basic_Open");
@ -43,8 +44,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
return null;
}
public static boolean isShowDialogState() {
return showDialogState;
}
public static void setShowDialogState(boolean showDialogState) {
JavaFxNativeFileChooser.showDialogState = showDialogState;
}
@Override
public int showDialog(Component parent) {
setShowDialogState(true);
final CountDownLatch latch = new CountDownLatch(1);
PlatformImpl.startup(() -> {
});

5
designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java

@ -1,8 +1,7 @@
package com.fr.design.designer.beans.actions;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.beans.actions.behavior.ComponentEnable;
import com.fr.design.designer.beans.actions.behavior.CopyableEnable;
import com.fr.design.mainframe.FormDesigner;
import javax.swing.KeyStroke;
@ -18,7 +17,7 @@ public class CopyAction extends FormWidgetEditAction {
this.setMnemonic('C');
this.setSmallIcon("/com/fr/design/images/m_edit/copy");
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
setUpdateBehavior(new ComponentEnable());
setUpdateBehavior(new CopyableEnable());
this.setEnabled(!DesignModeContext.isBanCopyAndCut());
}

3
designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.beans.actions.behavior.ComponentEnable;
import com.fr.design.designer.beans.actions.behavior.CutableEnable;
import com.fr.design.mainframe.FormDesigner;
import javax.swing.KeyStroke;
@ -18,7 +19,7 @@ public class CutAction extends FormWidgetEditAction {
this.setMnemonic('T');
this.setSmallIcon("/com/fr/design/images/m_edit/cut");
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setUpdateBehavior(new ComponentEnable());
this.setUpdateBehavior(new CutableEnable());
this.setEnabled(!DesignModeContext.isBanCopyAndCut());
}

6
designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java

@ -7,9 +7,7 @@ import java.awt.event.KeyEvent;
import javax.swing.*;
import com.fr.design.designer.beans.actions.behavior.ComponentEnable;
import com.fr.design.designer.beans.actions.behavior.DeletableEnable;
import com.fr.design.mainframe.FormDesigner;
/**
@ -26,7 +24,7 @@ public class FormDeleteAction extends FormWidgetEditAction {
// Richie:删除菜单图标
this.setSmallIcon("/com/fr/design/images/m_report/delete");
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
this.setUpdateBehavior(new ComponentEnable());
this.setUpdateBehavior(new DeletableEnable());
}
@Override

16
designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CopyableEnable.java

@ -0,0 +1,16 @@
package com.fr.design.designer.beans.actions.behavior;
import com.fr.design.designer.beans.actions.FormWidgetEditAction;
import com.fr.design.mainframe.FormDesigner;
public class CopyableEnable implements UpdateBehavior<FormWidgetEditAction> {
@Override
public void doUpdate(FormWidgetEditAction action) {
FormDesigner designer = action.getEditingComponent();
if (designer == null) {
action.setEnabled(false);
return;
}
action.setEnabled(designer.isCurrentComponentCopyable());
}
}

16
designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/CutableEnable.java

@ -0,0 +1,16 @@
package com.fr.design.designer.beans.actions.behavior;
import com.fr.design.designer.beans.actions.FormWidgetEditAction;
import com.fr.design.mainframe.FormDesigner;
public class CutableEnable implements UpdateBehavior<FormWidgetEditAction> {
@Override
public void doUpdate(FormWidgetEditAction action) {
FormDesigner designer = action.getEditingComponent();
if (designer == null) {
action.setEnabled(false);
return;
}
action.setEnabled(designer.isCurrentComponentCutable());
}
}

16
designer-form/src/main/java/com/fr/design/designer/beans/actions/behavior/DeletableEnable.java

@ -0,0 +1,16 @@
package com.fr.design.designer.beans.actions.behavior;
import com.fr.design.designer.beans.actions.FormWidgetEditAction;
import com.fr.design.mainframe.FormDesigner;
public class DeletableEnable implements UpdateBehavior<FormWidgetEditAction> {
@Override
public void doUpdate(FormWidgetEditAction action) {
FormDesigner designer = action.getEditingComponent();
if (designer == null) {
action.setEnabled(false);
return;
}
action.setEnabled(designer.isCurrentComponentDeletable());
}
}

8
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -745,5 +745,13 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return false;
}
@Override
public boolean isCurrentComponentCutable() {
return !isRootSelected();
}
@Override
public boolean isCurrentComponentCopyable() {
return !isRootSelected();
}
}

3
designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java

@ -36,6 +36,9 @@ public class FormDesignerUtils {
* @return
*/
public static boolean isBodyAbsolute(FormDesigner designer) {
if (!designer.getRootComponent().acceptType(XWFitLayout.class)) {
return false;
}
WFitLayout root = ((WFitLayout) designer.getRootComponent().toData());
return root.getBodyLayoutType() == com.fr.form.ui.container.WBodyLayoutType.ABSOLUTE;
}

17
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1266,6 +1266,11 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
return isForm || isRoot(getSelectionModel().getSelection().getSelectedCreator());
}
public boolean isParameterSelected() {
XCreator xCreator = getSelectionModel().getSelection().getSelectedCreator();
return xCreator != null && xCreator.acceptType(XWParameterLayout.class);
}
/**
* 显示权限编辑界面
*/
@ -1384,6 +1389,18 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
}
}
public boolean isCurrentComponentCutable() {
return !(isRootSelected() || isParameterSelected());
}
public boolean isCurrentComponentCopyable() {
return !(isRootSelected() || isParameterSelected());
}
public boolean isCurrentComponentDeletable() {
return !isRootSelected();
}
// 当前选中控件可以上移一层吗?
public boolean isCurrentComponentMovableUp() {
XCreator creator = getSelectionModel().getSelection().getSelectedCreator();

33
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -6,6 +6,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.DesignerWorkspaceInfoContext;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogger;
@ -127,9 +128,7 @@ public class DesignerSocketIO {
}
private static SSLContext getSSLContext() throws Exception {
String currentName = DesignerEnvManager.getEnvManager().getCurEnvName();
DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName);
WorkspaceConnectionInfo connection = info.getConnection();
WorkspaceConnectionInfo connection = getConnectionInfo();
String certPath = connection.getCertPath();
String certSecretKey = connection.getCertSecretKey();
if (StringUtils.isBlank(certPath) || StringUtils.isBlank(certSecretKey)) {
@ -144,6 +143,16 @@ public class DesignerSocketIO {
.build();
}
private static WorkspaceConnectionInfo getConnectionInfo() {
if (DesignerWorkspaceInfoContext.getWorkspaceInfo() == null) {
String currentName = DesignerEnvManager.getEnvManager().getCurEnvName();
DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentName);
return info.getConnection();
} else {
return DesignerWorkspaceInfoContext.getWorkspaceInfo().getConnection();
}
}
private static String[] getSocketUri() throws IOException {
Workspace current = WorkContext.getCurrent();
URL url = new URL(current.getPath());
@ -152,10 +161,6 @@ public class DesignerSocketIO {
// 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置
WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol();
currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS;
if (WebSocketConfig.getInstance().isUsingProxy()) {
// 如果配置了代理服务器跟随服务器协议
currentProtocol = url.getProtocol();
}
String[] result = new String[ports.length];
for (int i = 0; i < ports.length; i++) {
result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s",
@ -239,7 +244,7 @@ public class DesignerSocketIO {
private static void showConnectionLostDialog() {
try {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
FineJOptionPane.showMessageDialog(
@ -270,7 +275,7 @@ public class DesignerSocketIO {
for (Object object : objects) {
if (object instanceof Throwable) {
Throwable throwable = (Throwable) object;
printEventLog.printThrowable(throwable.getMessage(), throwable);
printEventLog.printThrowable(throwable);
} else {
printEventLog.print(prefix, object);
}
@ -278,15 +283,15 @@ public class DesignerSocketIO {
}
interface PrintEventLog {
void printThrowable(String s, Throwable throwable);
void printThrowable(Throwable throwable);
void print(String s, Object ...object);
}
enum PrintEventLogImpl implements PrintEventLog {
ERROR {
@Override
public void printThrowable(String s, Throwable throwable) {
FineLoggerFactory.getLogger().error(s, throwable);
public void printThrowable(Throwable throwable) {
FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable);
}
@Override
@ -297,8 +302,8 @@ public class DesignerSocketIO {
WARN {
@Override
public void printThrowable(String s, Throwable throwable) {
FineLoggerFactory.getLogger().warn(s, throwable);
public void printThrowable(Throwable throwable) {
FineLoggerFactory.getLogger().warn(throwable.getMessage(), throwable);
}
@Override

4
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -62,12 +62,12 @@ public class DesignerWorkspaceProvider extends Activator {
} else {
WorkContext.switchTo(workspace);
//在设计器完全启动完成后,对初始环境进行一次服务检测,对主要功能无影响,异常仅做日志提示即可
final DesignerWorkspaceInfo selectEnv = workspaceInfo;
final String selectEnv = current;
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() {
@Override
public void on(Event event, Null aNull) {
try {
VersionCheckUtils.showVersionCheckDialog(selectEnv.getName());
VersionCheckUtils.showVersionCheckDialog(selectEnv);
} catch (Exception e) {
FineLoggerFactory.getLogger().warn("Check Service Failed");
}

Loading…
Cancel
Save