Browse Source

Merge pull request #218 in DESIGN/design from ~HZZZ/design61:release/10.0 to release/10.0

* commit '7e5c6599a5c43b5e158e6392e8fdd39eb0c62cf3':
  disconnecte
  .
master
Hzzz 7 years ago
parent
commit
ae72bb2d73
  1. 11
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  2. 7
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

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

@ -1,8 +1,10 @@
package com.fr.design.mainframe.socketio;
import com.fr.decision.webservice.utils.DecisionServiceConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.loghandler.DesignerLogHandler;
import com.fr.env.operator.socket.SocketInfoOperator;
import com.fr.general.Inter;
import com.fr.general.LogRecordTime;
import com.fr.general.LogUtils;
import com.fr.log.FineLoggerFactory;
@ -15,6 +17,8 @@ import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URI;
@ -54,6 +58,13 @@ public class DesignerSocketIO {
String uri = getSocketUri(current);
socketIO = Optional.of(IO.socket(new URI(uri)));
socketIO.get().on(WorkspaceConstants.WS_LOGRECORD, printLog);
socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
@Override
public void call(Object... objects) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Fine-Designer_Basic_Remote_Disconnected"}),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
}
});
socketIO.get().connect();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

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

@ -51,8 +51,6 @@ import com.fr.design.mainframe.loghandler.DesignerLogAppender;
import com.fr.design.mainframe.loghandler.DesignerLogImpl;
import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.socketio.DesignerSocketIO;
import com.fr.env.operator.socket.FineSocketInfoOperator;
import com.fr.env.operator.socket.SocketInfoOperator;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.parameter.FormParameterReader;
import com.fr.design.parameter.ParameterPropertyPane;
@ -100,8 +98,6 @@ import com.fr.stable.script.ValueConverter;
import com.fr.stable.xml.ObjectTokenizer;
import com.fr.stable.xml.ObjectXMLWriterFinder;
import com.fr.start.BBSGuestPaneProvider;
import com.fr.workspace.base.WorkspaceKey;
import com.fr.workspace.pool.WorkPRCRegister;
import com.fr.xml.ReportXMLUtils;
import java.awt.Image;
@ -413,8 +409,5 @@ public class DesignerActivator extends Activator implements Prepare {
public void prepare() {
addMutable(InterMutableKey.Path, "com/fr/design/i18n/main", "com/fr/design/i18n/chart");
addMutable(WorkspaceKey.RPC, WorkPRCRegister.wrap(SocketInfoOperator.class, new FineSocketInfoOperator()));
}
}
Loading…
Cancel
Save