亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? console.groovy

?? Groovy動態語言 運行在JVM中的動態語言 可以方便的處理業務邏輯變化大的業務
?? GROOVY
?? 第 1 頁 / 共 2 頁
字號:
package groovy.ui

import groovy.swing.SwingBuilder
import groovy.inspect.swingui.ObjectBrowser

import java.awt.BorderLayout
import java.awt.EventQueue
import java.awt.Color
import java.awt.Font
import java.awt.Insets
import java.awt.Toolkit
import java.awt.event.KeyEvent
import java.io.PrintWriter
import java.io.StringWriter
import java.util.EventObject

import javax.swing.*
import javax.swing.text.*
import javax.swing.event.*

import org.codehaus.groovy.runtime.InvokerHelper

/**
 * Groovy Swing console.
 *
 * Allows user to interactively enter and execute Groovy. 
 *
 * @author Danno Ferrin
 * @author Dierk Koenig, changed Layout, included Selection sensitivity, included ObjectBrowser
 * @author Alan Green more features: history, System.out capture, bind result to _
 */
class Console implements CaretListener {

	// Whether or not std output should be captured to the console
	def captureStdOut = true

	// Maximum size of history
	int maxHistory = 10
	
	// Maximum number of characters to show on console at any time
	int maxOutputChars = 10000

	// UI
    SwingBuilder swing
    JFrame frame
    JTextArea inputArea
    JTextPane outputArea
    JLabel statusLabel
    JDialog runWaitDialog
    
    // Styles for output area
    Style promptStyle;
    Style commandStyle;
    Style outputStyle;
    Style resultStyle;
    
	// Internal history
    List history = []
    int historyIndex = 1 // valid values are 0..history.length()

	// Current editor state
    boolean dirty
    int textSelectionStart  // keep track of selections in inputArea
    int textSelectionEnd
    def scriptFile

	// Running scripts
	GroovyShell shell
    int scriptNameCounter = 0
    def systemOutInterceptor
    def runThread = null
    

    static void main(args) {
        def console = new Console()
        console.run()
    }
    
    Console() {
    	shell = new GroovyShell()
    }
    
    Console(Binding binding) {
    	shell = new GroovyShell(binding)
    }
    
    Console(ClassLoader parent, Binding binding) {
    	shell = new GroovyShell(parent,binding)	
    }

    void run() {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
        // if menu modifier is two keys we are out of luck as the javadocs
        // indicates it returns "Control+Shift" instead of "Control Shift"
        def menuModifier = KeyEvent.getKeyModifiersText(
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()).toLowerCase() + ' '

        swing = new SwingBuilder()
        frame = swing.frame(
            title:'GroovyConsole',
            location:[100,100],
            size:[500,400],
            defaultCloseOperation:javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE) {
            def newFileAction = action(
                name:'New File', closure: this.&fileNewFile, mnemonic: 'N', 
                accelerator: menuModifier + 'Q'
            )
            def newWindowAction = action(
                name:'New Window', closure: this.&fileNewWindow, mnemonic: 'W'
            )
            def openAction = action(
                name:'Open', closure: this.&fileOpen, mnemonic: 'O', accelerator: menuModifier + 'O'
            )
            def saveAction = action(
                name:'Save', closure: this.&fileSave, mnemonic: 'S', accelerator: menuModifier + 'S'
            )
            def exitAction = action(
                name:'Exit', closure: this.&exit, mnemonic: 'x', accelerator: 'alt F4'
            )	            
            def historyPrevAction = action(
                name:'Previous', closure: this.&historyPrev, mnemonic: 'P', accelerator: 'ctrl P'
            )            
            def historyNextAction = action(
            	name: 'Next', closure: this.&historyNext, mnemonic: 'N', accelerator: 'ctrl N'
            )            
            def clearOutputAction = action(
                name:'Clear Output', closure: this.&clearOutput, mnemonic: 'l', keyStroke: 'ctrl W',
                accelerator: 'ctrl W'
            )
            def runAction = action(
                name:'Run', closure: this.&runScript, mnemonic: 'R', keyStroke: 'ctrl ENTER',
                accelerator: 'ctrl R'
            )
            def inspectLastAction = action(
                name:'Inspect Last', closure: this.&inspectLast, mnemonic: 'I', keyStroke: 'ctrl I',
                accelerator: 'ctrl I'
            )
            def inspectVariablesAction = action(
            	name:'Inspect Variables', closure: this.&inspectVariables, mnemonic: 'V', keyStroke: 'ctrl J',
                accelerator: 'ctrl J'
            )
            def captureStdOutAction = action(
            	name:'Capture Standard Output', closure: this.&captureStdOut, mnemonic: 'C'
            )
            def largerFontAction = action(
                name:'Larger Font', closure: this.&largerFont, mnemonic: 'L', keyStroke: 'alt shift L',
                accelerator: 'alt shift L'
            )
            def smallerFontAction = action(
                name:'Smaller Font', closure: this.&smallerFont, mnemonic: 'S', keyStroke: 'alt shift S',
                accelerator: 'alt shift S'
            )
            def aboutAction = action(name:'About', closure: this.&showAbout, mnemonic: 'A')
            menuBar {
                menu(text:'File', mnemonic: 'F') {
                    menuItem() { action(newFileAction) }
                    menuItem() { action(newWindowAction) }
                    menuItem() { action(openAction) }
                    separator()
                    menuItem() { action(saveAction) }
                    separator()
                    menuItem() { action(exitAction) }
                }
                menu(text:'Edit', mnemonic: 'E') {
                	menuItem() { action(historyNextAction) }
                	menuItem() { action(historyPrevAction) }
                	separator()
                	menuItem() { action(clearOutputAction) }
                }
                menu(text:'Actions', mnemonic: 'A') {
                    menuItem() { action(runAction) }
                    menuItem() { action(inspectLastAction) }
                    menuItem() { action(inspectVariablesAction) }
                    separator()
                    checkBoxMenuItem(selected: captureStdOut) { action(captureStdOutAction) }
                    separator()
                    menuItem() { action(largerFontAction) }
                    menuItem() { action(smallerFontAction) }
                }
                menu(text:'Help', mnemonic: 'H') {
                    menuItem() { action(aboutAction) }
                }
            }
            
            borderLayout()
            
            splitPane(id:'splitPane', resizeWeight:0.50F, 
            	orientation:JSplitPane.VERTICAL_SPLIT, constraints: BorderLayout.CENTER) 
            {
                scrollPane {
                    inputArea = textArea(
                        margin: new Insets(3,3,3,3), font: new Font('Monospaced',Font.PLAIN,12)
                    ) { action(runAction) }
                }
                scrollPane {
                    outputArea = textPane(editable:false, background: new Color(255,255,218))
                    addStylesToDocument(outputArea)
                }
            }
            
            statusLabel = label(id:'status', text: 'Welcome to the Groovy.', constraints: BorderLayout.SOUTH,
            	border: BorderFactory.createLoweredBevelBorder())
        }   // end of frame
        
        runWaitDialog = swing.dialog(title: 'Groovy executing', owner: frame, modal: true) {
        	//boxLayout(axis: BoxLayout.Y_AXIS)  // todo mittie: dialog.setLayout -> dialog.contentPane.setLayout()
        	label(text: "Groovy is now executing. Please wait.", 
        		border: BorderFactory.createEmptyBorder(10, 10, 10, 10), alignmentX: 0.5f)
        	button(action: action(name: 'Interrupt', closure: this.&confirmRunInterrupt),
	        	border: BorderFactory.createEmptyBorder(10, 10, 10, 10), alignmentX: 0.5f)
        } // end of runWaitDialog

        // add listeners
        frame.windowClosing = this.&exit
        inputArea.addCaretListener(this)
        inputArea.document.undoableEditHappened = { setDirty(true) }
        
        systemOutInterceptor = new SystemOutputInterceptor(this.&notifySystemOut)
        systemOutInterceptor.start();
        
        bindResults()
        
        frame.show()
        SwingUtilities.invokeLater({inputArea.requestFocus()});
    }

	void addStylesToDocument(JTextPane outputArea) {
        StyledDocument doc = outputArea.getStyledDocument();

        Style defStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);

        Style regular = doc.addStyle("regular", defStyle);
        StyleConstants.setFontFamily(regular, "Monospaced")

        promptStyle = doc.addStyle("prompt", regular)
        StyleConstants.setForeground(promptStyle, Color.BLUE)

        commandStyle = doc.addStyle("command", regular);
        StyleConstants.setForeground(commandStyle, Color.MAGENTA)

        outputStyle = regular 
        
        resultStyle = doc.addStyle("result", regular)
        StyleConstants.setBackground(resultStyle, Color.BLUE)
        StyleConstants.setBackground(resultStyle, Color.YELLOW)
    }
    
    void addToHistory(record) {
    	history.add(record)
    	// history.size here just retrieves method closure
    	if (history.size() > maxHistory) {
    		history.remove(0)
    	}
    	// history.size doesn't work here either
    	historyIndex = history.size()
    }
    
	// Append a string to the output area
    void appendOutput(text, style){
    	def doc = outputArea.styledDocument
        doc.insertString(doc.length, text, style)
        
        // Ensure we don't have too much in console (takes too much memory)
        if (doc.length > maxOutputChars) {
        	doc.remove(0, doc.length - maxOutputChars)
        }
    }

	// Append a string to the output area on a new line
    void appendOutputNl(text, style){
    	def doc = outputArea.styledDocument
    	def len = doc.length
    	if (len > 0 && doc.getText(len - 1, 1) != "\n") {
    		appendOutput("\n", style);
    	} 
    	appendOutput(text, style)
    }
    
    // Return false if use elected to cancel
    boolean askToSaveFile() {
    	if (scriptFile == null || !dirty) {
    		return true
    	}
        switch (JOptionPane.showConfirmDialog(frame,
            "Save changes to " + scriptFile.name + "?",
            "GroovyConsole", JOptionPane.YES_NO_CANCEL_OPTION))
        {
            case JOptionPane.YES_OPTION:
                return fileSave()
            case JOptionPane.NO_OPTION:
            	return true
            default:
            	return false
        }
    }

    private static void beep() {
    	Toolkit.defaultToolkit.beep()
    }
    
    // Binds the "_" and "__" variables in the shell
    void bindResults() {
		shell.setVariable("_", getLastResult()) // lastResult doesn't seem to work

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲电影视频在线| 亚洲国产一区二区视频| 国产精品久久久久国产精品日日| 国产精品久久免费看| 亚洲国产欧美另类丝袜| 韩国视频一区二区| 色999日韩国产欧美一区二区| 91精品国产91久久久久久一区二区 | 激情成人综合网| 91首页免费视频| 欧美videos中文字幕| 1000部国产精品成人观看| 日本女优在线视频一区二区| 成人国产免费视频| 日韩免费一区二区| 亚洲综合一区在线| 高清免费成人av| 日韩视频免费观看高清完整版 | 亚洲一区二区三区在线看| 国产一区二区精品久久| 欧美日韩一区二区在线观看| 国产色产综合色产在线视频 | 亚洲欧美日韩国产中文在线| 蜜臀av国产精品久久久久| av亚洲精华国产精华精华 | 粉嫩绯色av一区二区在线观看 | 99精品视频在线免费观看| 日韩亚洲电影在线| 一区二区视频免费在线观看| 国产精品一线二线三线精华| 日韩欧美一区中文| 亚洲午夜免费视频| 91福利视频网站| 国产精品美女视频| 国产麻豆精品在线| 亚洲精品一区二区精华| 日本大胆欧美人术艺术动态| 欧美色网站导航| 夜色激情一区二区| 97国产一区二区| 国产精品第13页| 成人精品国产免费网站| 国产日韩欧美精品在线| 国产精品羞羞答答xxdd| 久久久国产一区二区三区四区小说| 美女免费视频一区二区| 日韩精品一区二区三区四区视频| 日本中文字幕一区| 日韩欧美成人一区二区| 韩国视频一区二区| 国产目拍亚洲精品99久久精品| 国产一区二区三区| 国产精品女同互慰在线看| 国产成都精品91一区二区三| 国产精品久久久久久亚洲毛片| 成人在线综合网站| 国产精品国产三级国产aⅴ中文| 东方aⅴ免费观看久久av| 国产精品青草久久| 在线视频国内自拍亚洲视频| 亚洲一区免费在线观看| 欧美怡红院视频| 中文字幕中文字幕中文字幕亚洲无线| 国产中文一区二区三区| 久久九九99视频| 不卡的av中国片| 亚洲精品一二三| 欧美日韩精品欧美日韩精品| 日韩精品国产欧美| 久久综合九色欧美综合狠狠| 国产成人自拍高清视频在线免费播放| 国产日韩欧美亚洲| 日本韩国欧美国产| 奇米在线7777在线精品| 久久一二三国产| av电影天堂一区二区在线观看| 玉米视频成人免费看| 911国产精品| 国产91丝袜在线观看| 一区二区三区在线高清| 欧美电影精品一区二区| 成人免费看视频| 亚洲va国产va欧美va观看| 精品国产99国产精品| 波多野结衣亚洲| 免费人成在线不卡| 亚洲欧洲一区二区在线播放| 欧美一区二区在线观看| 成人性生交大片免费看中文 | 午夜a成v人精品| 久久久久久99久久久精品网站| a亚洲天堂av| 毛片基地黄久久久久久天堂| 中文字幕一区二区视频| 欧美va亚洲va在线观看蝴蝶网| 9色porny自拍视频一区二区| 日本最新不卡在线| 亚洲欧洲无码一区二区三区| 日韩免费一区二区三区在线播放| 99久久夜色精品国产网站| 久久精品国产久精国产爱| 一区二区三区四区国产精品| 久久久www成人免费无遮挡大片| 欧美亚洲综合在线| 99视频一区二区| 国产一区二区三区四| 视频在线在亚洲| 亚洲精品伦理在线| 国产日韩欧美制服另类| 欧美一区二区免费视频| 欧美视频一区二区三区在线观看 | 日韩一卡二卡三卡四卡| 色婷婷综合久久久久中文一区二区 | 91丨porny丨中文| 韩国三级电影一区二区| 日韩av电影天堂| 亚洲国产精品久久久久秋霞影院| 国产精品美女www爽爽爽| 26uuuu精品一区二区| 日韩精品一区二区三区在线观看 | youjizz久久| 国产福利一区二区三区视频在线 | 亚洲综合激情另类小说区| 蜜桃视频在线观看一区| 国产精品福利一区二区| 久久久夜色精品亚洲| 日韩精品一区二区三区在线| 538prom精品视频线放| 欧美视频中文字幕| 在线观看区一区二| 在线区一区二视频| 99久久国产综合精品色伊| 丰满少妇久久久久久久| 97国产一区二区| www.日韩精品| 99久久综合国产精品| 99国产精品久久久久久久久久久| 成人综合在线视频| av在线不卡免费看| 99精品欧美一区| 色老汉av一区二区三区| 欧美性猛交xxxxxxxx| 欧美三级视频在线观看| 欧美巨大另类极品videosbest| 欧美日韩精品一区二区三区四区| 欧美日韩国产首页在线观看| 欧美日韩精品一区二区在线播放| 666欧美在线视频| 欧美成人精品二区三区99精品| 精品国产一区二区三区久久影院 | 国产日韩综合av| 日本一区二区久久| 亚洲欧美成aⅴ人在线观看| 一区二区三区在线视频观看 | 亚洲一级在线观看| 欧美aaaaaa午夜精品| 国产真实乱对白精彩久久| 成人高清av在线| 国产精品久久久久久久久免费丝袜 | 9i看片成人免费高清| 欧美中文字幕一二三区视频| 欧美日韩激情在线| 久久综合久久鬼色中文字| 亚洲色图视频网| 日本亚洲最大的色成网站www| 久久精品国产精品亚洲综合| av电影天堂一区二区在线| 欧美精品在线视频| 国产精品人成在线观看免费| 亚洲444eee在线观看| 丁香激情综合国产| 欧美日韩的一区二区| 久久久青草青青国产亚洲免观| 一区二区三区中文在线| 久久99精品一区二区三区| 色综合久久综合网| 久久久久久久网| 性做久久久久久免费观看欧美| 国产精品亚洲第一区在线暖暖韩国| 日本二三区不卡| 国产色爱av资源综合区| 国产精品嫩草影院av蜜臀| 五月天久久比比资源色| 国产福利不卡视频| 制服丝袜亚洲播放| 亚洲精选一二三| 成人一区在线观看| 欧美电影精品一区二区| 亚洲福利一区二区| 92国产精品观看| 久久精品综合网| 美国十次了思思久久精品导航| 91精品福利在线| 国产精品欧美一区二区三区| 精品在线你懂的| 91精品国产综合久久精品app| 日韩理论在线观看| 成人午夜视频免费看| 久久久精品日韩欧美| 麻豆freexxxx性91精品|