View view = getView(evt); Buffer buffer = view.getBuffer(); String command = GUIUtilities.inputProperty(view,"execute", "execute.cmd"); if(command == null) return; StringBuffer buf = new StringBuffer(); for(int i = 0; i < command.length(); i++) { switch(command.charAt(i)) { case '%': if(i != command.length() - 1) { switch(command.charAt(++i)) { case 'u': buf.append(buffer.getPath()); break; case 'p': buf.append(buffer.getFile() .getPath()); break; default: buf.append('%'); break; } break; } default: buf.append(command.charAt(i)); } } try { String cmd = buf.toString(); Process proc = Runtime.getRuntime().exec(cmd); proc.getOutputStream().close(); new CommandOutput(view,cmd,proc); } catch(IOException io) { Object[] error = { io.toString() }; GUIUtilities.error(view,"ioerror",error); }
new Console(getView(evt),null);
	public void actionPerformed(ActionEvent evt)	{		View view = getView(evt);		Buffer buffer = view.getBuffer();		String command = GUIUtilities.inputProperty(view,"execute",			"execute.cmd");		if(command == null)			return;		StringBuffer buf = new StringBuffer();		for(int i = 0; i < command.length(); i++)		{			switch(command.charAt(i))			{			case '%':				if(i != command.length() - 1)				{					switch(command.charAt(++i))					{					case 'u':						buf.append(buffer.getPath());						break;					case 'p':						buf.append(buffer.getFile()							.getPath());						break;					default:						buf.append('%');						break;					}					break;				}			default:				buf.append(command.charAt(i));			}		}		try		{			String cmd = buf.toString();			Process proc = Runtime.getRuntime().exec(cmd);			proc.getOutputStream().close();			new CommandOutput(view,cmd,proc);		}		catch(IOException io)		{			Object[] error = { io.toString() };			GUIUtilities.error(view,"ioerror",error);		}	}