navigatorentry.java

来自「一个专家资料的管理系统」· Java 代码 · 共 47 行

JAVA
47
字号
package cn.com.likai.mms.navigator;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorInput;

import cn.com.likai.mms.model.ITreeEntry;

public class NavigatorEntry implements ITreeEntry{
	private String name;//结点名称
	private ITreeEntry parentEntry;//父结点
	private List children = new ArrayList();//子结点的集合
	//因为集合Collection在使用空值的判判很麻烦,所以这里赋值new Arraylist()
	private Image image;//结点的图标
	
	private IEditorInput editorInput;//结点对应编辑器的EditorInput
	private String editorId;//编缉器对应于plugin.xml中的Id值
	
	//两个构造函数
	public NavigatorEntry(){}
	public NavigatorEntry(String name){this.name = name;}
	
	//以下为字段相对应的Getter/Setter方法,也是实现了ITreeEntry接口中定义的方法
	public IEditorInput getEditorInput(){return this.editorInput;}
	public void setEditorInput(IEditorInput editorInput){this.editorInput = editorInput;}
	
	public String getEditorId(){return this.editorId;}
	public void setEditorId(String editorId){this.editorId = editorId;}
	
	public String getName(){return name;}
	public void setName(String name){this.name = name;}
	
	public ITreeEntry getParentEntry(){return parentEntry;}
	public void setParentEntry(ITreeEntry parentEntry){this.parentEntry = parentEntry;}
	
	public List getChildren(){return children;}
	public void setChildren(List children){this.children = children;}
	public void addChild(ITreeEntry entry){children.add(entry);}
	public boolean hasChild(){return children.size()>0;}
	
	public Image getImage(){return image;}
	public void setImage(Image image){this.image = image;}

}

⌨️ 快捷键说明

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