Commit 51e3f606 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Apply Photon code formatting rules.



Issue-Ref: 3538
Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent b7053a37
AF3z3Activator.java b12e80465a3b7ce446c81e5857ecf4f4dfe9e96c GREEN
AF3z3Activator.java e9ff1932a62e74d66260edab2132501a327f08b6 GREEN
Z3Type.java 73e319ae206d2fd456ec9430c01b5ff7fc7282d0 GREEN
Z3javaAPIWrapper.java 8e36ee136c0a903ae1da7ac786e6cb9a3d3ac1a3 GREEN
Z3javaAPIWrapper.java d836f387a7b911f736643d3358679741b7fb2f10 GREEN
......@@ -18,7 +18,7 @@ import org.osgi.framework.BundleContext;
public class AF3z3Activator extends Plugin {
/** The plug-in ID. */
public static final String PLUGIN_ID = AF3z3Activator.class.getPackage().getName(); //$NON-NLS-1$
public static final String PLUGIN_ID = AF3z3Activator.class.getPackage().getName(); // $NON-NLS-1$
/** The shared instance. */
private static AF3z3Activator plugin;
......
......@@ -85,8 +85,8 @@ public class Z3javaAPIWrapper {
*/
public static FuncDecl createFunction(Context context, String name, Z3Type inputParam,
Z3Type outputParam) throws UnsupportedDataTypeException, Z3Exception {
return context
.mkFuncDecl(name, getType(context, inputParam), getType(context, outputParam));
return context.mkFuncDecl(name, getType(context, inputParam),
getType(context, outputParam));
}
/**
......@@ -117,8 +117,8 @@ public class Z3javaAPIWrapper {
}
/** Returns the Z3 API specific type of the given AF3 expression type */
public static Sort getType(Context context, Z3Type type) throws UnsupportedDataTypeException,
Z3Exception {
public static Sort getType(Context context, Z3Type type)
throws UnsupportedDataTypeException, Z3Exception {
if(type.equals(BOOL)) {
return context.getBoolSort();
} else if(type.equals(INT)) {
......
AbstractComponentToImage.java 5dfdbd3b2fc897ca140843684050b0c65a1840b8 GREEN
ExportComponentToImage.java d2cb3d9ade862710e873197f327d7d557fc1d6c6 GREEN
ExportModelToDocument.java c1bd081bed648c0333e86b07677c46c70a0e1bf5 GREEN
AbstractComponentToImage.java ea661f86ea16b201d890f2bd5951361dfa05a8f2 GREEN
ExportComponentToImage.java 9f2c80bdb1af3bf3a6e6e7f8576785bd651e2d58 GREEN
ExportModelToDocument.java bae773e85bf862bfb45e6cdf7ae8959a9025e219 GREEN
......@@ -265,9 +265,8 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
/** Gets the port position. */
protected Point getPortPosition(Port port, boolean isRootLevel) {
if(!isRootLevel) {
final OffsetOrientation orientation =
OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final OffsetOrientation orientation = OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
if(orientation != null) {
final Component component = port.getComponent();
final Point point = getComponentPoint(component);
......@@ -321,9 +320,8 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
}
}
} else {
final OffsetOrientation orientation =
OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final OffsetOrientation orientation = OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final boolean belongsToSelectedComponent =
port.getComponent().getId() == selectedComponent.getId();
......@@ -393,9 +391,8 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
}
}
} else {
final OffsetOrientation orientation =
OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final OffsetOrientation orientation = OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final boolean belongsToSelectedComponent =
port.getComponent().getId() == selectedComponent.getId();
......@@ -436,20 +433,21 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
/** Gets the port label style. */
protected String getPortLabelStyle(Port port) {
final OffsetOrientation orientation =
OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final OffsetOrientation orientation = OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
if(orientation != null) {
if(orientation.getOrientation().getValue() == EOrientation.EAST_VALUE) {
return "";
} else if(orientation.getOrientation().getValue() == EOrientation.WEST_VALUE) {
return "";
} else if(orientation.getOrientation().getValue() == EOrientation.NORTH_VALUE) {
if(automaticLabelLayout && port.getComponent().getId() != selectedComponent.getId()) {
if(automaticLabelLayout &&
port.getComponent().getId() != selectedComponent.getId()) {
return "writing-mode: lr-tb";
}
} else if(orientation.getOrientation().getValue() == EOrientation.SOUTH_VALUE) {
if(automaticLabelLayout && port.getComponent().getId() != selectedComponent.getId()) {
if(automaticLabelLayout &&
port.getComponent().getId() != selectedComponent.getId()) {
return "writing-mode: lr-tb";
}
}
......@@ -460,21 +458,22 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
/** Gets the port label transform. */
protected String getPortLabelTransform(Port port) {
final OffsetOrientation orientation =
OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
final OffsetOrientation orientation = OffsetOrientationUtils.getOffsetOrientation(port,
LayoutKeyConstants.CONNECTOR_OFFSET_ORIENTATION);
if(orientation != null) {
if(orientation.getOrientation().getValue() == EOrientation.EAST_VALUE) {
return "";
} else if(orientation.getOrientation().getValue() == EOrientation.WEST_VALUE) {
return "";
} else if(orientation.getOrientation().getValue() == EOrientation.NORTH_VALUE) {
if(automaticLabelLayout && port.getComponent().getId() != selectedComponent.getId()) {
if(automaticLabelLayout &&
port.getComponent().getId() != selectedComponent.getId()) {
final Point position = getPortPosition(port, false);
return String.format("rotate(90 %s,%s)", position.getX(), position.getY() + 8);
}
} else if(orientation.getOrientation().getValue() == EOrientation.SOUTH_VALUE) {
if(automaticLabelLayout && port.getComponent().getId() != selectedComponent.getId()) {
if(automaticLabelLayout &&
port.getComponent().getId() != selectedComponent.getId()) {
final Point position = getPortPosition(port, false);
return String.format("rotate(90 %s,%s)", position.getX() + 8, position.getY());
}
......@@ -515,22 +514,18 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
final ChannelImpl channel = (ChannelImpl)connection;
final Port sourcePort = channel.getSource();
final Point sourcePoint =
getPortPosition(sourcePort, parentComponent.getId() == sourcePort
.getComponent().getId());
final Point sourcePoint = getPortPosition(sourcePort,
parentComponent.getId() == sourcePort.getComponent().getId());
final Port targetPort = channel.getTarget();
final Point targetPoint =
getPortPosition(targetPort, parentComponent.getId() == targetPort
.getComponent().getId());
final Point targetPoint = getPortPosition(targetPort,
parentComponent.getId() == targetPort.getComponent().getId());
final Points points =
EcoreUtil.copy(PointsUtils.getPoints(channel,
LayoutKeyConstants.CONNECTION_POINTS));
final Points points = EcoreUtil
.copy(PointsUtils.getPoints(channel, LayoutKeyConstants.CONNECTION_POINTS));
final SVGConnection svgConnection =
new SVGConnection(doc, channel.getName(), sourcePoint.getX(),
sourcePoint.getY());
final SVGConnection svgConnection = new SVGConnection(doc, channel.getName(),
sourcePoint.getX(), sourcePoint.getY());
for(final Point point : points.getPoints()) {
point.setX(xTranslation + point.getX());
point.setY(yTranslation + point.getY());
......@@ -546,8 +541,8 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
}
/** Creates the svg components. */
private void
createSVGComponents(Document doc, Element svgRootElement, Component parentComponent) {
private void createSVGComponents(Document doc, Element svgRootElement,
Component parentComponent) {
for(final Component component : parentComponent.getSubComponents()) {
final Point point = getComponentPoint(component);
final Dimension dimension = getComponentDimension(component);
......@@ -555,9 +550,8 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
maxWidth = Math.max(maxWidth, point.getX() + dimension.getWidth());
maxHeight = Math.max(maxHeight, point.getY() + dimension.getHeight());
final SVGComponent svgComponent =
new SVGComponent(doc, component.getName(), point.getX(), point.getY(),
dimension.getWidth(), dimension.getHeight());
final SVGComponent svgComponent = new SVGComponent(doc, component.getName(),
point.getX(), point.getY(), dimension.getWidth(), dimension.getHeight());
svgRootElement.appendChild(svgComponent.getElement());
svgRootElement.appendChild(svgComponent.getLabelElement());
}
......@@ -579,23 +573,19 @@ public abstract class AbstractComponentToImage implements IContextMenuContributo
if(connector instanceof InputPort) {
if(isRootLevel) {
svgPort =
new SVGOutputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
svgPort = new SVGOutputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
} else {
svgPort =
new SVGInputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
svgPort = new SVGInputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
}
} else if(connector instanceof OutputPort) {
if(isRootLevel) {
svgPort =
new SVGInputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
svgPort = new SVGInputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
} else {
svgPort =
new SVGOutputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
svgPort = new SVGOutputConnector(doc, ((Port)connector).getName(), point.getX(),
point.getY());
}
} else {
continue;
......
......@@ -63,12 +63,12 @@ public class ExportComponentToImage extends AbstractComponentToImage {
contextProvider instanceof NavigatorViewPart) {
if(selection instanceof ComponentArchitecture) {
selectedComponent = ((ComponentArchitecture)selection).getTopComponent();
contributionItems.add(new ActionContributionItem(new ExportDiagramToImageAction(
"Export component as image ...")));
contributionItems.add(new ActionContributionItem(
new ExportDiagramToImageAction("Export component as image ...")));
} else if(selection instanceof Component) {
selectedComponent = (Component)selection;
contributionItems.add(new ActionContributionItem(new ExportDiagramToImageAction(
"Export diagram as image ...")));
contributionItems.add(new ActionContributionItem(
new ExportDiagramToImageAction("Export diagram as image ...")));
}
}
......@@ -103,7 +103,8 @@ public class ExportComponentToImage extends AbstractComponentToImage {
final String[] filterExt = {"*.svg", "*.png", "*.pdf"};
fd.setFilterExtensions(filterExt);
fd.setFileName(selectedComponent.getName() + "." + parameterDialog.getImageFormat());
fd.setFileName(
selectedComponent.getName() + "." + parameterDialog.getImageFormat());
final String fileName = fd.open();
if((fileName == null) || fileName.isEmpty()) {
......
......@@ -103,8 +103,8 @@ public class ExportModelToDocument extends AbstractComponentToImage {
private class ExportModelToDocumentAction extends Action {
/** Constructor. */
ExportModelToDocumentAction() {
super("Export model as document ...", DiagramUIActivator
.getImageDescriptor("icons/diagram.png"));
super("Export model as document ...",
DiagramUIActivator.getImageDescriptor("icons/diagram.png"));
}
/** {@inheritDoc} */
......
ComponentToImageDialog.java 374c6479a46afad3989416c594ab934f7e054d86 GREEN
ModelToDocumentDialog.java e352c278a81613bc027fb7d14fd003ee20d48a8e GREEN
ComponentToImageDialog.java ced18e3e73251aa6bdfc92d8e15255396fa065ab GREEN
ModelToDocumentDialog.java 55b11255b18d93573ab290fb85403a44a996f710 GREEN
......@@ -109,8 +109,8 @@ public class ComponentToImageDialog extends Dialog {
btnAutomaticPortLabelLayout.setSelection(true);
btnAutomaticPortLabelLayout.setAlignment(SWT.RIGHT);
btnAutomaticPortLabelLayout.setText("Automatic port pabel payout");
btnAutomaticPortLabelLayout
.setToolTipText("Set automatically the port label orientation basing on the port and connection positions");
btnAutomaticPortLabelLayout.setToolTipText(
"Set automatically the port label orientation basing on the port and connection positions");
return container;
}
......
......@@ -35,7 +35,7 @@ import eu.fbk.af3.tools.diagram.DocumentGenerator;
* The Class ModelToDocumentDialog.
*
* @author braghieri
* */
*/
public class ModelToDocumentDialog extends Dialog {
/** The combo format. */
private Combo comboFormat;
......@@ -119,8 +119,8 @@ public class ModelToDocumentDialog extends Dialog {
btnAutomaticPortLabelLayout.setSelection(true);
btnAutomaticPortLabelLayout.setAlignment(SWT.RIGHT);
btnAutomaticPortLabelLayout.setText("Automatic port label layout");
btnAutomaticPortLabelLayout
.setToolTipText("Set automatically the port label orientation basing on the port and connection positions");
btnAutomaticPortLabelLayout.setToolTipText(
"Set automatically the port label orientation basing on the port and connection positions");
btnShowLeafComponents = new Button(container, SWT.CHECK);
btnShowLeafComponents.setSelection(false);
......
AF3AllocationUIActivator.java d937f2b7e68d34264225f9c23f4e5794eb8bca0d GREEN
AF3AllocationUIActivator.java d0d2f939b1c8a1ba0995a3dc6dfd2c197ab09832 GREEN
DefaultStyle.java 1981ac9801c7867c08868dde009415db4c5c8ba8 GREEN
......@@ -27,7 +27,7 @@ import org.osgi.framework.BundleContext;
public class AF3AllocationUIActivator extends AbstractUIPlugin {
/** The plug-in ID. */
public static final String PLUGIN_ID = AF3AllocationUIActivator.class.getPackage().getName(); //$NON-NLS-1$
public static final String PLUGIN_ID = AF3AllocationUIActivator.class.getPackage().getName(); // $NON-NLS-1$
/** The shared instance. */
private static AF3AllocationUIActivator plugin;
......
AllocationTableEditor.java 79198e16867c53ec52f0c92f7d248e29b180d755 GREEN
ModelListenerEditorBase.java e22bfb262f51e12af1b4b4615ecf418cfbdfc33b GREEN
ParameterTableEditor.java b38ec7e6883c5684e060425f0c6177a6f013387f GREEN
AllocationTableEditor.java 5d473cd630256207751cf97c8cf9303bc6bed941 GREEN
ModelListenerEditorBase.java 58b87e9e61fd9dc63f8f870909d09444f44cd42b GREEN
ParameterTableEditor.java 9c1b433151a3f1dd8e80e8d8212e6c675dad430b GREEN
......@@ -67,8 +67,8 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
* @author barner
* @author zverlov
*/
public abstract class AllocationTableEditor<T extends AllocationTable> extends
ModelListenerEditorBase<T> {
public abstract class AllocationTableEditor<T extends AllocationTable>
extends ModelListenerEditorBase<T> {
/** {@link AllocationEntry} type to be edited in this {@link AllocationTableEditor}. */
private Class<? extends AllocationEntry> allocationEntryType;
......@@ -109,7 +109,7 @@ public abstract class AllocationTableEditor<T extends AllocationTable> extends
private TreeViewerManager<T> treeViewerManager;
/** Constructor. */
/* package */AllocationTableEditor(Class<? extends AllocationEntry> allocationEntryType,
/* package */ AllocationTableEditor(Class<? extends AllocationEntry> allocationEntryType,
ViewElementFilter sourceViewElementFilter, ViewElementFilter targetViewElementFilter,
boolean uniqueSourceView, List<EStructuralFeature> observedFeatures) {
......@@ -174,14 +174,14 @@ public abstract class AllocationTableEditor<T extends AllocationTable> extends
/** Returns the source model type. */
private Class<? extends IProjectRootElement> getSourceModelType() {
return IAllocationService.getInstance().getSourceModelType(
getAllocationTableType(getEditedObject().getClass()));
return IAllocationService.getInstance()
.getSourceModelType(getAllocationTableType(getEditedObject().getClass()));
}
/** Returns the target model type. */
private Class<? extends IProjectRootElement> getTargetModelType() {
return IAllocationService.getInstance().getTargetModelType(
getAllocationTableType(getEditedObject().getClass()));
return IAllocationService.getInstance()
.getTargetModelType(getAllocationTableType(getEditedObject().getClass()));
}
/** Returns {@link #sourceEntityType}. */
......@@ -302,9 +302,8 @@ public abstract class AllocationTableEditor<T extends AllocationTable> extends
boolean changeSelection = true;
if(!getEditedObject().getAllocationEntries().isEmpty()) {
changeSelection =
openConfirm(Display.getCurrent().getActiveShell(), "Reset Allocation",
"Selecting a different source or target view will reset the allocation. Are you sure?");
changeSelection = openConfirm(Display.getCurrent().getActiveShell(), "Reset Allocation",
"Selecting a different source or target view will reset the allocation. Are you sure?");
}
if(changeSelection) {
......@@ -438,11 +437,11 @@ public abstract class AllocationTableEditor<T extends AllocationTable> extends
getEditedObject()::getTargetView);
updateModelSelectionComboBox(gui.getComboViewerTarget(), targetModels, targetView);
gui.getCheckboxShowSourceModelHierarchy().addSelectionListener(
new SourceModelHierarchyCheckBoxSelectionListener());
gui.getCheckboxShowSourceModelHierarchy()
.addSelectionListener(new SourceModelHierarchyCheckBoxSelectionListener());
gui.getCheckboxSortColumns().addSelectionListener(
new SortColumnsCheckBoxSelectionListener());
gui.getCheckboxSortColumns()
.addSelectionListener(new SortColumnsCheckBoxSelectionListener());
super.createPartControl(parent);
......@@ -619,9 +618,8 @@ public abstract class AllocationTableEditor<T extends AllocationTable> extends
if(modelView == null || entityType == null) {
return emptyList();
}
Stream<IModelElement> modelElements =
asStream(modelView.eAllContents()).filter(entityType::isInstance).map(
entityType::cast);
Stream<IModelElement> modelElements = asStream(modelView.eAllContents())
.filter(entityType::isInstance).map(entityType::cast);
if(elementFilter != null) {
modelElements = modelElements.filter(elementFilter);
......@@ -629,13 +627,17 @@ public abstract class AllocationTableEditor<T extends AllocationTable> extends
return modelElements.collect(toList());
}
/** Determines the list of source model elements offered in this {@link AllocationTableEditor}. */
/**
* Determines the list of source model elements offered in this {@link AllocationTableEditor}.
*/
public List<? extends IModelElement> getSourceViewModelElements() {
return getModelViewElements(getEditedObject().getSourceView(), getSourceEntityType(),
sourceViewElementFilter);
}
/** Determines the list of target model elements offered in this {@link AllocationTableEditor}. */
/**
* Determines the list of target model elements offered in this {@link AllocationTableEditor}.
*/
public List<? extends IModelElement> getTargetViewModelElements() {
return getModelViewElements(getEditedObject().getTargetView(), getTargetEntityType(),
targetViewElementFilter);
......
......@@ -143,7 +143,7 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
* <b>Note:</b> This method does not refresh the contents of the {@code model}. See:
* <ul>
* <li>{@link #addEntity(IModelElement)}</li>
* <li> {@link #removeEntity(IModelElement)})</li>
* <li>{@link #removeEntity(IModelElement)})</li>
* </ul>
*/
protected abstract void renameEntity(IModelElement entity);
......@@ -221,10 +221,9 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
* @param modelGetter
* Method used to extract the view that is currently set in the model.
*/
private void
setViewFromSelection(ISelection selection,
Consumer<IProjectRootElement> modelSetter,
Supplier<IProjectRootElement> modelGetter) {
private void setViewFromSelection(ISelection selection,
Consumer<IProjectRootElement> modelSetter,
Supplier<IProjectRootElement> modelGetter) {
IProjectRootElement newModel = checkAndPickFirst(selection, IProjectRootElement.class);
......@@ -236,7 +235,9 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
}
}
/** Populates the {@link ComboViewer}'s list of available elements at the moment it is opened. */
/**
* Populates the {@link ComboViewer}'s list of available elements at the moment it is opened.
*/
protected abstract void comboViewerOpened(ComboViewer viewer);
/**
......@@ -260,8 +261,8 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
}
});
comboViewer.addSelectionChangedListener(new ModelViewComboBoxSelectionListener(modelSetter,
modelGetter));
comboViewer.addSelectionChangedListener(
new ModelViewComboBoxSelectionListener(modelSetter, modelGetter));
comboViewer.getCombo().addFocusListener(new ModelViewComboBoxFocusListener(comboViewer));
}
......
......@@ -58,9 +58,8 @@ public class ParameterTableEditor<T extends ParameterTable> extends AllocationTa
Class<? extends IAnnotatedSpecification> annotationType,
Collection<Class<? extends IAnnotatedSpecification>> sourceEntityAnnotationTypes) {
Set<EStructuralFeature> rval =
new HashSet<EStructuralFeature>(getEClassForClass(annotationType)
.getEAllStructuralFeatures());
Set<EStructuralFeature> rval = new HashSet<EStructuralFeature>(
getEClassForClass(annotationType).getEAllStructuralFeatures());
if(sourceEntityAnnotationTypes != null) {
for(Class<? extends IAnnotatedSpecification> clazz : sourceEntityAnnotationTypes) {
rval.addAll(getEClassForClass(clazz).getEAllStructuralFeatures());
......
ParameterEntryTreeViewerEditingSupport.java 69f3adf4813955b692acf8f954d815be7156eeb7 GREEN
ParameterEntryTreeViewerLabelProvider.java bbb18be72b52079ca9bd79e9998e8d1f74f3cfca GREEN
ParameterSourceElementTreeViewerEditingSupport.java cc639e989183b727106a70fdd28d75fd19a675c7 GREEN
ParameterSourceElementTreeViewerLabelProvider.java 84d70ac47dcbfebaf6645c1fe8e2f077f5f6b2dc GREEN
ParameterTableTreeViewerManager.java d219581d334ba752c0fd33efc83138ddfa6912fd GREEN
TreeViewerCheckBoxEditingSupport.java a887a301c584ab762c1fb9141f4dded013c6b7cd GREEN
TreeViewerCheckBoxLabelProvider.java 27c75b01645feefad14fccc397d98db7efe2f024 GREEN
ParameterEntryTreeViewerEditingSupport.java a38a4ca6312a98056ccceb292b92d5d5d669a1b6 GREEN
ParameterEntryTreeViewerLabelProvider.java 6306b45b4ca5da3776ffb706d6c5eb961f0b78ed GREEN
ParameterSourceElementTreeViewerEditingSupport.java 9e30e6e0df10beaaf3231c9ff06a0c5ab1df9b34 GREEN
ParameterSourceElementTreeViewerLabelProvider.java cb886708a180db20dee0411b37fa32185b9a95f5 GREEN
ParameterTableTreeViewerManager.java 691deeb8ad9e450e9a81cc68a46fe2c81b5cae2b GREEN
TreeViewerCheckBoxEditingSupport.java 87b42f61f28ec463ecce1140018757026013d26d GREEN
TreeViewerCheckBoxLabelProvider.java f00eb84dd98f558def816d581d7964ed9365287b GREEN
TreeViewerContentProvider.java e19b353b4f7624fd38db782524fed5cdf66dff55 GREEN
TreeViewerFirstColumnLabelProvider.java 5dd1ea7aaef85eefe483d1ed55e1ee458abe1bc2 GREEN
TreeViewerManager.java 5727fa6ea42da45b167f9dfbe6f839e37d2a3a7b GREEN
TreeViewerFirstColumnLabelProvider.java 41af5aeea1c94de2deb2a024b5d0c589302b0c15 GREEN
TreeViewerManager.java e6e3ab6b73c12ebc202f207098f1543f85a12ebf GREEN
......@@ -39,8 +39,8 @@ import org.fortiss.tooling.base.model.element.IModelElement;
*
* @author barner
*/
public class ParameterEntryTreeViewerEditingSupport<T extends ParameterTable> extends
EditingSupport {
public class ParameterEntryTreeViewerEditingSupport<T extends ParameterTable>
extends EditingSupport {
/** The underlying {@link ParameterTable}. */
private T parameterTable;
......@@ -58,8 +58,8 @@ public class ParameterEntryTreeViewerEditingSupport<T extends ParameterTable> ex
private Class<? extends IAnnotatedSpecification> annotationType;
/** The editor used to manipulate the value of the cell. */
private TextCellEditor textCellEditor = new TextCellEditor((Composite)getViewer().getControl(),
SWT.NONE);
private TextCellEditor textCellEditor =
new TextCellEditor((Composite)getViewer().getControl(), SWT.NONE);
/** Constructor. */
public ParameterEntryTreeViewerEditingSupport(T parameterTable,
......@@ -94,9 +94,8 @@ public class ParameterEntryTreeViewerEditingSupport<T extends ParameterTable> ex
@Override
protected Object getValue(Object element) {
if(element instanceof IModelElement) {
final String value =
getParameterEntryValue(parameterTable, (IModelElement)element, targetElement,
parameterEntryType, annotationType);
final String value = getParameterEntryValue(parameterTable, (IModelElement)element,
targetElement, parameterEntryType, annotationType);
// Return empty String instead of null since otherwise the CellEditor cannot be
// initialized correctly when editing an empty cell.
return value != null ? value : "";
......@@ -108,18 +107,16 @@ public class ParameterEntryTreeViewerEditingSupport<T extends ParameterTable> ex
@Override
protected void setValue(Object element, Object value) {
if(element instanceof IModelElement) {
runAsCommand(
parameterTable,
() -> {
final IModelElement sourceElement = (IModelElement)element;
if(value != null && !value.equals("")) {
setParameterEntryValue(parameterTable, sourceElement, targetElement,
value, parameterEntryType, annotationType);
} else {
deleteAllocationEntry(parameterTable, parameterEntryType,
sourceElement, targetElement);
}
});
runAsCommand(parameterTable, () -> {
final IModelElement sourceElement = (IModelElement)element;
if(value != null && !value.equals("")) {
<