Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
8e43a849
Commit
8e43a849
authored
Oct 26, 2017
by
Simon Barner
Browse files
Proper model element handlers and names in prototype providers
refs 3035
parent
5776d4d5
Changes
8
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/handler/LogicalArchitectureToPartitionArchitectureAllocationTableHandler.java
View file @
8e43a849
...
@@ -34,12 +34,6 @@ public class LogicalArchitectureToPartitionArchitectureAllocationTableHandler
...
@@ -34,12 +34,6 @@ public class LogicalArchitectureToPartitionArchitectureAllocationTableHandler
extends
extends
NamedCommentedModelElementHandlerBase
<
LogicalArchitectureToPartitionArchitectureAllocationTable
>
{
NamedCommentedModelElementHandlerBase
<
LogicalArchitectureToPartitionArchitectureAllocationTable
>
{
/** {@inheritDoc} */
@Override
public
String
getName
(
LogicalArchitectureToPartitionArchitectureAllocationTable
element
)
{
return
"LogicalArchitecture To PartitionnArchitecture AllocationTable"
;
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
ImageDescriptor
getIconImageDescriptor
()
{
public
ImageDescriptor
getIconImageDescriptor
()
{
...
...
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/handler/PartitionArchitectureHandler.java
View file @
8e43a849
...
@@ -17,7 +17,8 @@ $Id$
...
@@ -17,7 +17,8 @@ $Id$
+--------------------------------------------------------------------------*/
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.partition.ui.handler
;
package
org.fortiss.af3.partition.ui.handler
;
import
java.util.ArrayList
;
import
static
java
.
util
.
Collections
.
unmodifiableList
;
import
java.util.List
;
import
java.util.List
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.EObject
;
...
@@ -37,16 +38,8 @@ public class PartitionArchitectureHandler extends
...
@@ -37,16 +38,8 @@ public class PartitionArchitectureHandler extends
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
String
getName
(
PartitionArchitecture
element
)
{
public
List
<
EObject
>
getSubnodes
(
PartitionArchitecture
partitionArchitecture
)
{
return
"Partition Architecture"
;
return
unmodifiableList
(
partitionArchitecture
.
getPartitions
());
}
/** {@inheritDoc} */
@Override
public
List
<
EObject
>
getSubnodes
(
PartitionArchitecture
element
)
{
List
<
EObject
>
results
=
new
ArrayList
<
EObject
>();
results
.
addAll
(
element
.
getPartitions
());
return
results
;
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
...
...
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/handler/PartitionChannelHandler.java
View file @
8e43a849
...
@@ -19,7 +19,7 @@ package org.fortiss.af3.partition.ui.handler;
...
@@ -19,7 +19,7 @@ package org.fortiss.af3.partition.ui.handler;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.fortiss.af3.partition.model.PartitionChannel
;
import
org.fortiss.af3.partition.model.PartitionChannel
;
import
org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase
;
import
org.fortiss.tooling.kernel.ui.extension.base.
NamedCommented
ModelElementHandlerBase
;
/**
/**
*
*
...
@@ -28,13 +28,8 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
...
@@ -28,13 +28,8 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
* @version $Rev$
* @version $Rev$
* @ConQAT.Rating RED Hash:
* @ConQAT.Rating RED Hash:
*/
*/
public
class
PartitionChannelHandler
extends
ModelElementHandlerBase
<
PartitionChannel
>
{
public
class
PartitionChannelHandler
extends
NamedCommentedModelElementHandlerBase
<
PartitionChannel
>
{
/** {@inheritDoc} */
@Override
public
String
getName
(
PartitionChannel
partitionChannel
)
{
return
"PartitionChannel"
;
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
...
...
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/handler/PartitionHandler.java
View file @
8e43a849
...
@@ -17,13 +17,14 @@ $Id$
...
@@ -17,13 +17,14 @@ $Id$
+--------------------------------------------------------------------------*/
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.partition.ui.handler
;
package
org.fortiss.af3.partition.ui.handler
;
import
java.util.Collections
;
import
static
java
.
util
.
Collections
.
unmodifiableList
;
import
java.util.List
;
import
java.util.List
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.fortiss.af3.partition.model.Partition
;
import
org.fortiss.af3.partition.model.Partition
;
import
org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase
;
import
org.fortiss.tooling.kernel.ui.extension.base.
NamedCommented
ModelElementHandlerBase
;
/**
/**
*
*
...
@@ -32,13 +33,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
...
@@ -32,13 +33,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.ModelElementHandlerBase;
* @version $Rev$
* @version $Rev$
* @ConQAT.Rating RED Hash:
* @ConQAT.Rating RED Hash:
*/
*/
public
class
PartitionHandler
extends
ModelElementHandlerBase
<
Partition
>
{
public
class
PartitionHandler
extends
NamedCommentedModelElementHandlerBase
<
Partition
>
{
/** {@inheritDoc} */
@Override
public
String
getName
(
Partition
element
)
{
return
element
.
getName
();
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
...
@@ -48,7 +43,7 @@ public class PartitionHandler extends ModelElementHandlerBase<Partition> {
...
@@ -48,7 +43,7 @@ public class PartitionHandler extends ModelElementHandlerBase<Partition> {
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
List
<
EObject
>
getConnectors
(
Partition
element
)
{
public
List
<
EObject
>
getConnectors
(
Partition
partition
)
{
return
Collections
.
unmodifiableList
(
element
.
getConnectors
());
return
unmodifiableList
(
partition
.
getConnectors
());
}
}
}
}
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/handler/PartitionInputPortHandler.java
View file @
8e43a849
...
@@ -17,12 +17,14 @@ $Id$
...
@@ -17,12 +17,14 @@ $Id$
+--------------------------------------------------------------------------*/
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.partition.ui.handler
;
package
org.fortiss.af3.partition.ui.handler
;
import
static
java
.
util
.
Collections
.
unmodifiableList
;
import
static
org
.
fortiss
.
af3
.
partition
.
ui
.
AF3PartitionUIActivator
.
getImageDescriptor
;
import
java.util.List
;
import
java.util.List
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.fortiss.af3.partition.model.PartitionInputPort
;
import
org.fortiss.af3.partition.model.PartitionInputPort
;
import
org.fortiss.af3.partition.ui.AF3PartitionUIActivator
;
import
org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase
;
import
org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase
;
/**
/**
...
@@ -38,21 +40,18 @@ public class PartitionInputPortHandler extends
...
@@ -38,21 +40,18 @@ public class PartitionInputPortHandler extends
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
ImageDescriptor
getIconImageDescriptor
()
{
public
ImageDescriptor
getIconImageDescriptor
()
{
return
getImageDescriptor
(
"icons/partition_inputport.png"
);
return
AF3PartitionUIActivator
.
getImageDescriptor
(
"icons/partition_inputport.png"
);
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Override
@Override
public
List
<
EObject
>
getIncomingConnections
(
PartitionInputPort
elemen
t
)
{
public
List
<
EObject
>
getIncomingConnections
(
PartitionInputPort
por
t
)
{
return
(
List
)
elemen
t
.
getIncoming
();
return
unmodifiableList
(
por
t
.
getIncoming
()
)
;
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Override
@Override
public
List
<
EObject
>
getOutgoingConnections
(
PartitionInputPort
elemen
t
)
{
public
List
<
EObject
>
getOutgoingConnections
(
PartitionInputPort
por
t
)
{
return
(
List
)
elemen
t
.
getOutgoing
();
return
unmodifiableList
(
por
t
.
getOutgoing
()
)
;
}
}
}
}
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/handler/PartitionOutputPortHandler.java
View file @
8e43a849
...
@@ -17,12 +17,14 @@ $Id$
...
@@ -17,12 +17,14 @@ $Id$
+--------------------------------------------------------------------------*/
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.partition.ui.handler
;
package
org.fortiss.af3.partition.ui.handler
;
import
static
java
.
util
.
Collections
.
unmodifiableList
;
import
static
org
.
fortiss
.
af3
.
partition
.
ui
.
AF3PartitionUIActivator
.
getImageDescriptor
;
import
java.util.List
;
import
java.util.List
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.fortiss.af3.partition.model.PartitionOutputPort
;
import
org.fortiss.af3.partition.model.PartitionOutputPort
;
import
org.fortiss.af3.partition.ui.AF3PartitionUIActivator
;
import
org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase
;
import
org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase
;
/**
/**
...
@@ -38,20 +40,18 @@ public class PartitionOutputPortHandler extends
...
@@ -38,20 +40,18 @@ public class PartitionOutputPortHandler extends
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
public
ImageDescriptor
getIconImageDescriptor
()
{
public
ImageDescriptor
getIconImageDescriptor
()
{
return
AF3PartitionUIActivator
.
getImageDescriptor
(
"icons/partition_outputport.png"
);
return
getImageDescriptor
(
"icons/partition_outputport.png"
);
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Override
@Override
public
List
<
EObject
>
getIncomingConnections
(
PartitionOutputPort
element
)
{
public
List
<
EObject
>
getIncomingConnections
(
PartitionOutputPort
element
)
{
return
(
List
)
element
.
getIncoming
();
return
unmodifiable
List
(
element
.
getIncoming
()
)
;
}
}
/** {@inheritDoc} */
/** {@inheritDoc} */
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Override
@Override
public
List
<
EObject
>
getOutgoingConnections
(
PartitionOutputPort
element
)
{
public
List
<
EObject
>
getOutgoingConnections
(
PartitionOutputPort
element
)
{
return
(
List
)
element
.
getOutgoing
();
return
unmodifiable
List
(
element
.
getOutgoing
()
)
;
}
}
}
}
org.fortiss.af3.partition.ui/trunk/src/org/fortiss/af3/partition/ui/prototype/PrototypeProvider.java
View file @
8e43a849
...
@@ -42,14 +42,15 @@ public class PrototypeProvider extends PrototypeProviderBase {
...
@@ -42,14 +42,15 @@ public class PrototypeProvider extends PrototypeProviderBase {
/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
@Override
protected
void
registerPrototypes
()
{
protected
void
registerPrototypes
()
{
registerPrimaryPrototype
(
"Partition
Architecture"
,
createPartition
Architecture
()
,
registerPrimaryPrototype
(
"Partition
Architecture
"
,
CATEGORY_PA
);
createPartitionArchitecture
(
"Partition Architecture"
),
CATEGORY_PA
);
registerPrototype
(
"Partition"
,
createPartition
(
"Partition"
),
CATEGORY_PA
);
registerPrototype
(
"Partition"
,
createPartition
(
"Partition"
),
CATEGORY_PA
);
registerPrototype
(
"PartitionInputPort"
,
createPartitionInputPort
(
"Input"
),
CATEGORY_PA
);
registerPrototype
(
"Partition
InputPort"
,
createPartitionInputPort
(
"Input"
),
CATEGORY_PA
);
registerPrototype
(
"PartitionOutputPort"
,
createPartitionOutputPort
(
"Output"
),
CATEGORY_PA
);
registerPrototype
(
"Partition
OutputPort"
,
createPartitionOutputPort
(
"Output"
),
CATEGORY_PA
);
registerPrimaryPrototype
(
"LogicalArchitectureToPartitionArchitectureAllocationTable"
,
registerPrimaryPrototype
(
createLogicalArchitectureToPartitionArchitectureAllocationTable
(
"La2Va"
),
"La \u2192 Pa"
,
// La -> Pa
createLogicalArchitectureToPartitionArchitectureAllocationTable
(
"La \u2192 Pa"
),
org
.
fortiss
.
af3
.
allocation
.
ui
.
prototypes
.
PrototypeProvider
.
CATEGORY
);
org
.
fortiss
.
af3
.
allocation
.
ui
.
prototypes
.
PrototypeProvider
.
CATEGORY
);
}
}
}
}
org.fortiss.af3.partition/trunk/src/org/fortiss/af3/partition/util/PartitionModelElementFactory.java
View file @
8e43a849
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2017 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.partition.util
;
package
org.fortiss.af3.partition.util
;
import
static
org
.
fortiss
.
tooling
.
base
.
utils
.
LayoutModelElementFactory
.
createConnectionLayout
;
import
static
org
.
fortiss
.
tooling
.
base
.
utils
.
LayoutModelElementFactory
.
createConnectorLayout
;
import
static
org
.
fortiss
.
tooling
.
base
.
utils
.
LayoutModelElementFactory
.
createNodeElementLayout
;
import
org.fortiss.af3.partition.model.Partition
;
import
org.fortiss.af3.partition.model.Partition
;
import
org.fortiss.af3.partition.model.PartitionArchitecture
;
import
org.fortiss.af3.partition.model.PartitionArchitecture
;
import
org.fortiss.af3.partition.model.PartitionChannel
;
import
org.fortiss.af3.partition.model.PartitionChannel
;
...
@@ -9,36 +30,55 @@ import org.fortiss.af3.partition.model.PartitionOutputPort;
...
@@ -9,36 +30,55 @@ import org.fortiss.af3.partition.model.PartitionOutputPort;
import
org.fortiss.af3.partition.model.ca2pa.Ca2PaFactory
;
import
org.fortiss.af3.partition.model.ca2pa.Ca2PaFactory
;
import
org.fortiss.af3.partition.model.ca2pa.LogicalArchitectureToPartitionArchitectureAllocationTable
;
import
org.fortiss.af3.partition.model.ca2pa.LogicalArchitectureToPartitionArchitectureAllocationTable
;
import
org.fortiss.tooling.base.model.element.IHierarchicElement
;
import
org.fortiss.tooling.base.model.element.IHierarchicElement
;
import
org.fortiss.tooling.base.utils.LayoutModelElementFactory
;
/**
* Model element factory for partition architectures.
*
* @author zverlov
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 3DE1B38E61571CAB64AA30FD80843885
*/
public
class
PartitionModelElementFactory
{
public
class
PartitionModelElementFactory
{
/** Creates a new {@link PartitionArchitecture} with the given {@code name}. */
public
static
PartitionArchitecture
createPartitionArchitecture
(
String
name
)
{
PartitionArchitecture
partitionArchitecture
=
PartitionFactory
.
eINSTANCE
.
createPartitionArchitecture
();
partitionArchitecture
.
setName
(
name
);
return
partitionArchitecture
;
}
/** Creates a new {@link Partition} with the given {@code name}. */
public
static
Partition
createPartition
(
String
name
)
{
public
static
Partition
createPartition
(
String
name
)
{
Partition
partition
=
PartitionFactory
.
eINSTANCE
.
createPartition
();
Partition
partition
=
PartitionFactory
.
eINSTANCE
.
createPartition
();
partition
.
setName
(
name
);
partition
.
setName
(
name
);
createNodeElementLayout
(
partition
);
return
partition
;
return
partition
;
}
}
public
static
PartitionArchitecture
createPartitionArchitecture
()
{
/** Creates a new {@link PartitionChannel} with the given {@code name}. */
return
PartitionFactory
.
eINSTANCE
.
createPartitionArchitecture
();
}
public
static
PartitionChannel
createPartitionChannel
(
String
name
)
{
public
static
PartitionChannel
createPartitionChannel
(
String
name
)
{
PartitionChannel
pChan
=
PartitionFactory
.
eINSTANCE
.
createPartitionChannel
();
PartitionChannel
pChan
=
PartitionFactory
.
eINSTANCE
.
createPartitionChannel
();
pChan
.
setName
(
name
);
pChan
.
setName
(
name
);
LayoutModelElementFactory
.
createConnectionLayout
(
pChan
);
createConnectionLayout
(
pChan
);
return
pChan
;
return
pChan
;
}
}
/** Creates a new {@link PartitionInputPort} with the given {@code name}. */
public
static
PartitionInputPort
createPartitionInputPort
(
String
name
)
{
public
static
PartitionInputPort
createPartitionInputPort
(
String
name
)
{
PartitionInputPort
pInPort
=
PartitionFactory
.
eINSTANCE
.
createPartitionInputPort
();
PartitionInputPort
pInPort
=
PartitionFactory
.
eINSTANCE
.
createPartitionInputPort
();
pInPort
.
setName
(
name
);
pInPort
.
setName
(
name
);
createConnectorLayout
(
pInPort
);
return
pInPort
;
return
pInPort
;
}
}
/** Creates a new {@link PartitionOutputPort} with the given {@code name}. */
public
static
PartitionOutputPort
createPartitionOutputPort
(
String
name
)
{
public
static
PartitionOutputPort
createPartitionOutputPort
(
String
name
)
{
PartitionOutputPort
pOutPort
=
PartitionFactory
.
eINSTANCE
.
createPartitionOutputPort
();
PartitionOutputPort
pOutPort
=
PartitionFactory
.
eINSTANCE
.
createPartitionOutputPort
();
pOutPort
.
setName
(
name
);
pOutPort
.
setName
(
name
);
createConnectorLayout
(
pOutPort
);
return
pOutPort
;
return
pOutPort
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment