📄 cascade_jedit_windows.bsh
字号:
/* * Cascade_jEdit_Windows.bsh - a BeanShell macro script for the * jEdit text editor - Cascades all view and floating plugin * windows from the upper-left corner of the desktop * 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: Cascade_jEdit_Windows.bsh,v 1.2 2001/11/06 17:57:35 jgellene Exp $ * * Notes on use: * * The macro is suited for use at or immediately after startup if the screen * size or resolution has changed since the last editing session. It will also * rearrange multiple view and their associated floating plugin windows * during an editing session. It will not rearrange modeless dialog windows. * * Checked for jEdit 4.0 API * */void cascadeJEditWindows(int startOffset, int incrOffset, int maxWindows){ offsetFromUpperLeft = startOffset; maxOffset = startOffset + (incrOffset * (maxWindows - 1)); if(startOffset < 0 || incrOffset < 0 || maxOffset < 0) { JOptionPane.showMessageDialog(null, "Macro \"Cascade_jEdit_Windows\" called with illegal values.", "jEdit", JOptionPane.ERROR_MESSAGE); return; } if(JOptionPane.showConfirmDialog(null, "Rearrange all jEdit windows?", "jEdit", JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) return; views = jEdit.getViews(); /* We have to move all views and floating plugin windows. * Each view only knows about floating windows * attached to its own DockingWindowManager, * and the entry tables for each manager are private, * so we will repeatedly check against a list of all * dockable windows. */ for(i = 0; i < views.length; ++i) { thisView = views[i]; thisView.setLocation(offsetFromUpperLeft, offsetFromUpperLeft); offsetFromUpperLeft += incrOffset; // stack windows in groups (in case you've been really busy) offsetFromUpperLeft %= maxOffset; manager = thisView.getDockableWindowManager(); dockableWindowNames = EditBus.getNamedList("DOCKABLE_WINDOWS"); for(j = 0; j < dockableWindowNames.length; ++j) { win = manager.getDockable(dockableWindowNames[j]); if(win == null) continue; c = win.getComponent().getParent(); // check if it's floating if(c instanceof DockableWindowContainer.TabbedPane) continue; // find the top-level window topLevelWindow = null; while(c != null) { topLevelWindow = c; c = topLevelWindow.getParent(); } if(topLevelWindow != null) { topLevelWindow.setLocation(offsetFromUpperLeft, offsetFromUpperLeft); offsetFromUpperLeft += incrOffset; offsetFromUpperLeft %= maxOffset; } } }}// here are some reasonable values for window offsetscascadeJEditWindows(20, 20, 10);/* Macro index data (in DocBook format)<listitem> <para><filename>Cascade_jEdit_Windows.bsh</filename></para> <abstract><para> Rearranges view and floating plugin windows. </para></abstract> <para> The windows are arranged in an overlapping <quote>cascade</quote> pattern beginning near the upper left corner of the display. </para></listitem>*/// end of Cascade_jEdit_Windows.bsh
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -