- Unbenannt
- Sunday, January 6th, 2008 at 10:57:43am MST
- package org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.document;
- import org.eclipse.core.resources.IFile;
- import org.eclipse.core.runtime.IPath;
- import org.eclipse.emf.transaction.TransactionalEditingDomain;
- import org.eclipse.ui.IFileEditorInput;
- import org.eclipse.ui.IMemento;
- import org.eclipse.ui.IPathEditorInput;
- import org.eclipse.ui.IPersistableElement;
- import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.MEditingDomainElement;
- /**
- * FileEditorInput Proxy.
- *
- * @author mgoyal
- *
- *
- */
- public class FileEditorInputProxy extends StorageEditorInputProxy
- implements IFileEditorInput, IPathEditorInput, IPersistableElement, MEditingDomainElement {
- /**
- * @param proxied
- * @param domain
- */
- public FileEditorInputProxy(IFileEditorInput proxied, TransactionalEditingDomain domain) {
- super(proxied, domain);
- assert proxied != null && domain != null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#getFactoryId()
- */
- public String getFactoryId() {
- IPersistableElement persistable = getPersistableElement();
- if(persistable != null)
- return persistable.getFactoryId();
- assert false;
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IFileEditorInput#getFile()
- */
- public IFile getFile() {
- IFileEditorInput fileInput = getFileInput();
- if(fileInput != null)
- return fileInput.getFile();
- assert false;
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPathEditorInput#getPath()
- */
- public IPath getPath() {
- IPathEditorInput pathInput = getPathInput();
- if(pathInput != null)
- return pathInput.getPath();
- assert false;
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
- */
- public void saveState(IMemento memento) {
- IPersistableElement persistable = getPersistableElement();
- if(persistable != null)
- persistable.saveState(memento);
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fProxied.toString();
- }
- /* (non-Javadoc)
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.MEditingDomainElement#getEditingDomain()
- */
- public TransactionalEditingDomain getEditingDomain() {
- return editingDomain;
- }
- /**
- * @return FileEditorInput
- */
- private IFileEditorInput getFileInput() {
- return fProxied instanceof IFileEditorInput ? (IFileEditorInput)fProxied : null;
- }
- /**
- * @return PathEditorInput
- */
- private IPathEditorInput getPathInput() {
- return fProxied instanceof IPathEditorInput ? (IPathEditorInput)fProxied : null;
- }
- /**
- * @return Persistable Element
- */
- private IPersistableElement getPersistableElement() {
- return fProxied instanceof IPersistableElement ? (IPersistableElement)fProxied : null;
- }
- }
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.