Skip to content

Commit

Permalink
Merge branch 'master' into tortmayr/issue251
Browse files Browse the repository at this point in the history
Conflicts:
	plugins/org.eclipse.papyrus.uml.diagram.sequence.runtime/src/org/eclipse/papyrus/uml/diagram/sequence/runtime/internal/providers/SequenceElementTypes.java
	plugins/org.eclipse.papyrus.uml.diagram.sequence.runtime/src/org/eclipse/papyrus/uml/diagram/sequence/runtime/internal/providers/SequenceParserProvider.java
	tests/org.eclipse.papyrus.uml.diagram.sequence.runtime.tests/META-INF/MANIFEST.MF
  • Loading branch information
rschnekenbu committed Oct 17, 2018
2 parents f2447d3 + 190ed72 commit a5bfcb7
Show file tree
Hide file tree
Showing 226 changed files with 17,754 additions and 1,281 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ target/
*~
tests/**/.metadata/
**/src/site/resources/images/rcptt-screenshots
.vscode
.vscode
**/.polyglot.build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Simplifiedui
Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.papyrus.infra.newchild;bundle-version="3.0.0",
org.eclipse.papyrus.infra.properties;bundle-version="3.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
newchild,\
plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<ElementCreationMenuModel:Folder xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ElementCreationMenuModel="http://www.eclipse.org/papyrus/infra/newchild/elementcreationmenumodel" xmlns:elementtypesconfigurations="http://www.eclipse.org/papyrus/infra/elementtypesconfigurations/1.2" label="New Child">
<menu xsi:type="ElementCreationMenuModel:CreationMenu" label="Lifeline">
<elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Lifeline"/>
</menu>
<menu xsi:type="ElementCreationMenuModel:CreationMenu" label="Property">
<elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Property"/>
</menu>
<menu xsi:type="ElementCreationMenuModel:CreationMenu" label="Comment">
<elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Comment"/>
</menu>
<menu xsi:type="ElementCreationMenuModel:CreationMenu" label="Constraint">
<elementType xsi:type="elementtypesconfigurations:MetamodelTypeConfiguration" href="platform:/plugin/org.eclipse.papyrus.uml.service.types/model/uml.elementtypesconfigurations#org.eclipse.papyrus.uml.Constraint"/>
</menu>
</ElementCreationMenuModel:Folder>

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.papyrus.infra.newchild">
<menuCreationModel
model="newchild/lightweight-seqd-newChild.creationmenumodel">
</menuCreationModel>
</extension>
<extension
point="org.eclipse.ui.startup">
<startup
class="org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui.StartUp">
</startup>
</extension>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {

// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui"; //$NON-NLS-1$

// The shared instance
private static Activator plugin;

/**
* The constructor
*/
public Activator() {
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright (c) 2016 EclipseSource Services GmbH 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
*
* Martin Fleck (EclipseSource) - Initial API and implementation
*/
package org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui;

import org.eclipse.papyrus.infra.newchild.CreationMenuRegistry;
import org.eclipse.papyrus.infra.newchild.elementcreationmenumodel.Folder;

/**
* Cleans the creation menu.
*/
public final class CreationMenuCleaner {

private static final String UML_NEW_CHILD_MENU = "/resource/UML.creationmenumodel"; //$NON-NLS-1$

private static final String UML_NEW_RELATIONSHIP_MENU = "/resource/UMLEdges.creationmenumodel"; //$NON-NLS-1$

private static final String[] DEACTIVATED_CHILD_MENUS = new String[] { UML_NEW_CHILD_MENU,
UML_NEW_RELATIONSHIP_MENU };

private CreationMenuCleaner() {
// hidden constructor.
}

/**
* Cleans the creation menu.
*/
public static void clean() {
CreationMenuRegistry instance = org.eclipse.papyrus.infra.newchild.CreationMenuRegistry.getInstance();
for (Folder folder : instance.getRootFolder()) {
for (String childMenuPath : DEACTIVATED_CHILD_MENUS) {
if (folder.eResource().getURI().toString().endsWith(childMenuPath)) {
instance.setCreationMenuVisibility(folder, false);
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.eclipse.papyrus.uml.diagram.sequence.contribution.simplifiedui;

import org.eclipse.ui.IStartup;

public class StartUp implements IStartup {

@Override
public void earlyStartup() {
CreationMenuCleaner.clean();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,45 @@
name="Lightweight Sequence Diagram"
category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams">
</page>
<page
class="org.eclipse.papyrus.uml.diagram.sequence.runtime.internal.preferences.LightweightSequenceDiagramEditingPreferencePage"
id="org.eclipse.papyrus.uml.diagram.sequence.contribution.editingPreferencePage"
name="Editing"
category="org.eclipse.papyrus.uml.diagram.sequence.contribution.preferencePage">
<keywordReference
id="org.eclipse.papyrus.uml.diagram.sequence.contribution.keywords">
</keywordReference>
</page>
</extension>
<extension
point="org.eclipse.ui.keywords">
<keyword
id="org.eclipse.papyrus.uml.diagram.sequence.contribution.keywords"
label="lightweight sequence">
</keyword>
</extension>
<extension
name="Lightweight Sequence Diagram"
point="org.eclipse.papyrus.infra.properties.contexts">
<!-- when integrated with Papyrus, we should avoid applying this context by default -->
<context appliedByDefault="true" contextModel="context/lightweight-seqd.contexts" isCustomizable="true"/>
</extension>

<extension
point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
<paletteProvider
class="org.eclipse.papyrus.uml.diagram.sequence.runtime.internal.providers.SequencePaletteProvider">
<Priority
name="Highest">
</Priority>
<!-- For some reason, Papyrus ignores the <content> object descriptor. -->
<editor>
<!-- the <method> is understood by the extension point. It's an oversight in the exsd. -->
<method
name="getContributorId()"
value="org.eclipse.papyrus.uml.diagram.sequence.runtime">
</method>
</editor>
</paletteProvider>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Bundle-Activator: org.eclipse.papyrus.uml.diagram.sequence.figure.internal.Activ
Export-Package: org.eclipse.papyrus.uml.diagram.sequence.figure,
org.eclipse.papyrus.uml.diagram.sequence.figure.anchors,
org.eclipse.papyrus.uml.diagram.sequence.figure.border,
org.eclipse.papyrus.uml.diagram.sequence.figure.internal;x-internal:=true
org.eclipse.papyrus.uml.diagram.sequence.figure.internal;x-internal:=true,
org.eclipse.papyrus.uml.diagram.sequence.figure.magnets
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.13.0,4.0.0)",
org.eclipse.draw2d;bundle-version="[3.10.0,4.0.0)",
org.eclipse.gmf.runtime.draw2d.ui;bundle-version="[1.9.0,2.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.papyrus.uml.diagram.sequence.figure.anchors.ExecutionSpecificationEndAnchor;
import org.eclipse.papyrus.uml.diagram.sequence.figure.anchors.ExecutionSpecificationSideAnchor;
import org.eclipse.papyrus.uml.diagram.sequence.figure.anchors.ExecutionSpecificationStartAnchor;
import org.eclipse.papyrus.uml.diagram.sequence.figure.anchors.ISequenceAnchor;

public class ExecutionSpecificationFigure extends NodeFigure {
@Override
Expand Down Expand Up @@ -115,4 +116,12 @@ protected ConnectionAnchor createAnchor(PrecisionPoint p) {

return super.createAnchor(p);
}

@Override
public String getConnectionAnchorTerminal(ConnectionAnchor c) {
if (c instanceof ISequenceAnchor) {
return ((ISequenceAnchor)c).getTerminal();
}
return super.getConnectionAnchorTerminal(c);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*****************************************************************************
* Copyright (c) 2018 Christian W. Damus 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:
* Christian W. Damus - Initial API and implementation
*****************************************************************************/

package org.eclipse.papyrus.uml.diagram.sequence.figure.magnets;

import java.beans.PropertyChangeListener;

import org.eclipse.draw2d.Connection;
import org.eclipse.draw2d.geometry.PointList;

/**
* A convenient helper for management of magnets along the path of a connection figure.
*/
public class ConnectionFigureMagnetHelper extends MagnetHelper<Connection, PointList> {

private PropertyChangeListener pointsListener;

/**
* Initializes me with my {@code figure}.
*
* @param connection
* my connection figure
* @param magnetManager
* the magnet manager
* @param strength
* the strength of magnets that I create
*/
public ConnectionFigureMagnetHelper(Connection connection, IMagnetManager magnetManager, int strength) {
super(connection, magnetManager, strength);
}

/**
* Auto-register magnets at the specified points of my connection figure.
*
* @param endpoints
* whether to create magnets at the endpoints
* @param midpoint
* whether to create magnets at the midpoint of the connection path
* @see MagnetHelper#registerMagnet(java.util.function.Function)
*/
public ConnectionFigureMagnetHelper registerMagnets(boolean endpoints, boolean midpoint) {
if (endpoints) {
registerMagnet(PointList::getFirstPoint);
registerMagnet(PointList::getLastPoint);
}
if (midpoint) {
registerMagnet(PointList::getMidpoint);
}

return this;
}

@Override
protected void addListeners(Connection figure, Runnable action) {
// Recompute magnets on change of the points defining the connection path
pointsListener = __ -> action.run();

figure.addPropertyChangeListener(Connection.PROPERTY_POINTS, pointsListener);
}

@Override
protected void removeListeners(Connection figure) {
figure.removePropertyChangeListener(Connection.PROPERTY_POINTS, pointsListener);

pointsListener = null;
}

@Override
protected PointList getGeometry(Connection figure) {
return figure.getPoints().getCopy();
}

}
Loading

0 comments on commit a5bfcb7

Please sign in to comment.