|
|
|
@ -5,15 +5,11 @@ import com.fine.theme.icon.LazyIcon;
|
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
|
import com.fr.event.Event; |
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
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.JScrollPane; |
|
|
|
|
import javax.swing.JTable; |
|
|
|
@ -24,7 +20,6 @@ import javax.swing.table.DefaultTableModel;
|
|
|
|
|
import javax.swing.table.TableCellRenderer; |
|
|
|
|
import javax.swing.table.TableColumn; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.util.concurrent.atomic.AtomicLong; |
|
|
|
|
|
|
|
|
@ -54,8 +49,7 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
|
|
|
|
|
model.addRow(new Object[]{ |
|
|
|
|
count.incrementAndGet(), |
|
|
|
|
dateFormat(requestInfo.getDate()), |
|
|
|
|
requestInfo.getHttpMethod() + " " |
|
|
|
|
+ requestInfo.getPath().substring(WorkContext.getCurrent().getPath().length() - 1), |
|
|
|
|
requestInfo.getPath().substring(WorkContext.getCurrent().getPath().length() - 1), |
|
|
|
|
requestInfo.getStatus(), |
|
|
|
|
simpleTime(requestInfo.getConsume()), |
|
|
|
|
simpleSize(requestInfo.getRequestSize()), |
|
|
|
@ -131,29 +125,9 @@ public class RemoteDesignNetWorkTablePane extends JPanel {
|
|
|
|
|
jToolBar.add(forbid); |
|
|
|
|
jToolBar.add(remove); |
|
|
|
|
jToolBar.add(refresh); |
|
|
|
|
tip(jToolBar); |
|
|
|
|
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." : "")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 清理监听 |
|
|
|
|
*/ |
|
|
|
|