⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 make_bug_report.bsh

📁 用java 编写的源码开放的文本编辑器。有很多有用的特性
💻 BSH
字号:
/* * Make_Bug_Report.bsh - a BeanShell macro script for the * jEdit text editor -  creates a new buffer with installation and * error information extracted from jEdit's Activity Log. * Copyright (C) 2001 John Gellene * jgellene@nyc.rr.com * http://community.jedit.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * * $Id: Make_Bug_Report.bsh,v 1.2 2001/11/06 17:57:35 jgellene Exp $ * * Checked for jEdit 4.0 API * */makeBugReport(){	Log.flushStream();	path = jEdit.getSettingsDirectory() + File.separator		+ "activity.log";	try	{		file = new FileInputStream(path);		reader = new BufferedReader(new InputStreamReader(file));	}	catch(IOException e)	{		Macros.error(view, "Error opening Activity Log.");		return;	}	report = new StringBuffer();	report.append("Activity log entries that might be useful in a bug report:\n\n");	lastError = new StringBuffer();	insideError = false;	startupDone = false;	activityLogHeaderLines = 9;	try	{		for(i = 0; i < activityLogHeaderLines; ++i)		{			report.append(reader.readLine()).append('\n');		}		while((line = reader.readLine()) != null)		{			if(!startupDone &&				(line.startsWith("[message] jEdit:")					|| line.startsWith("[notice] jEdit:")					|| line.startsWith("[notice] JARClassLoader:")))			{				report.append(line).append('\n');				if(line.equals("[message] jEdit: Startup complete"))				{					startupDone = true;				}			}			else if(line.startsWith("[error]"))			{				if(!insideError)				{					lastError.setLength(0);					insideError = true;				}				lastError.append(line).append('\n');			}			else				insideError = false;		}		reader.close();	}	catch(IOException e)	{		Macros.error(view, "Error reading Activity Log");	}	report.append(lastError.toString());	newBuffer = jEdit.newFile(view);	newBuffer.insert(0, report.toString());}makeBugReport();/*jEdit macro index data (DocBook format)  <listitem>    <para><filename>Make_Bug_Report.bsh</filename></para>    <abstract><para>      Creates a new buffer with installation and error information	  extracted from the Activity Log.    </para></abstract>	<para>	  The macro extracts initial messages written to the Activity Log	  describing the user's operating system, JDK, jEdit version and	  installed plugins. It then appends the last set of error messages	  written to the Activity Log.  The new text buffer can be saved and	  attached to an email message or a bug report made on SourceForge.	</para>  </listitem>*/// end Make_Bug_Report.bsh

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -