deviceeditorconfigelement.java

来自「配置文件」· Java 代码 · 共 84 行

JAVA
84
字号
/**
 * Copyright (c) 2003-2006 Craig Setera
 * All Rights Reserved.
 * Licensed under the Eclipse Public License - v 1.0
 * For more information see http://www.eclipse.org/legal/epl-v10.html
 */
package eclipseme.ui.internal.devices;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.ui.IActionDelegate;

/**
 * Wrapper around an IConfigurationElement instance for a
 * deviceEditor extension point extension.
 * <p />
 * Copyright (c) 2003-2006 Craig Setera<br>
 * All Rights Reserved.<br>
 * Licensed under the Eclipse Public License - v 1.0<p/>
 * <br>
 * $Revision: 1.1 $
 * <br>
 * $Date: 2006/02/25 01:55:03 $
 * <br>
 * @author Craig Setera
 */
public class DeviceEditorConfigElement {
	private IConfigurationElement element;
	private IActionDelegate delegate;
	/**
	 * Construct a new wrapper instance.
	 * 
	 * @param editorElement
	 */
	public DeviceEditorConfigElement(IConfigurationElement editorElement) {
		super();
		element = editorElement;
	}
	
	/**
	 * Return an instance of the action delegate for this device editor.
	 * 
	 * @return
	 * @throws CoreException
	 */
	public IActionDelegate getActionDelegate() 
		throws CoreException 
	{
		if (delegate == null) {
			delegate = (IActionDelegate) element.createExecutableExtension("class"); 
		}
		
		return delegate;
	}

	/**
	 * Return the identifier of this extension.
	 * 
	 * @return
	 */
	public String getIdentifier() {
		return element.getAttribute("id");
	}
	
	/**
	 * Return the name of this extension.
	 * 
	 * @return
	 */
	public String getName() {
		return element.getAttribute("name");
	}
	
	/**
	 * Return the class of the device for which this editor applies.
	 * 
	 * @return
	 */
	public String getDeviceClass() 
	{
		return element.getAttribute("deviceClass");
	}
}

⌨️ 快捷键说明

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