Code example for PrintWriter

Methods: println

0
	private int extractRobot() { 
		repositoryManager.refresh();
		int rv = 0;
 
		output = new StringWriter();
		PrintWriter out = new PrintWriter(output);
 
		out.println("Robot Extract");
		List<IRobotSpecItem> selectedRobots = getRobotSelectionPanel().getSelectedRobots();
		IRobotSpecItem spec = selectedRobots.get(0);
 
		try { 
			WindowUtil.setStatusWriter(out);
 
			rv = repositoryManager.extractJar(spec);
			WindowUtil.setStatusWriter(null); 
			WindowUtil.setStatus(""); 
			if (rv == 0) {
				out.println("Robot extracted successfully.");
			} else if (rv == -1) {
				out.println("Cancelled.");
			} 
		} catch (Exception e) {
			out.println(e);
			rv = 8;
		} 
		return rv;
	} 
}