@Test @SuppressWarnings("unchecked") public void testChangeVariables() { Map map = new LinkedHashMap(); map.put("isClosed", false); map.put("toSSH", "data to the ssh server"); sshTerm.changeVariables(new Object(), map); map.put("isClosed", true); map.put("toSSH", "data to the ssh server"); sshTerm.changeVariables(new Object(), map); }
@Override public synchronized void changeVariables(Object source, Map<String,Object> variables) { if (variables.containsKey("isClosed")) { isClosed = ((Boolean)variables.get("isClosed")); if (isClosed){ channel.close(true); getApplication().getMainWindow().removeWindow(sshWindow); requestRepaint(); } } if (variables.containsKey("toSSH") && !isReadOnly()) { final String bytesToSSH = (String) variables.get("toSSH"); try { dumpContents = st.handle(bytesToSSH, true); requestRepaint(); } catch (IOException e) { e.printStackTrace(); } } if (variables.containsKey("isFocused")) { boolean isFocused = ((Boolean)variables.get("isFocused")); focus = !isFocused; } }
SSHTerminal extends AbstractComponent { @Override public synchronized void changeVariables(Object source, Map<String,Object> variables) { if (variables.containsKey("isClosed")) { isClosed = ((Boolean)variables.get("isClosed")); if (isClosed){ channel.close(true); getApplication().getMainWindow().removeWindow(sshWindow); requestRepaint(); } } if (variables.containsKey("toSSH") && !isReadOnly()) { final String bytesToSSH = (String) variables.get("toSSH"); try { dumpContents = st.handle(bytesToSSH, true); requestRepaint(); } catch (IOException e) { e.printStackTrace(); } } if (variables.containsKey("isFocused")) { boolean isFocused = ((Boolean)variables.get("isFocused")); focus = !isFocused; } } }
SSHTerminal extends AbstractComponent { @Override public synchronized void changeVariables(Object source, Map<String,Object> variables) { if (variables.containsKey("isClosed")) { isClosed = ((Boolean)variables.get("isClosed")); if (isClosed){ channel.close(true); getApplication().getMainWindow().removeWindow(sshWindow); requestRepaint(); } } if (variables.containsKey("toSSH") && !isReadOnly()) { final String bytesToSSH = (String) variables.get("toSSH"); try { dumpContents = st.handle(bytesToSSH, true); requestRepaint(); } catch (IOException e) { e.printStackTrace(); } } if (variables.containsKey("isFocused")) { boolean isFocused = ((Boolean)variables.get("isFocused")); focus = !isFocused; } } SSHTerminal(SSHWindow sshWindow, ClientSession session, int width, int height); }
SSHTerminal extends AbstractComponent { @Override public synchronized void changeVariables(Object source, Map<String,Object> variables) { if (variables.containsKey("isClosed")) { isClosed = ((Boolean)variables.get("isClosed")); if (isClosed){ channel.close(true); getApplication().getMainWindow().removeWindow(sshWindow); requestRepaint(); } } if (variables.containsKey("toSSH") && !isReadOnly()) { final String bytesToSSH = (String) variables.get("toSSH"); try { dumpContents = st.handle(bytesToSSH, true); requestRepaint(); } catch (IOException e) { e.printStackTrace(); } } if (variables.containsKey("isFocused")) { boolean isFocused = ((Boolean)variables.get("isFocused")); focus = !isFocused; } } SSHTerminal(SSHWindow sshWindow, ClientSession session, int width, int height); boolean close(); @Override synchronized void paintContent(PaintTarget target); @Override synchronized void changeVariables(Object source, Map<String,Object> variables); }
SSHTerminal extends AbstractComponent { @Override public synchronized void changeVariables(Object source, Map<String,Object> variables) { if (variables.containsKey("isClosed")) { isClosed = ((Boolean)variables.get("isClosed")); if (isClosed){ channel.close(true); getApplication().getMainWindow().removeWindow(sshWindow); requestRepaint(); } } if (variables.containsKey("toSSH") && !isReadOnly()) { final String bytesToSSH = (String) variables.get("toSSH"); try { dumpContents = st.handle(bytesToSSH, true); requestRepaint(); } catch (IOException e) { e.printStackTrace(); } } if (variables.containsKey("isFocused")) { boolean isFocused = ((Boolean)variables.get("isFocused")); focus = !isFocused; } } SSHTerminal(SSHWindow sshWindow, ClientSession session, int width, int height); boolean close(); @Override synchronized void paintContent(PaintTarget target); @Override synchronized void changeVariables(Object source, Map<String,Object> variables);  }