/******************************************************************************* * Copyright (c) 2011 Softberries Krzysztof Grajek. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Softberries Krzysztof Grajek - initial API and implementation ******************************************************************************/ package com.softberries.klerk.gui.editors.input; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IPersistableElement; import com.softberries.klerk.dao.to.Document; public class DocumentEditorInput implements IEditorInput { private Document document; public DocumentEditorInput(Document d){ this.document = d; } @Override public Object getAdapter(Class adapter) { return this.document; } @Override public boolean exists() { return false; } @Override public ImageDescriptor getImageDescriptor() { return null; } @Override public String getName() { return this.document.getTitle(); } @Override public IPersistableElement getPersistable() { return null; } @Override public String getToolTipText() { return this.document.getTitle(); } }