/******************************************************************************* * Copyright (c) 2010 SAP AG. * 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: * Emil Simeonov - initial API and implementation. * Dimitar Donchev - initial API and implementation. * Dimitar Tenev - initial API and implementation. * Nevena Manova - initial API and implementation. * Georgi Konstantinov - initial API and implementation. *******************************************************************************/ package org.eclipse.wst.sse.sieditor.test.v2.ui.editor; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IPersistableElement; import org.eclipse.wst.sse.sieditor.ui.v2.input.IWritableStorage; import org.eclipse.wst.sse.sieditor.ui.v2.input.IWritableStorageEditorInput; public class SIETestEditorInput implements IWritableStorageEditorInput { private IWritableStorage storage; private boolean exists; private ImageDescriptor imageDescriptor; private String toolTipText; @Override public IWritableStorage getStorage() throws CoreException { return storage; } public void setStorage(IWritableStorage storage) { this.storage = storage; } @Override public boolean exists() { return exists; } public void setExists(boolean exists) { this.exists = exists; } @Override public ImageDescriptor getImageDescriptor() { return imageDescriptor; } public void setImageDescriptor(ImageDescriptor imageDescriptor) { this.imageDescriptor = imageDescriptor; } @Override public String getName() { return storage.getName(); } @Override public IPersistableElement getPersistable() { // TODO Auto-generated method stub return null; } @Override public String getToolTipText() { return toolTipText; } public void setToolTipText(String toolTipText) { this.toolTipText = toolTipText; } @Override public Object getAdapter(Class adapter) { return null; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((storage == null) ? 0 : storage.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SIETestEditorInput other = (SIETestEditorInput) obj; if (storage == null) { if (other.storage != null) return false; } else if (!storage.equals(other.storage)) return false; return true; } }