~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/tests/fixtures/CStringStorageInput.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2012-06-29 12:07:30 UTC
  • Revision ID: package-import@ubuntu.com-20120629120730-bfri1xys1i71dpn6
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2010 Red Hat Inc. and others.
 
3
 * All rights reserved. This program and the accompanying materials
 
4
 * are made available under the terms of the Eclipse Public License v1.0
 
5
 * which accompanies this distribution, and is available at
 
6
 * http://www.eclipse.org/legal/epl-v10.html
 
7
 *******************************************************************************/
 
8
package org.eclipse.linuxtools.changelog.tests.fixtures;
 
9
 
 
10
import org.eclipse.core.resources.IStorage;
 
11
import org.eclipse.jface.resource.ImageDescriptor;
 
12
import org.eclipse.ui.IPersistableElement;
 
13
import org.eclipse.ui.IStorageEditorInput;
 
14
 
 
15
/**
 
16
 * An IStorageEditorInput fixture. Used in CParserTest.
 
17
 *
 
18
 */
 
19
public class CStringStorageInput implements IStorageEditorInput {
 
20
        
 
21
        private IStorage storage;
 
22
 
 
23
        public CStringStorageInput(IStorage storage) {
 
24
                this.storage = storage;
 
25
        }
 
26
 
 
27
        public boolean exists() {
 
28
                return true;
 
29
        }
 
30
 
 
31
        public ImageDescriptor getImageDescriptor() {
 
32
                return null;
 
33
        }
 
34
 
 
35
        public String getName() {
 
36
                return storage.getName();
 
37
        }
 
38
 
 
39
        public IPersistableElement getPersistable() {
 
40
                return null;
 
41
        }
 
42
 
 
43
        public IStorage getStorage() {
 
44
                return storage;
 
45
        }
 
46
 
 
47
        public String getToolTipText() {
 
48
                return "String-based file: " + storage.getName();
 
49
        }
 
50
 
 
51
        public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
 
52
                return null;
 
53
        }
 
54
 
 
55
}