Commit 26928efb authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

GREEN

refs 2490
parent 14c00bfe
......@@ -27,7 +27,7 @@ import org.osgi.framework.BundleContext;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: E598D5FAA197E58EF5B04C4E9E46EAED
* @ConQAT.Rating GREEN Hash: CD6A4CF3945BC798002082D2F2112772
*/
public class ToolingBaseUIActivator extends AbstractUIPlugin {
/** The plug-in ID. */
......
......@@ -35,7 +35,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 8102CB44C7931250F4224AA5019C5011
* @ConQAT.Rating GREEN Hash: FAAC29DC1BA3288A13B3C686129B972C
*/
public abstract class AnnotationEditingSupportBase extends EditingSupport {
......
......@@ -51,7 +51,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: F6BC9688C61B6F0787EEE9EF94046CCF
* @ConQAT.Rating GREEN Hash: D3E5F689E3633D6FEEB3C9C81C001D26
*/
public class EditingSupportFactory {
......
......@@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9C6273D44DD9340894CD37DDFA216B73
* @ConQAT.Rating GREEN Hash: F34CC0DE59A4E4ADC4040E26C276A653
*
*/
public class MultiSelectionEditingSupport extends AnnotationEditingSupportBase {
......
......@@ -48,6 +48,7 @@ import org.eclipse.swt.widgets.TableItem;
import org.fortiss.tooling.base.annotation.AnnotationEntry;
import org.fortiss.tooling.base.annotation.IAnnotationValueService;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -65,7 +66,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author diewald, barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 5737954A300FB54DF6EEB82B0B95CF77
* @ConQAT.Rating GREEN Hash: 1868140DA1AD574D13EEAA2F8BCBA1BA
*/
public class CreateAnnotationInstanceColumn extends ViewerColumn {
/** The column to be added to the table. */
......@@ -225,29 +226,28 @@ public class CreateAnnotationInstanceColumn extends ViewerColumn {
// Register the new annotation instance with the model, by writing a null value
// for the input key provided by the user. A write transaction / a switch to the
// model context is required to modify the from the GUI context.
IModelElement modelElt = columnSpecAnnEntry.getModelElement();
ITopLevelElement modelContext =
IPersistencyService.getInstance().getTopLevelElementFor(
columnSpecAnnEntry.getModelElement());
IPersistencyService.getInstance().getTopLevelElementFor(modelElt);
modelContext
.runAsCommand(() -> {
try {
String value = populateInstance();
AnnotationEntry entry =
IAnnotationValueService.getInstance()
.getAnnotationEntry(
columnSpecAnnEntry.getModelElement());
IAnnotationValueService avs =
IAnnotationValueService.getInstance();
AnnotationEntry entry = avs.getAnnotationEntry(modelElt);
entry.setSpecificationValue(value, columnSpec.getClass(),
instanceKey);
// Inform others, e.g. the respective annotation view that a new
// instance of this annotation has been created.
columnSpecAnnEntry.getModelElement().eNotify(
new NotificationImpl(Notification.SET, null, null) {
@Override
public Object getNotifier() {
return columnSpecAnnEntry.getModelElement();
}
});
modelElt.eNotify(new NotificationImpl(Notification.SET, null,
null) {
@Override
public Object getNotifier() {
return modelElt;
}
});
} catch(IllegalArgumentException e) {
openError(
new Shell(),
......@@ -272,9 +272,8 @@ public class CreateAnnotationInstanceColumn extends ViewerColumn {
EStructuralFeature dynamicInstanceFeature =
columnSpec.eClass().getEStructuralFeatures().get(0);
// ...annotations that can be dynamically instantiated are
// implemented using an appropriate EMap (which by convention
// has to be the // first (and only)) feature of the
// ...annotations that can be dynamically instantiated are implemented using an
// appropriate EMap (which by convention has to be the first (and only)) feature of the
// corresponding annotation class.
if(dynamicInstanceFeature.getEType().getInstanceTypeName()
.equals("java.util.Map$Entry")) {
......@@ -284,8 +283,7 @@ public class CreateAnnotationInstanceColumn extends ViewerColumn {
((EClass)dynamicInstanceFeature.getEType()).getEStructuralFeature("value");
if(Number.class.isAssignableFrom(valueFeature.getEType().getInstanceClass())) {
// Initialize numbers with 0
// (initialization fails with "")
// Initialize numbers with 0 (initialization fails with "")
value = "0";
}
}
......
......@@ -79,7 +79,7 @@ import org.fortiss.tooling.base.ui.annotation.view.generic.filter.AnnotationFilt
* @author eder, diewald, barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 20B02B59811C764AEE63BC45A9279241
* @ConQAT.Rating GREEN Hash: 71F556F903C111B8280FD04616898B7E
*/
public class GenericAnnotationView extends AnnotationViewPartBase {
/** Root composite of {@link GenericAnnotationView}. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment