private CheckboxTableViewer tableViewer;\r
private Button removeButton;\r
private Set<Marker> markers = new HashSet<Marker>();\r
- private Button okButton;\r
\r
/**\r
* @param parentShell\r
this.markers.addAll(entity.getMarkers());\r
\r
}\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.jface.window.Window#open()\r
- */\r
- @Override\r
- public int open() {\r
- return super.open();\r
- }\r
- \r
+ \r
/* (non-Javadoc)\r
* @see org.eclipse.jface.dialogs.TitleAreaDialog#createContents(org.eclipse.swt.widgets.Composite)\r
*/\r
gridLayout.numColumns = 2;\r
composite.setLayout(gridLayout);\r
\r
- tableViewer = CheckboxTableViewer.newCheckList(composite, SWT.NULL);\r
+ tableViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);\r
GridData tableLayoutData = new GridData(SWT.FILL, SWT.FILL, true, false);\r
tableLayoutData.heightHint = 300;\r
tableViewer.getTable().setLayoutData(tableLayoutData);\r
\r
tableViewer.addSelectionChangedListener(new ISelectionChangedListener () {\r
public void selectionChanged(SelectionChangedEvent event) {\r
- setRemovedEnabled(true);\r
+ setRemoveEnabled(true);\r
}\r
});\r
\r
removeSelectedMarker();\r
}\r
});\r
- setRemovedEnabled(false);\r
+ setRemoveEnabled(false);\r
\r
populateMarkers();\r
\r
}\r
\r
\r
+ /**\r
+ * \r
+ */\r
+ private void selectAuthor() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
/**\r
* \r
*/\r
/**\r
* \r
*/\r
- protected void setRemovedEnabled(boolean enabled) {\r
+ protected void setRemoveEnabled(boolean enabled) {\r
removeButton.setEnabled(enabled); \r
}\r
\r
}\r
\r
protected void createButtonsForButtonBar(Composite parent) {\r
- okButton = createButton(parent, IDialogConstants.OK_ID,\r
+ createButton(parent, IDialogConstants.OK_ID,\r
IDialogConstants.OK_LABEL, true);\r
createButton(parent, IDialogConstants.CANCEL_ID,\r
IDialogConstants.CANCEL_LABEL, false);\r
public static final String P_ID_TAXONSEC = "P_ID_TAXONSEC";\r
public static final String P_ID_TYPES = "P_ID_TYPES"; \r
public static final String P_ID_DOUBTFUL = "P_ID_DOUBTFUL";\r
- public static final String P_ID_MARKERS = "P_ID_MARKERS";\r
+ public static final String P_ID_TAXON_MARKERS = "P_ID_TAXON_MARKERS";\r
public static final String P_ID_EXTENSIONS = "P_ID_EXTENSIONS";\r
public static final String P_ID_TAXON_ANNOTATIONS = "P_ID_TAXON_ANNOTATIONS";\r
\r
public static final String P_TAXONSEC = "Secundum";\r
public String P_TYPES = "Name Types";\r
public static final String P_DOUBTFUL = "Doubtful?";\r
- public static final String P_MARKERS = "Markers";\r
+ public static final String P_TAXON_MARKERS = "Markers";\r
public static final String P_EXTENSIONS = "Extensions";\r
public static final String P_TAXON_ANNOTATIONS = "Annotations";\r
\r
addDescriptor(P_ID_TYPES);\r
addDescriptor(P_ID_DOUBTFUL); \r
addDescriptor(P_ID_TAXON_ANNOTATIONS);\r
- addDescriptor(P_ID_MARKERS); \r
+ addDescriptor(P_ID_TAXON_MARKERS); \r
addDescriptor(P_ID_EXTENSIONS); \r
}\r
\r
new String[] {"no", "yes"}));\r
}\r
\r
- if (id.equals(P_ID_MARKERS)) {\r
+ if (id.equals(P_ID_TAXON_MARKERS)) {\r
descriptors.addElement(\r
- new MarkersPropertyDescriptor(P_ID_MARKERS, P_MARKERS, taxonBase)); \r
+ new MarkersPropertyDescriptor(P_ID_TAXON_MARKERS, P_TAXON_MARKERS, taxonBase)); \r
}\r
\r
if (id.equals(P_ID_EXTENSIONS)) {\r
}\r
}\r
\r
- if (id.equals(P_ID_MARKERS)) {\r
+ if (id.equals(P_ID_TAXON_MARKERS)) {\r
return new MarkerPropertySource(taxonBase);\r
}\r
\r
import eu.etaxonomy.taxeditor.model.Resources;\r
import eu.etaxonomy.taxeditor.model.TimeHelper;\r
import eu.etaxonomy.taxeditor.propertysheet.ICdmBasePropertySource;\r
+import eu.etaxonomy.taxeditor.propertysheet.MarkerPropertySource;\r
+import eu.etaxonomy.taxeditor.propertysheet.MarkersPropertyDescriptor;\r
import eu.etaxonomy.taxeditor.propertysheet.TimePeriodPropertySource;\r
import eu.etaxonomy.taxeditor.propertysheet.YearValidator;\r
\r
public static final String P_ID_PROTECT_CACHE = "P_ID_PROTECT_CACHE";\r
public static final String P_ID_ABSTRACT = "P_ID_ABSTRACT";\r
public static final String P_ID_INREFERENCE = "P_ID_INREFERENCE";\r
+ public static final String P_ID_REFERENCE_MARKERS = "P_ID_REFERENCE_MARKERS";\r
\r
// Property display keys\r
public static final String P_SEARCH = "Search";\r
public static final String P_NOTE = "Note";\r
public static final String P_ABSTRACT = "Abstract";\r
public static final String P_INREFERENCE = "In Reference";\r
+ public static final String P_REFERENCE_MARKERS = "Markers";\r
\r
protected static HashMap<Class<?>, String> referenceTypeMap = null;\r
\r
} else {\r
reference = HibernateProxyHelper.deproxy(reference, ReferenceBase.class);\r
}\r
-// this.reference = CdmBase.deproxy(object, clazz)reference;\r
this.reference = reference;\r
\r
initDescriptors();\r
}\r
\r
displayFields.add(P_ID_ABSTRACT);\r
+ displayFields.add(P_ID_REFERENCE_MARKERS);\r
\r
// There was a problem with duplicate descriptors in the above code\r
List<String> displayFieldsTemp = new ArrayList<String>();\r
new PropertyDescriptor(P_ID_ABSTRACT, P_ABSTRACT) :\r
new TextPropertyDescriptor(P_ID_ABSTRACT, P_ABSTRACT)); \r
}\r
+ \r
+ // Markers\r
+ if (id.equals(P_ID_REFERENCE_MARKERS)) {\r
+ descriptors.addElement(\r
+ new MarkersPropertyDescriptor(P_ID_REFERENCE_MARKERS, P_REFERENCE_MARKERS, reference));\r
+ }\r
}\r
\r
/**\r
* @return\r
*/\r
private boolean isMultiPageTaxonEditorActive() {\r
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();\r
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();\r
+ if (window == null) {\r
+ return false;\r
+ }\r
+ IEditorPart editor = window.getActivePage().getActiveEditor();\r
return (editor instanceof MultiPageTaxonEditor);\r
}\r
\r
Institution school = ((Thesis) reference).getSchool();\r
return school == null ? "" : CdmUtils.Nz(school.getName()); \r
}\r
+ \r
+ if (id.equals(P_ID_REFERENCE_MARKERS)) {\r
+ return new MarkerPropertySource(reference);\r
+ }\r
\r
return "";\r
}\r
import org.eclipse.ui.PlatformUI;\r
import org.eclipse.ui.views.properties.PropertyDescriptor;\r
\r
-import eu.etaxonomy.cdm.model.reference.Book;\r
-import eu.etaxonomy.cdm.model.reference.Journal;\r
-import eu.etaxonomy.cdm.model.reference.PrintSeries;\r
-import eu.etaxonomy.cdm.model.reference.Proceedings;\r
import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
import eu.etaxonomy.cdm.model.reference.ReferenceType;\r
import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredReferenceSelectionDialog;\r
}\r
\r
/**\r
- * Hacky bullshit until reference types are fully enabled. Assumes the required type\r
- * is one of the in-reference types: Book, Journal, Series, Proceedings.\r
* \r
* @param reference\r
* @return\r
*/\r
protected boolean isRequiredType(ReferenceBase reference) {\r
- if (ReferenceType.Book.equals(requiredType) && !(reference instanceof Book)) {\r
- return false;\r
- }\r
- if (ReferenceType.Journal.equals(requiredType) && !(reference instanceof Journal)) {\r
- return false;\r
- }\r
- if (ReferenceType.PrintSeries.equals(requiredType) && !(reference instanceof PrintSeries)) {\r
- return false;\r
- }\r
- if (ReferenceType.Proceedings.equals(requiredType) && !(reference instanceof Proceedings)) {\r
- return false;\r
- }\r
- return true;\r
+ return reference.getType().equals(requiredType);\r
}\r
\r
abstract protected void saveReference(ReferenceBase<?> reference); \r