Skip to content
Snippets Groups Projects
Commit 1b98da4d authored by Simon Barner's avatar Simon Barner
Browse files

- Allow empty name prefix for multi-instance annotations

- Fix typo in GUI label
- Formatting of comments
refs 1841
parent ec8083b6
No related branches found
No related tags found
No related merge requests found
...@@ -513,15 +513,14 @@ public class GenericAnnotationView extends AnnotationViewPartBase { ...@@ -513,15 +513,14 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
radioButtonComposite.setLayout(new RowLayout()); radioButtonComposite.setLayout(new RowLayout());
final Button filterComponentNamesButton = new Button(radioButtonComposite, SWT.RADIO); final Button filterComponentNamesButton = new Button(radioButtonComposite, SWT.RADIO);
filterComponentNamesButton.setText("Components names"); filterComponentNamesButton.setText("Component names");
filterComponentNamesButton.setSelection(true); filterComponentNamesButton.setSelection(true);
filterComponentNamesButton.addSelectionListener(new SelectionAdapter() { filterComponentNamesButton.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
// widgetSelected() is also fired when the selection is removed from the radio // widgetSelected() is also fired when the selection is removed from the radio
// button, // button, so check, if this is the button that just obtained the selection
// so check, if this is the button that just obtained the selection
if(!((Button)e.getSource()).getSelection()) { if(!((Button)e.getSource()).getSelection()) {
return; return;
} }
...@@ -539,8 +538,7 @@ public class GenericAnnotationView extends AnnotationViewPartBase { ...@@ -539,8 +538,7 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
// widgetSelected() is also fired when the selection is removed from the radio // widgetSelected() is also fired when the selection is removed from the radio
// button, // button, so check, if this is the button that just obtained the selection
// so check, if this is the button that just obtained the selection
if(!((Button)e.getSource()).getSelection()) { if(!((Button)e.getSource()).getSelection()) {
return; return;
} }
...@@ -633,12 +631,14 @@ public class GenericAnnotationView extends AnnotationViewPartBase { ...@@ -633,12 +631,14 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
String specName = String specName =
columnHandle.getEntry().getSpecificationAnnotationName( columnHandle.getEntry().getSpecificationAnnotationName(
columnHandle.getAnnotatedSpecification().getClass()); columnHandle.getAnnotatedSpecification().getClass());
if(specName == null || specName.isEmpty()) {
specName = "<Unnamed Annotation>";
}
if(columnHandle.getInstanceKey() != null) { if(columnHandle.getInstanceKey() != null) {
specName += MULTIINSTANCE_NAME_SEPARATOR + " " + columnHandle.getInstanceKey(); if(!specName.isEmpty()) {
specName += MULTIINSTANCE_NAME_SEPARATOR + " ";
}
specName += columnHandle.getInstanceKey();
} else if(specName == null || specName.isEmpty()) {
specName = "<Unnamed Annotation>";
} }
return specName; return specName;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment