Skip to main content
summaryrefslogtreecommitdiffstats
blob: 861ad0d2c97420f0f8d583ca5b9baeb9bc783153 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*******************************************************************************
 * <copyright>
 *
 * Copyright (c) 2005, 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:
 *    Stefan Dimov - initial API, implementation and documentation
 *
 * </copyright>
 *
 *******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.util;

import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator;
import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorImageCreator.RelEndDir;
import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.IWorkbenchSite;


public class JPAEditorUtilImpl implements IJPAEditorUtil {

	public int calcConnectionLength(FreeFormConnection c) {
		return JPAEditorUtil.calcConnectionLength(c);
	}

	public List<Point> createBendPointList(FreeFormConnection c,  int cnt, int connectionsNum,  boolean selfRelation) {
		return JPAEditorUtil.createBendPointList(c,  cnt, connectionsNum, selfRelation);
	}
	
	public List<Point> createBendPointList(FreeFormConnection c,  boolean selfRelation) {
		return JPAEditorUtil.createBendPointList(c,  selfRelation);
	}
	
	public RelEndDir getConnectionStartDir(FreeFormConnection c) {
		return JPAEditorUtil.getConnectionStartDir(c);
		
	}
	
	public RelEndDir getConnectionEndDir(FreeFormConnection c) {
		return JPAEditorUtil.getConnectionEndDir(c);
	}
	
	public JavaPersistentType getJPType(ICompilationUnit cu) {
		return JPAEditorUtil.getJPType(cu);
	}
	
	public void organizeImports(ICompilationUnit cu, IWorkbenchSite ws) {
		JPAEditorUtil.organizeImports(cu, ws);
	}
	
	public void formatCode(ICompilationUnit cu, IWorkbenchSite ws) {
		JPAEditorUtil.formatCode(cu, ws);
	}
	
	public String generateUniqueEntityName(JpaProject jpaProject, 
			  String pack, 
			  IJPAEditorFeatureProvider fp) {
		return JPAEditorUtil.generateUniqueEntityName(jpaProject, pack, fp);
	}
	
	public String generateUniqueMappedSuperclassName(JpaProject jpaProject, String pack, IJPAEditorFeatureProvider fp) {
		return JPAEditorUtil.generateUniqueMappedSuperclassName(jpaProject, pack, fp);
	}

	
	public IFile createEntityInProject(IProject project, String entityName, IPreferenceStore jpaPreferenceStore,
			boolean isMappedSuperclassChild, String mappedSuperclassName, String mappedSuperclassPackage, boolean hasPrimaryKey) throws Exception {
		return JPAEditorUtil.createEntityInProject(project, entityName, jpaPreferenceStore, isMappedSuperclassChild, 
				mappedSuperclassName, mappedSuperclassPackage, hasPrimaryKey);
 	}

	
	public ICompilationUnit getCompilationUnit(JavaPersistentType jpt) {
		return JPAEditorUtil.getCompilationUnit(jpt);
	}
	
	public boolean isCardinalityDecorator(ConnectionDecorator dc) {
		return JPAEditorUtil.isCardinalityDecorator(dc);
	}

	public void discardWorkingCopyOnce(ICompilationUnit cu) {
		JPAEditorUtil.discardWorkingCopyOnce(cu);
	}
	
	public IFile createEntityFromMappedSuperclassInProject(IProject project,
			String mappedSuperclassName, IPreferenceStore jpaPreferenceStore) throws Exception {
		return JPAEditorUtil.createEntityFromMappedSuperclassInProject(project, mappedSuperclassName, jpaPreferenceStore);
	}

}

Back to the top