xmleditor.java

来自「一个eclipse插件源代码。用于web开发」· Java 代码 · 共 68 行

JAVA
68
字号
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/bind/editors/XMLEditor.java,v 1.1.1.1 2004/07/01 09:07:41 wang_j Exp $
 * $Revision: 1.1.1.1 $
 * $Date: 2004/07/01 09:07:41 $
 *
 * ====================================================================
 *
 * The NanJing HopeRun(IT-FOREST) Software License, Version 2.0.0
 *
 * Copyright 2003-2004 by NanJing HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and
 *                        IT Forest Corporation
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 * You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 */
package com.webpump.ui.bind.editors;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.texteditor.ITextEditor;
/**
 * Class for the XMLEditor which used as the member editor of page0 in the BindEditor
 * 
 * @author zhang_tx
 * @version 2.0.0 2004-2-13
 */
public class XMLEditor extends TextEditor {
    /** the colormanager of this editor */
	private ColorManager colorManager;
	
	private ISourceViewer sourceViewer;
    /** to get the Action contributed to the editor 
     *  @param editor    the editor itself 
     *  @param actionID    the id of the action contributed to the editor 
     */
	protected IAction getAction(ITextEditor editor, String actionID) {
		return (editor == null ? null : editor.getAction(actionID));
	}
    /** the contributor of this editor 
     */
	public XMLEditor() {
		super();
		colorManager = new ColorManager();
		setSourceViewerConfiguration(new XMLConfiguration(colorManager));
		setDocumentProvider(new XMLDocumentProvider());
//		getSourceViewer().getTextWidget().addKeyListener(new DelKeyListener(this));
	}
	/** the disposer of this editor 
	 */
	public void dispose() {
		colorManager.dispose();
		super.dispose();
	}
	
	public void setSourceView(){
		sourceViewer = getSourceViewer();		
	}
	
	public ISourceViewer getSourceView(){
		return sourceViewer;		
	}
}

⌨️ 快捷键说明

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