Browse Source

REPORT-145379 远程设计调试工具适配gzip

fbp/release
vito 1 month ago
parent
commit
b8fbc434eb
  1. 7
      designer-base/src/main/java/com/fr/design/debug/remote/RemoteDesignNetWorkAction.java
  2. 28
      designer-base/src/main/java/com/fr/design/debug/remote/RemoteDesignNetWorkTablePane.java
  3. 3
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

7
designer-base/src/main/java/com/fr/design/debug/remote/RemoteDesignNetWorkAction.java

@ -2,10 +2,8 @@ package com.fr.design.debug.remote;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.workspace.WorkContext;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
@ -33,11 +31,6 @@ public class RemoteDesignNetWorkAction extends UpdateAction {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (WorkContext.getCurrent().isLocal()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
"Remote Design NetWork can't show on local environment.");
return;
}
JDialog jDialog = new JDialog(DesignerContext.getDesignerFrame(), TITLE); JDialog jDialog = new JDialog(DesignerContext.getDesignerFrame(), TITLE);
jDialog.setSize(FineUIUtils.calPaneDimensionByContext(0.8, 0.6)); jDialog.setSize(FineUIUtils.calPaneDimensionByContext(0.8, 0.6));
RemoteDesignNetWorkTablePane netWorkPane = new RemoteDesignNetWorkTablePane(); RemoteDesignNetWorkTablePane netWorkPane = new RemoteDesignNetWorkTablePane();

28
designer-base/src/main/java/com/fr/design/debug/remote/RemoteDesignNetWorkTablePane.java

@ -5,11 +5,15 @@ import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
@ -20,6 +24,7 @@ import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn; import javax.swing.table.TableColumn;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
@ -49,7 +54,8 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
model.addRow(new Object[]{ model.addRow(new Object[]{
count.incrementAndGet(), count.incrementAndGet(),
dateFormat(requestInfo.getDate()), dateFormat(requestInfo.getDate()),
requestInfo.getPath().substring(WorkContext.getCurrent().getPath().length() - 1), requestInfo.getHttpMethod() + " "
+ requestInfo.getPath().substring(WorkContext.getCurrent().getPath().length() - 1),
requestInfo.getStatus(), requestInfo.getStatus(),
simpleTime(requestInfo.getConsume()), simpleTime(requestInfo.getConsume()),
simpleSize(requestInfo.getRequestSize()), simpleSize(requestInfo.getRequestSize()),
@ -125,9 +131,29 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
jToolBar.add(forbid); jToolBar.add(forbid);
jToolBar.add(remove); jToolBar.add(remove);
jToolBar.add(refresh); jToolBar.add(refresh);
tip(jToolBar);
add(jToolBar, BorderLayout.NORTH); add(jToolBar, BorderLayout.NORTH);
} }
private void tip(JToolBar jToolBar) {
JLabel jLabel = new JLabel();
jLabel.setForeground(Color.ORANGE);
jToolBar.addSeparator();
jToolBar.add(jLabel);
setTipIfNeed(jLabel);
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() {
@Override
public void on(Event event, Workspace workspace) {
setTipIfNeed(jLabel);
}
});
}
private static void setTipIfNeed(JLabel jLabel) {
UIUtil.invokeLaterIfNeeded(() -> jLabel.setText(
WorkContext.getCurrent().isLocal() ? "Remote Design NetWork can't show on local environment." : ""));
}
/** /**
* 清理监听 * 清理监听
*/ */

3
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -776,8 +776,7 @@ public class MultiTemplateTabPane extends Row {
// 双击添加模板 // 双击添加模板
if (e.getClickCount() == DOUBLE_CLICK if (e.getClickCount() == DOUBLE_CLICK
&& isOverBlank(e.getX()) && isOverBlank(e.getX())
&& newTemplateAction != null && newTemplateAction != null) {
) {
newTemplateAction.actionPerformed(null); newTemplateAction.actionPerformed(null);
} }
} }

Loading…
Cancel
Save