Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 53b6eb4da22e7b5e9564158447f59b424e14568f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Copyright (c) 2012 Eike Stepper (Berlin, Germany) and others.
 * 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:
 *    Eike Stepper - initial API and implementation
 */
package org.eclipse.emf.cdo.internal.ui;

import org.eclipse.emf.cdo.eresource.CDOResourceLeaf;

import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

/**
 * A text editor will consult {@link CDOLobStorage} for this input.
 *
 * @author Eike Stepper
 */
public class CDOLobEditorInput extends PlatformObject implements IEditorInput
{
  private final CDOResourceLeaf resource;

  private final boolean commitOnSave;

  public CDOLobEditorInput(CDOResourceLeaf resource)
  {
    this(resource, false);
  }

  public CDOLobEditorInput(CDOResourceLeaf resource, boolean commitOnSave)
  {
    this.resource = resource;
    this.commitOnSave = commitOnSave;
  }

  public final CDOResourceLeaf getResource()
  {
    return resource;
  }

  public final boolean isCommitOnSave()
  {
    return commitOnSave;
  }

  public boolean exists()
  {
    return true;
  }

  public ImageDescriptor getImageDescriptor()
  {
    return null;
  }

  public String getName()
  {
    return resource.getName();
  }

  public IPersistableElement getPersistable()
  {
    return null;
  }

  public String getToolTipText()
  {
    return resource.getURI().toString();
  }
}

Back to the top