/**
* Դ�������ƣ�TextEditorInput.java
* �������Ȩ���������ӹɷ�����˾ ��Ȩ����
* ϵͳ���ƣ�JRES Studio
* ģ�����ƣ�com.hundsun.ares.studio.jres.database.ui
* ����˵����$desc
* ����ĵ���
* ���ߣ�
*/
package com.hundsun.ares.studio.ui.editor.text;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
/**
* @author gongyf
*
*/
public class TextEditorInput implements IEditorInput {
private String text = StringUtils.EMPTY;
public TextEditorInput() {
}
/**
* @param text
*/
public TextEditorInput(String text) {
super();
this.text = text;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@Override
public Object getAdapter(Class adapter) {
return Platform.getAdapterManager().getAdapter(this, adapter);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#exists()
*/
@Override
public boolean exists() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getImageDescriptor()
*/
@Override
public ImageDescriptor getImageDescriptor() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getName()
*/
@Override
public String getName() {
return "text";
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getPersistable()
*/
@Override
public IPersistableElement getPersistable() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
@Override
public String getToolTipText() {
return "text";
}
/**
* @param text the text to set
*/
public void setText(String text) {
this.text = text;
}
/**
* @return the text
*/
public String getText() {
return text;
}
}