-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
468 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
...ge.plantuml.ecore/src/net/sourceforge/plantuml/ecore/EcoreClassDiagramIntentProvider.java
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
...ceforge.plantuml.ecore/src/net/sourceforge/plantuml/ecore/EcoreDiagramIntentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package net.sourceforge.plantuml.ecore; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.eclipse.core.runtime.IPath; | ||
import org.eclipse.emf.ecore.EModelElement; | ||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.emf.ecore.EPackage; | ||
|
||
import net.sourceforge.plantuml.util.AbstractDiagramIntent; | ||
import net.sourceforge.plantuml.util.DiagramIntent; | ||
|
||
public class EcoreDiagramIntentProvider extends AbstractEcoreDiagramIntentProvider { | ||
|
||
public EcoreDiagramIntentProvider() { | ||
super(); | ||
} | ||
|
||
protected EcoreDiagramIntentProvider(final Class<?> editorType) { | ||
super(editorType); | ||
} | ||
|
||
@Override | ||
protected Boolean supportsPath(final IPath path) { | ||
return "ecore".equals(path.getFileExtension()) || "xmi".equals(path.getFileExtension()); | ||
} | ||
|
||
@Override | ||
protected boolean supportsEObject(final EObject object) { | ||
return true; | ||
} | ||
|
||
protected final EcoreDiagramHelper diagramHelper = new EcoreDiagramHelper(); | ||
|
||
protected EPackage getEPackage(final EObject selection) { | ||
return diagramHelper.getAncestor(selection, EPackage.class); | ||
} | ||
|
||
public static boolean isEcoreClassDiagramObject(final Object object) { | ||
return object instanceof EModelElement; | ||
} | ||
|
||
@Override | ||
protected Collection<? extends DiagramIntent> getDiagramInfos(final EObject eObject) { | ||
final Collection<AbstractDiagramIntent<?>> diagrams = new ArrayList<>(); | ||
final boolean isEcoreClassDiagram = isEcoreClassDiagramObject(eObject); | ||
final EPackage pack = getEPackage(isEcoreClassDiagram ? eObject : eObject.eClass()); | ||
if (! isEcoreClassDiagram) { | ||
diagrams.add(new EcoreObjectDiagramIntent(eObject)); | ||
} | ||
if (pack != null) { | ||
final EcoreClassDiagramIntent classDiagramIntent = new EcoreClassDiagramIntent(Collections.singletonList(pack)); | ||
if (! isEcoreClassDiagram) { | ||
classDiagramIntent.setPriority(-1); | ||
} | ||
diagrams.add(classDiagramIntent); | ||
} | ||
return diagrams; | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
...e.plantuml.ecore/src/net/sourceforge/plantuml/ecore/EcoreObjectDiagramIntentProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.