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

📄 settingsreloader.java

📁 用java 编写的源码开放的文本编辑器。有很多有用的特性
💻 JAVA
字号:
/* * SettingsReloader.java - Utility class reloads macros and modes when necessary * Copyright (C) 2001 Slava Pestov * * 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. */package org.gjt.sp.jedit;import java.io.File;import org.gjt.sp.jedit.msg.VFSUpdate;import org.gjt.sp.jedit.search.*;class SettingsReloader implements EBComponent{	public void handleMessage(EBMessage msg)	{		if(msg instanceof VFSUpdate)		{			VFSUpdate vmsg = (VFSUpdate)msg;			maybeReload(vmsg.getPath());		}	}	private void maybeReload(String path)	{		// XXX: does this really belong here?		SearchFileSet fileset = SearchAndReplace.getSearchFileSet();		if(fileset instanceof DirectoryListSet)		{			DirectoryListSet dirset = (DirectoryListSet)fileset;			if(path.startsWith(dirset.getDirectory()))				dirset.invalidateCachedList();		}		String jEditHome = jEdit.getJEditHome();		String settingsDirectory = jEdit.getSettingsDirectory();		// On Windows and MacOS, path names are case insensitive		if(OperatingSystem.isDOSDerived() || OperatingSystem.isMacOS())		{			path = path.toLowerCase();			if(jEditHome != null)				jEditHome = jEditHome.toLowerCase();			if(settingsDirectory != null)				settingsDirectory = settingsDirectory.toLowerCase();		}		if(jEditHome != null && path.startsWith(jEditHome))			path = path.substring(jEditHome.length());		else if(settingsDirectory != null && path.startsWith(settingsDirectory))			path = path.substring(settingsDirectory.length());		else		{			// not in settings directory or jEdit home directory.			// no need to reload anything.			return;		}		if(path.startsWith(File.separator) || path.startsWith("/"))			path = path.substring(1);		if(path.startsWith("macros"))			Macros.loadMacros();		else if(path.startsWith("modes") && (path.endsWith(".xml")			|| path.endsWith("catalog")))			jEdit.reloadModes();	}}

⌨️ 快捷键说明

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