Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 95ee61a5aba252b95c8d05f459d266f437353962 (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
77
/*******************************************************************************
 * Copyright (c) 2009, 2010 Mia-Software.
 * 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:
 *    Nicolas Bros (Mia-Software) - Bug 331203 - table model editor - initial API and implementation
 *    Nicolas Guyomar (Mia-Software) - Bug 332924 - To be able to save the table
 *    Nicolas Guyomar (Mia-Software) - Bug 333029 - To be able to save the size of the lines and the columns
 *******************************************************************************/
package org.eclipse.papyrus.infra.table.efacet.common.input;

import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

/**
 * Comes from org.eclipse.emf.facet.widget.nattable.workbench.
 * 
 * This class should not be used by others plugins
 */
public class PapyrusTableEditorInput implements IEditorInput {

	/** The input for the Table widget */
	private final PapyrusTable papyrusTable;

	/** A textual description of what is shown in the editor */
	private final String description;

	private final EditingDomain editingDomain;

	public PapyrusTableEditorInput(final PapyrusTable papyrusTable, final EditingDomain editingDomain) {
		this.papyrusTable = papyrusTable;
		this.description = papyrusTable.getTable().getDescription();
		this.editingDomain = editingDomain;
	}

	public PapyrusTable getPapyrusTable() {
		return this.papyrusTable;
	}

	public String getDescription() {
		return this.description;
	}

	public boolean exists() {
		return false;
	}

	public ImageDescriptor getImageDescriptor() {
		return null;
	}

	public String getName() {
		return "PapyrusTable Model"; //$NON-NLS-1$
	}

	public IPersistableElement getPersistable() {
		return null;
	}

	public String getToolTipText() {
		return "PapyrusTable Model"; //$NON-NLS-1$
	}

	public Object getAdapter(@SuppressWarnings("rawtypes") final Class adapter) {
		return null;
	}

	public EditingDomain getEditingDomain() {
		return this.editingDomain;
	}
}

Back to the top