diff src/org/tn5250j/framework/tn5250/tnvt.java @ 10:e773d0952613 tn5250

adding tn5250 files
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 16:11:14 -0700
parents 3b760b39962a
children f3b3bbd227b8
line wrap: on
line diff
--- a/src/org/tn5250j/framework/tn5250/tnvt.java	Thu May 22 15:42:48 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/tnvt.java	Thu May 22 16:11:14 2014 -0700
@@ -83,7 +83,6 @@
 import com.five_ten_sg.connectbot.service.TerminalBridge;
 import com.five_ten_sg.connectbot.service.TerminalManager;
 
-import org.tn5250j.Session5250;
 import org.tn5250j.TN5250jConstants;
 import org.tn5250j.encoding.CharMappings;
 import org.tn5250j.encoding.ICodePage;
@@ -133,7 +132,7 @@
 	private int readType;
 	private boolean enhanced = true;
 	private boolean cursorOn = false;
-	private String session = "";
+	private String hostname = "";
 	private int port = 23;
 	private boolean connected = false;
 	private boolean support132 = true;
@@ -166,10 +165,11 @@
 	private final TN5250jLogger log = TN5250jLogFactory.getLogger(this.getClass());
 
 	/**
-	 * @param session
 	 * @param screen52
-	 * @param type
+	 * @param enhanced
 	 * @param support132
+     * @param bridge
+     * @param manager
 	 */
 	public tnvt(Screen5250 screen52, boolean enhanced, boolean support132, TerminalBridge bridge, TerminalManager manager) {
 		if (log.isInfoEnabled()) {
@@ -203,9 +203,15 @@
 		baosrsp = new ByteArrayOutputStream();
 	}
 
+    public void showURL(String url) {
+        if (url.indexOf("://") < 0) url = "http://" + url;
+        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+        manager.startActivity(intent);
+    }
+
 	public String getHostName() {
 
-		return session;
+		return hostname;
 	}
 
 
@@ -257,12 +263,12 @@
 
 	public final boolean connect() {
 
-		return connect(session, port);
+		return connect(hostname, port);
 
 	}
 
 
-	public final boolean connect(String s, int port) {
+	public final boolean connect(String hostname, int port) {
 
 		// We will now see if there are any bypass signon parameters to be
 		//    processed. The system properties override these parameters so
@@ -283,8 +289,8 @@
 
 
 		try {
-			session = s;
-			this.port = port;
+			this.hostname = hostname;
+			this.port     = port;
 
 			try {
 				screen52.getOIA().setInputInhibited(ScreenOIA.INPUTINHIBITED_SYSTEM_WAIT,
@@ -297,7 +303,7 @@
 			//smk - For SSL compability
 			SocketConnector sc = new SocketConnector();
 			if (sslType != null) sc.setSSLType(sslType);
-			sock = sc.createSocket(s, port, bridge, manager);
+			sock = sc.createSocket(hostname, port, bridge, manager);
 
 			if (sock == null) {
 				log.warn("I did not get a socket");