Commit 1272f13f 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 9e0e062d
ToolingBaseUIActivator.java 45d90dd4c3eebaa75b4957d6d91f6295844c19fb GREEN
ToolingBaseUIActivator.java 42fa7691bceec500b4e08cb28ef7fc69b9f8f658 GREEN
......@@ -26,7 +26,7 @@ import org.osgi.framework.BundleContext;
*/
public class ToolingBaseUIActivator extends AbstractUIPlugin {
/** The plug-in ID. */
public static final String PLUGIN_ID = ToolingBaseUIActivator.class.getPackage().getName(); //$NON-NLS-1$
public static final String PLUGIN_ID = ToolingBaseUIActivator.class.getPackage().getName(); // $NON-NLS-1$
/** The shared instance. */
private static ToolingBaseUIActivator plugin;
......
AnnotationEditingSupportBase.java ef0033f37de2c0bd601cf3c9fbb2760a54734ded GREEN
AnnotationEditingSupportBase.java a5ecf54616b50f947d251f45cbb5789df5234170 GREEN
CheckBoxEditingSupport.java 1d8d9dd444f0e52767c65fd2711321438d3a9b29 GREEN
ComboBoxEditingSupport.java b1f0141af2a242d6fe4bdcc8f7c627146b3b9347 GREEN
EditingSupportFactory.java 291d4d0389f9fc4713701af9afede0e312712da5 GREEN
ComboBoxEditingSupport.java 6b6a23be327ebdea9bdaf007304bd3d7c14b2cef GREEN
EditingSupportFactory.java 03123559abc2952e417e6180b9364c2f5ecff4a3 GREEN
ElementCommentEditingSupport.java 4be366924a040caf3f80e35b383e796e84aedcac GREEN
ElementEditingSupportBase.java a6360f99ee149276f0fbd299820ebd1c9731ea97 GREEN
ElementNameEditingSupport.java 0dcaecf4ba5f8ddefa3ccb7d6f4e4506f7f09b26 GREEN
LabelValueMapping.java 267a390e5451212af4b9fadd3e259dac7491c59f GREEN
MultiSelectionCellEditor.java 6415d4e8ae464a3a7455679c280fc2e8b2ae58da GREEN
MultiSelectionEditingSupport.java ca89f1c69d2cb28e7b1eceae6428c1c7880ff36f GREEN
LabelValueMapping.java 54bf09ebd23039827a72dfbe9edb3d117f2db607 GREEN
MultiSelectionCellEditor.java cac4a63137203ea90777b8ff971c945a457165c2 GREEN
MultiSelectionEditingSupport.java c9d45d09c2d64518d58e6e62254804608638a0ed GREEN
TextEditingSupport.java e761ea393816f23ca41157f2a9a9a8d8ef30b858 GREEN
......@@ -88,22 +88,20 @@ public abstract class AnnotationEditingSupportBase extends EditingSupport {
if(element instanceof AnnotationEntry) {
final AnnotationEntry annotationEntry = (AnnotationEntry)element;
ITopLevelElement modelContext =
IPersistencyService.getInstance().getTopLevelElementFor(
annotationEntry.getModelElement());
modelContext
.runAsCommand(() -> {
try {
doSetValue(annotationEntry, value);
} catch(IllegalArgumentException e) {
String msg =
"The value you entered does not have the desired type.\nDetailed message:\n" +
e.getMessage();
openError(new Shell(), "ERROR", msg);
} catch(Exception e) {
openError(new Shell(), "ERROR", e.getMessage());
}
});
ITopLevelElement modelContext = IPersistencyService.getInstance()
.getTopLevelElementFor(annotationEntry.getModelElement());
modelContext.runAsCommand(() -> {
try {
doSetValue(annotationEntry, value);
} catch(IllegalArgumentException e) {
String msg =
"The value you entered does not have the desired type.\nDetailed message:\n" +
e.getMessage();
openError(new Shell(), "ERROR", msg);
} catch(Exception e) {
openError(new Shell(), "ERROR", e.getMessage());
}
});
this.getViewer().refresh(true);
}
}
......
......@@ -103,8 +103,8 @@ public class ComboBoxEditingSupport extends AnnotationEditingSupportBase {
* </p>
*/
@SuppressWarnings("unchecked")
private <T extends IAnnotatedSpecification> LabelValueMapping getLabelValueMapping(
AnnotationEntry entry) {
private <T extends IAnnotatedSpecification> LabelValueMapping
getLabelValueMapping(AnnotationEntry entry) {
ValueProviderBase<T> valueProvider =
(ValueProviderBase<T>)entry.getAnnotationValueProvider(specClass);
valueProvider.updateInputChoice(getViewer().getInput(), (Class<T>)specClass);
......@@ -128,8 +128,8 @@ public class ComboBoxEditingSupport extends AnnotationEditingSupportBase {
// Allow to unset EReferences. This does not make sense for EENums which have a default
// value. Resetting of String-based annotations is handled in TextEditingSupport.
if(eStructuralFeatureDescriptor != null &&
eStructuralFeatureDescriptor.getEType(entry.getSpecification(specClass)) instanceof EClass) {
if(eStructuralFeatureDescriptor != null && eStructuralFeatureDescriptor
.getEType(entry.getSpecification(specClass)) instanceof EClass) {
labels.add(UNSET_RESERVED_VALUE);
}
......@@ -153,10 +153,10 @@ public class ComboBoxEditingSupport extends AnnotationEditingSupportBase {
}
if(label != null) {
super.setValue(
element,
label.equals(UNSET_RESERVED_VALUE) ? null : getLabelValueMapping(
(AnnotationEntry)element).getValueForLabel(label.toString()));
super.setValue(element,
label.equals(UNSET_RESERVED_VALUE) ? null
: getLabelValueMapping((AnnotationEntry)element)
.getValueForLabel(label.toString()));
}
}
......
......@@ -46,8 +46,7 @@ public class EditingSupportFactory {
* Creates the {@link EditingSupport} that is directly based on
* {@link DerivedAnnotationValueProviderBase}.
*/
private static
<T extends IDerivedAnnotation<?>, V extends DerivedAnnotationValueProviderBase<T>>
private static <T extends IDerivedAnnotation<?>, V extends DerivedAnnotationValueProviderBase<T>>
EditingSupport createEditingSupport4DerivedAnnotationValueProviderBase(V valueProvider,
ColumnViewer viewer, Class<? extends IAnnotatedSpecification> clazz,
T specification) throws Exception {
......@@ -57,7 +56,8 @@ public class EditingSupportFactory {
}
return createEditingSupport4EStructuralFeatureValueProviderBase(
(EStructuralFeatureValueProviderBase<T>)valueProvider, viewer, clazz, specification);
(EStructuralFeatureValueProviderBase<T>)valueProvider, viewer, clazz,
specification);
}
/**
......@@ -75,16 +75,13 @@ public class EditingSupportFactory {
* @return {@link EditingSupport} that is directly based on
* {@link EStructuralFeatureValueProviderBase}.
*/
private static
<T extends IAnnotatedSpecification, V extends EStructuralFeatureValueProviderBase<T>>
EditingSupport createEditingSupport4EStructuralFeatureValueProviderBase(
V valueProvider, ColumnViewer viewer,
Class<? extends IAnnotatedSpecification> clazz, T specification)
throws Exception {
EStructuralFeature structuralFeature =
valueProvider.getEStructuralFeatureDescriptor()
.getEStructuralFeature(specification);
private static <T extends IAnnotatedSpecification, V extends EStructuralFeatureValueProviderBase<T>>
EditingSupport createEditingSupport4EStructuralFeatureValueProviderBase(V valueProvider,
ColumnViewer viewer, Class<? extends IAnnotatedSpecification> clazz,
T specification) throws Exception {
EStructuralFeature structuralFeature = valueProvider.getEStructuralFeatureDescriptor()
.getEStructuralFeature(specification);
if(structuralFeature == null) {
throw new Exception("EStructuralValueProvider: feature has not been set.");
......
......@@ -105,7 +105,8 @@ public class LabelValueMapping {
@SuppressWarnings("unchecked") Class<? extends EObject> instanceClass =
(Class<? extends EObject>)eType.getInstanceClass();
for(EObject obj : getChildrenWithType(root, instanceClass)) {
if(eStructuralFeatureDescriptor.isAvailableObject(obj, specification, modelElement)) {
if(eStructuralFeatureDescriptor.isAvailableObject(obj, specification,
modelElement)) {
values.add(obj);
}
}
......@@ -116,8 +117,8 @@ public class LabelValueMapping {
if(v instanceof INamedElement) {
if(root instanceof INamedElement) {
String label = computeRelativeName((INamedElement)root, (INamedElement)v);
if(eStructuralFeatureDescriptor.getEReferenceScope().equals(
EStructuralFeatureDescriptor.EReferenceScope.PROJECT)) {
if(eStructuralFeatureDescriptor.getEReferenceScope()
.equals(EStructuralFeatureDescriptor.EReferenceScope.PROJECT)) {
// Strip explicit qualification of project name
int i = label.indexOf(".");
if(i != -1) {
......
......@@ -190,13 +190,10 @@ public class MultiSelectionCellEditor extends DialogCellEditor {
Button okButton = getButton(IDialogConstants.OK_ID);
int n = dl.getSelectionCount();
boolean lowerBoundOk =
lowerMultiplicityBound == UNSPECIFIED_MULTIPLICITY ||
n >= lowerMultiplicityBound;
boolean upperBoundOk =
upperMultiplicityBound == UNSPECIFIED_MULTIPLICITY ||
upperMultiplicityBound == UNBOUNDED_MULTIPLICITY ||
n <= upperMultiplicityBound;
boolean lowerBoundOk = lowerMultiplicityBound == UNSPECIFIED_MULTIPLICITY ||
n >= lowerMultiplicityBound;
boolean upperBoundOk = upperMultiplicityBound == UNSPECIFIED_MULTIPLICITY ||
upperMultiplicityBound == UNBOUNDED_MULTIPLICITY || n <= upperMultiplicityBound;
okButton.setEnabled(lowerBoundOk && upperBoundOk);
}
......@@ -215,20 +212,17 @@ public class MultiSelectionCellEditor extends DialogCellEditor {
upperMultiplicityBound == UNBOUNDED_MULTIPLICITY) {
title = "Select multiple elements";
} else {
title =
"Select at most " + upperMultiplicityBound + " " +
titleElementStringHelper(upperMultiplicityBound);
title = "Select at most " + upperMultiplicityBound + " " +
titleElementStringHelper(upperMultiplicityBound);
}
} else {
if(upperMultiplicityBound == UNSPECIFIED_MULTIPLICITY ||
upperMultiplicityBound == UNBOUNDED_MULTIPLICITY) {
title =
"Select at least " + lowerMultiplicityBound + " " +
titleElementStringHelper(lowerMultiplicityBound);
title = "Select at least " + lowerMultiplicityBound + " " +
titleElementStringHelper(lowerMultiplicityBound);
} else {
title =
"Select " + lowerMultiplicityBound + " to " + upperMultiplicityBound +
" " + titleElementStringHelper(upperMultiplicityBound);
title = "Select " + lowerMultiplicityBound + " to " + upperMultiplicityBound +
" " + titleElementStringHelper(upperMultiplicityBound);
}
}
newShell.setText(title);
......
......@@ -75,9 +75,8 @@ public class MultiSelectionEditingSupport extends AnnotationEditingSupportBase {
return null;
}
LabelValueMapping labelValueMapping =
new LabelValueMapping(eStructuralFeatureDescriptor, specification,
((AnnotationEntry)element).getModelElement(), null);
LabelValueMapping labelValueMapping = new LabelValueMapping(eStructuralFeatureDescriptor,
specification, ((AnnotationEntry)element).getModelElement(), null);
// Values need to be copied since during the set operation in setValue(), the original
// reference will be cleared. Hence, in case the user canceled the edit (in
......@@ -142,9 +141,8 @@ public class MultiSelectionEditingSupport extends AnnotationEditingSupportBase {
if(element instanceof AnnotationEntry && value instanceof Collection<?>) {
final AnnotationEntry entry = (AnnotationEntry)element;
ITopLevelElement modelContext =
IPersistencyService.getInstance()
.getTopLevelElementFor(entry.getModelElement());
ITopLevelElement modelContext = IPersistencyService.getInstance()
.getTopLevelElementFor(entry.getModelElement());
modelContext.runAsCommand(new Runnable() {
@Override
......
AnnotationLabelProvider.java ddebfc2bf2c8306884eb748c2c649ff0fe9c3d21 GREEN
CheckBoxLabelProvider.java 83f7216dfc05400c5b96aeba8c1add6a02f0eac5 GREEN
AnnotationLabelProvider.java b56be15c6cac75d2eb7940b98063fb084baa1093 GREEN
CheckBoxLabelProvider.java 4030bef65a3b919cb087828b4616e5c966380e3e GREEN
ElementCommentLabelProvider.java 76aa6e9b930ce5680607852fd776172942c89ce5 GREEN
ElementLabelProviderBase.java f33502f73033ebdf30316df627e8a9c87e7d1b28 GREEN
ElementNameLabelProvider.java 897296ac8318b6dfdea9c50fc73aaeea23c2fffa GREEN
......
......@@ -35,12 +35,12 @@ import org.fortiss.tooling.base.ui.annotation.view.IAnnotationViewPart;
public class AnnotationLabelProvider extends LabelProviderBase {
/** Background color for annotations that cannot be edited (and that are not derived). */
private static final Color READ_ONLY_ANNOTATION_BACKGROUND_COLOR = SWTResourceManager.getColor(
230, 230, 230);
private static final Color READ_ONLY_ANNOTATION_BACKGROUND_COLOR =
SWTResourceManager.getColor(230, 230, 230);
/** Background color for derived (computed) annotations. */
private static final Color DERIVED_ANNOTATION_BACKGROUND_COLOR = SWTResourceManager.getColor(
200, 240, 250);
private static final Color DERIVED_ANNOTATION_BACKGROUND_COLOR =
SWTResourceManager.getColor(200, 240, 250);
/** Type of annotation that is displayed by this {@link AnnotationLabelProvider}. */
protected Class<? extends IAnnotatedSpecification> clazz;
......
......@@ -62,8 +62,8 @@ public class CheckBoxLabelProvider extends AnnotationLabelProvider {
public Image getImage(Object element) {
if(element instanceof AnnotationEntry) {
boolean enabled = ((AnnotationEntry)element).canEdit(clazz);
return org.fortiss.tooling.base.ui.viewers.CheckBoxLabelProvider.getImage(
isChecked(element), enabled);
return org.fortiss.tooling.base.ui.viewers.CheckBoxLabelProvider
.getImage(isChecked(element), enabled);
}
return null;
}
......
AnnotationViewPartBase.java cfbe1fd7602fbd5d7fbcb06d2a35714cb0b069af GREEN
AnnotationViewPartBase.java 7512f37b761b118c73a2555376f8e673ddaf1bd9 GREEN
IAnnotationViewPart.java a011f327370ded8738031059f9c3b94ce6ba63d1 GREEN
......@@ -53,15 +53,16 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* Base class for annotation views:
* <ul>
* <li>Maintain set of annotations displayed in annotation view.</li>
* <li>Selection management (mapping of selection in annotation view and related model elements).</li>
* <li>Selection management (mapping of selection in annotation view and related model
* elements).</li>
* <li>Watch model for changes and trigger view update.</li>
* </ul>
*
* @author eder
* @author barner
*/
public abstract class AnnotationViewPartBase extends ViewPart implements ISelectionListener,
IAnnotationViewPart {
public abstract class AnnotationViewPartBase extends ViewPart
implements ISelectionListener, IAnnotationViewPart {
/** Currently selected object. */
private IModelElement currentlySelectedObject;
......@@ -138,15 +139,14 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
return;
}
boolean isAddOrRemoveEvent =
eventType == Notification.ADD || eventType == Notification.ADD_MANY ||
eventType == Notification.REMOVE ||
eventType == Notification.REMOVE_MANY;
boolean isAddOrRemoveEvent = eventType == Notification.ADD ||
eventType == Notification.ADD_MANY || eventType == Notification.REMOVE ||
eventType == Notification.REMOVE_MANY;
if(isAddOrRemoveEvent || eventType == Notification.SET) {
Object notifier = notification.getNotifier();
if((notifier instanceof EObject) &&
(IPersistencyService.getInstance().getTopLevelElementFor((EObject)notifier) != null)) {
if((notifier instanceof EObject) && (IPersistencyService.getInstance()
.getTopLevelElementFor((EObject)notifier) != null)) {
// Ignore update requests for elements that are not hooked to a top-level
// element, e.g. SET events that are fired when a component is removed (before
// the actual REMOVE event). Otherwise, the AnnotationValueService would create
......@@ -164,9 +164,9 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
if(isAddOrRemoveEvent) {
// Invalidate cache if elements are added to / removed from the model
lastAnnotationEntriesMap
.put(getParentElement(modelElement, IProjectRootElement.class,
true), null);
lastAnnotationEntriesMap.put(
getParentElement(modelElement, IProjectRootElement.class, true),
null);
}
// Ensure that refresh is run in the UI thread
......@@ -254,8 +254,8 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect
// Equality of model element implies equal hashCode(), order is arbitrary
// but not relevant for ensuring uniqueness of annotation entries.
return Integer.compare(a1.getModelElement().hashCode(), a2.getModelElement()
.hashCode());
return Integer.compare(a1.getModelElement().hashCode(),
a2.getModelElement().hashCode());
}
});
......
ColumnHandle.java 8fc5f04cbb0127e5df8c7a9e3b2620502bf93716 GREEN
GenericAnnotationView.java 0c7f46fa1e4549e619bd9599dbb4f306ca0ca043 GREEN
GenericAnnotationView.java 9ece325e33056bc866aa842a7be5e0be3db84fe0 GREEN
HierarchicalNameViewerComparator.java 393f888a671d788c05650d17c937b76dda8a0f43 GREEN
......@@ -142,7 +142,8 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
* <ul>
* <li>If the {@link AnnotationFilter} is non-{@code null}, it sets the filter and disables the
* {@link AnnotationFilterWidget}. For instance, this can be used to embed / extend the
* {@link GenericAnnotationView} into a specialized view dedicated to a particular model type.</li>
* {@link GenericAnnotationView} into a specialized view dedicated to a particular model
* type.</li>
* <li>Otherwise, this method reinitializes the {@link AnnotationFilterWidget}.</li>
* </ul>
*/
......@@ -381,13 +382,11 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
parameterList = paramDialog.getParameterValues();
}
Runnable r =
createAnnoationActionRunnable(entry, action, actionEntry,
entrySpecification, parameterList, annotationEntries);
Runnable r = createAnnoationActionRunnable(entry, action, actionEntry,
entrySpecification, parameterList, annotationEntries);
ITopLevelElement modelContext =
IPersistencyService.getInstance().getTopLevelElementFor(
entry.getModelElement());
ITopLevelElement modelContext = IPersistencyService.getInstance()
.getTopLevelElementFor(entry.getModelElement());
boolean updateEnabled = isUpdateEnabled();
setUpdateEnabled(false);
......@@ -430,27 +429,24 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
Stream<AnnotationEntry> annotationEntries) {
Runnable r;
if(actionEntry.getScope() == AnnotationActionEntry.ActionScope.ALL_VISIBLE_ITEMS) {
r =
() -> {
for(T annotation : annotationEntries
.map(e -> e.getSpecification(specificationType
.getAnnotatedSpecificationType())).filter(e -> e != null)
.collect(Collectors.toList())) {
// TODO (#2779): Use a (yet to come) LambdaUtil method for the lengthy
// expression above.
action.accept(specificationType, new AnnotationActionParameters<>(
annotation, inputParameters));
}
};
r = () -> {
for(T annotation : annotationEntries.map(
e -> e.getSpecification(specificationType.getAnnotatedSpecificationType()))
.filter(e -> e != null).collect(Collectors.toList())) {
// TODO (#2779): Use a (yet to come) LambdaUtil method for the lengthy
// expression above.
action.accept(specificationType,
new AnnotationActionParameters<>(annotation, inputParameters));
}
};
} else if(actionEntry.getScope() == AnnotationActionEntry.ActionScope.SINGLE_ITEM) {
T annotation =
entry.getSpecification(specificationType.getAnnotatedSpecificationType());
r =
() -> {
action.accept(specificationType, new AnnotationActionParameters<>(
annotation, inputParameters));
};
r = () -> {
action.accept(specificationType,
new AnnotationActionParameters<>(annotation, inputParameters));
};
} else {
r = () -> {/* NOP */
};
......@@ -465,9 +461,8 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
*/
private <T extends IAnnotatedSpecification> void addContextMenuEntries(Menu contextMenu,
IAnnotationValueProvider<T> valueProvider, AnnotationInstSpec<T> annotationClass) {
final Stream<AnnotationEntry> annotationEntriesMatchingFilter =
getLastAnnotationEntries().stream()
.filter(e -> annotationFilter.passesRowFilter(e));
final Stream<AnnotationEntry> annotationEntriesMatchingFilter = getLastAnnotationEntries()
.stream().filter(e -> annotationFilter.passesRowFilter(e));
// Known by construction.
@SuppressWarnings("unchecked") T specification =
......@@ -567,7 +562,7 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
* Creates the (leading) columns which displays the model elements' names and comments.
*
* @returns Number of leading columns.
* */
*/
protected int createFixedModelElementColumns() {
createFixedColumn("Model Element", new ElementNameLabelProvider(this),
new ElementNameEditingSupport(tableViewer));
......@@ -582,8 +577,8 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
* Creates a column in the table viewer displaying the annotation identified by the given
* {@link ColumnHandle}.
*/
protected void createAnnotationColumn(
ColumnHandle<? extends IAnnotatedSpecification> columnHandle) {
protected void
createAnnotationColumn(ColumnHandle<? extends IAnnotatedSpecification> columnHandle) {
TableColumn tableColumn = null;
@SuppressWarnings("unchecked") Class<IAnnotatedSpecification> annotationClass =
......@@ -638,11 +633,8 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
* Creates a {@link TableViewerColumn}, i.e., instantiate matching {@link EditingSupport} and
* {@link LabelProvider} for the given annotation.
*/
private
<T extends IAnnotatedSpecification>
TableViewerColumn
createAnnotationTableViewerColumn(ColumnHandle<T> columnHandle, Class<T> annotationClass)
throws Exception {
private <T extends IAnnotatedSpecification> TableViewerColumn createAnnotationTableViewerColumn(
ColumnHandle<T> columnHandle, Class<T> annotationClass) throws Exception {
TableViewerColumn column = new TableViewerColumn(tableViewer, SWT.NONE);
// Have the matching EditingSupport created for the current annotated specification.
......@@ -654,9 +646,8 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
EditingSupport editingSupport =
createEditingSupport(valueProvider, tableViewer, annotationClass, specification);
ColumnLabelProvider columnLabelProvider =
createLabelProvider(valueProvider, this, tableViewer, editingSupport,
annotationClass, specification);
ColumnLabelProvider columnLabelProvider = createLabelProvider(valueProvider, this,
tableViewer, editingSupport, annotationClass, specification);
column.setEditingSupport(editingSupport);
column.setLabelProvider(columnLabelProvider);
......
AnnotationFilter.java 987cc56bd7d1943f8ed750f5dbd108382608a6bf GREEN
AnnotationFilterWidget.java 78ddeeadae647cc6c4ef047ae60e13feeeb461af GREEN
AnnotationFilter.java 2bf8b803c93f49d106a3597815ef570a8ffcc996 GREEN
AnnotationFilterWidget.java 66ca89b5d823d33f20da3d94bc64bf08faebaade GREEN
TextFocusListener.java 53aac76e88517ecbb34be84e6d2476e6ba101a31 GREEN
......@@ -128,9 +128,8 @@ public class AnnotationFilter extends ViewerFilter {
* element (or if this particular filter option is turned off).
*/
private boolean passesSelectedElementTypeFilter(AnnotationEntry annotationEntry) {
boolean selectedElementIsInvalid =
currentlySelectedModelElement == null ||
currentlySelectedModelElement instanceof IProjectRootElement;
boolean selectedElementIsInvalid = currentlySelectedModelElement == null ||
currentlySelectedModelElement instanceof IProjectRootElement;
if(selectedElementIsInvalid || hierarchyLevelFilter == null) {
return true;
......@@ -190,9 +189,8 @@ public class AnnotationFilter extends ViewerFilter {
*/
public boolean passesColumnFilter(ColumnHandle<?> columnHandle) {
// Whether the annotation is visible (i.e., not principally hidden from any view)
boolean passesHiddenFilter =
!columnHandle.getEntry().isHidden(
columnHandle.getAnnotatedSpecification().getClass());
boolean passesHiddenFilter = !columnHandle.getEntry()
.isHidden(columnHandle.getAnnotatedSpecification().getClass());
// Pass name filter, if: name is not filtered, or the condition is met
boolean passesNameFilter =
......@@ -217,9 +215,8 @@ public class AnnotationFilter extends ViewerFilter {
// Pass name filter, if: name is not filtered, element is not a INamedElement, or it
// actually passes the filter
boolean passesNameFilter =
!filterRowName || !(modelElement instanceof INamedElement) ||
passesNameFilter(((INamedElement)modelElement).getName());
boolean passesNameFilter = !filterRowName || !(modelElement instanceof INamedElement) ||
passesNameFilter(((INamedElement)modelElement).getName());
return passesNameFilter && passesSelectedElementTypeFilter(annotationEntry);
}
......@@ -237,9 +234,8 @@ public class AnnotationFilter extends ViewerFilter {
// type, current level, or current sub-model, ), a full update is required on every
// selection change since the newly selected element might contribute a different set of
// annotations.
boolean filterSettingsRequireFullUpdate =
restrictToSelectedModelElementType ||
!hierarchyLevelFilter.equals(HIERARCHY_LEVELS_ALL);
boolean filterSettingsRequireFullUpdate = restrictToSelectedModelElementType ||
!hierarchyLevelFilter.equals(HIERARCHY_LEVELS_ALL);
return filterSettingsRequireFullUpdate || annotationViewFullUpdateRequested;
}
......@@ -292,8 +288,8 @@ public class AnnotationFilter extends ViewerFilter {
}
/** Sets the annotation type filter option. */
public void setAnnotationTypeFilter(
Class<? extends IAnnotatedSpecification> annotationTypeFilter) {
public void
setAnnotationTypeFilter(Class<? extends IAnnotatedSpecification> annotationTypeFilter) {