merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 11 Aug 2014 12:28:34 +0000 (12:28 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 11 Aug 2014 12:28:34 +0000 (12:28 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientNameService.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CRUDOperationChooser.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityRow.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityTableHeader.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/MemberDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java

index 0d952767afbcee9295a446f43c814d204f316f15..b82a717a45b728aee16a7a65a07264b68cb1d4fa 100644 (file)
@@ -134,7 +134,7 @@ public class CdmAuthorityEditor extends EditorPart implements IConversationEnabl
        public void changed(Object element) {
                //FIXME : should be optimised to split changes into adding / removing authorities 
                //        vs updating authorites
-               dirty=true;
+               dirty = viewer.isDirty();
                firePropertyChange(PROP_DIRTY);
                // if the change has happened on the group then refresh the table
                if(element instanceof Group) {
index b1c12d16b8919a8071896a902794bfd3dd1ea12b..759e214c5996764f59be66692e77bac0c4142e6d 100644 (file)
@@ -41,11 +41,9 @@ import eu.etaxonomy.cdm.model.common.LSID;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.Marker;
 import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
 import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
 import eu.etaxonomy.cdm.model.common.RelationshipBase;
 import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
-import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
 import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
@@ -54,7 +52,6 @@ import eu.etaxonomy.cdm.model.name.HybridRelationshipType;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
 import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
-import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
@@ -854,17 +851,6 @@ public class TransientNameService implements INameService {
         return defaultNameService.getAllRelationships(limit, start);
     }
 
-    /**
-     * @return
-     * @deprecated
-     * @see eu.etaxonomy.cdm.api.service.INameService#getRankVocabulary()
-     */
-    @Deprecated
-    @Override
-    public OrderedTermVocabulary<Rank> getRankVocabulary() {
-        return defaultNameService.getRankVocabulary();
-    }
-
     /**
      * @param transientObjects
      * @return
@@ -875,17 +861,6 @@ public class TransientNameService implements INameService {
         return null;
     }
 
-    /**
-     * @return
-     * @deprecated
-     * @see eu.etaxonomy.cdm.api.service.INameService#getStatusTypeVocabulary()
-     */
-    @Deprecated
-    @Override
-    public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary() {
-        return defaultNameService.getStatusTypeVocabulary();
-    }
-
     /**
      * @param transientObject
      * @return
@@ -896,17 +871,6 @@ public class TransientNameService implements INameService {
         return defaultNameService.update(transientObject);
     }
 
-    /**
-     * @return
-     * @deprecated
-     * @see eu.etaxonomy.cdm.api.service.INameService#getSpecimenTypeDesignationStatusVocabulary()
-     */
-    @Deprecated
-    @Override
-    public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary() {
-        return defaultNameService.getSpecimenTypeDesignationStatusVocabulary();
-    }
-
     /**
      * @param example
      * @param includeProperties
@@ -922,28 +886,6 @@ public class TransientNameService implements INameService {
         return defaultNameService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
     }
 
-    /**
-     * @return
-     * @deprecated
-     * @see eu.etaxonomy.cdm.api.service.INameService#getSpecimenTypeDesignationVocabulary()
-     */
-    @Deprecated
-    @Override
-    public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary() {
-        return defaultNameService.getSpecimenTypeDesignationVocabulary();
-    }
-
-    /**
-     * @return
-     * @deprecated
-     * @see eu.etaxonomy.cdm.api.service.INameService#getNameRelationshipTypeVocabulary()
-     */
-    @Deprecated
-    @Override
-    public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary() {
-        return defaultNameService.getNameRelationshipTypeVocabulary();
-    }
-
     /**
      * @param clazz
      * @param matchStrategy
index 3bc4a276c0259564ee8b9a9f40e6f70fb86924ea..24157b3bc3b1542e34a4ed820a9bf57d56d8b2c2 100644 (file)
@@ -83,21 +83,21 @@ public class TaxonNavigator extends CommonNavigator implements
                TaxonComparatorSearch comparator = new TaxonComparatorSearch();
                TaxonNodeComparator viewerComparator = new TaxonNodeComparator(comparator);
                this.getCommonViewer().setComparator(viewerComparator);
-               this.getCommonViewer().addSelectionChangedListener(new ISelectionChangedListener() {
-                       
-                       @Override
-                       public void selectionChanged(SelectionChangedEvent arg0) {
-                               IStructuredSelection selection = (IStructuredSelection) getCommonViewer().getSelection();
-                               
-                               Object firstElement =  selection.getFirstElement();
-                               //
-                               if (!(firstElement instanceof Classification)){
-                                       //NavigationUtil.selectInNavigator(firstElement, null);
-                                       NavigationUtil.openEditor(firstElement);
-                               }
-                               
-                       }
-               } );
+//             this.getCommonViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+//                     
+//                     @Override
+//                     public void selectionChanged(SelectionChangedEvent arg0) {
+//                             IStructuredSelection selection = (IStructuredSelection) getCommonViewer().getSelection();
+//                             
+//                             Object firstElement =  selection.getFirstElement();
+//                             //
+//                             if (!(firstElement instanceof Classification)){
+//                                     //NavigationUtil.selectInNavigator(firstElement, null);
+//                                     NavigationUtil.openEditor(firstElement);
+//                             }
+//                             
+//                     }
+//             } );
                
                if (CdmStore.isActive()) {
                        
index e1cab9bef2730c53de590bf817d493323a527df6..e3e07a2ea8b9a5fbb05520f91ed5c7c06bbdab3b 100644 (file)
@@ -78,6 +78,7 @@ public class CRUDOperationChooser extends Composite {
                createCheckButton.setText("C");
                
                readCheckButton = new Button(this, SWT.CHECK);
+               readCheckButton.setEnabled(false);
                readCheckButton.addMouseTrackListener(new MouseTrackAdapter() {
                        @Override
                        public void mouseHover(MouseEvent arg0) {
@@ -174,7 +175,7 @@ public class CRUDOperationChooser extends Composite {
         */
        private void updateView() {
                createCheckButton.setSelection(false);
-               readCheckButton.setSelection(false);
+               readCheckButton.setSelection(true);
                deleteCheckButton.setSelection(false);
                updateCheckButton.setSelection(false);
                
index 08a0faeaabd2a16962599a04abea6d80a5f0202a..850c8b4f44f603fd0d3b49ad93b8f63ce3b3a047 100644 (file)
@@ -11,6 +11,7 @@ package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
 import org.eclipse.nebula.widgets.compositetable.CompositeTable;
 import org.eclipse.nebula.widgets.compositetable.IRowContentProvider;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTarget;
 import org.eclipse.swt.dnd.Transfer;
@@ -26,6 +27,9 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
 
 import eu.etaxonomy.taxeditor.dnd.CdmAuthorityTableDropTargetListener;
 import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
 
 /**
  * Composite class which consists of a {@link CompositeTable} built specifically
@@ -42,11 +46,11 @@ public class CdmAuthorityComposite extends Composite {
        private CompositeTable table;
        
        private int numOfInitialCdmAuthorities;
-
-       private Label lblDragEntityInto;
        
        private CdmAuthorityCompositeViewer viewer;
        
+       private CdmAuthorityTableHeader cdmAuthorityTableHeader;
+       
 
        /**
         * Creates the composite using the given parent, style and associated viewer.
@@ -56,7 +60,7 @@ public class CdmAuthorityComposite extends Composite {
         * @param viewer viewer representing the model
         */
        public CdmAuthorityComposite(Composite parent, int style, final CdmAuthorityCompositeViewer viewer) {
-               super(parent, style);
+               super(parent, SWT.NONE);
                addDisposeListener(new DisposeListener() {
                        public void widgetDisposed(DisposeEvent e) {
                                toolkit.dispose();
@@ -66,21 +70,31 @@ public class CdmAuthorityComposite extends Composite {
                this.viewer = viewer;
                                
                numOfInitialCdmAuthorities = viewer.getCdmAuthorities().size();
-               setLayout(new GridLayout(1, false));
+               setLayout(new GridLayout(2, false));
+               setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
            Transfer[] transfers = new Transfer[] { TaxonNodeTransfer.getInstance() };     
            
            toolkit.adapt(this);
-               toolkit.paintBordersFor(this);          
-
-               lblDragEntityInto = new Label(this, SWT.NONE);
-               toolkit.adapt(lblDragEntityInto, true, true);
-               lblDragEntityInto.setText("Drag Entity into table to add ...");
-               table = new CompositeTable(this, SWT.BORDER);
-               GridData gd_table = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
-               gd_table.widthHint = 750;
+               toolkit.paintBordersFor(this);
+               new Label(this, SWT.NONE);
+               
+               final Button cbShowUUIDheader = new Button(this, SWT.CHECK);
+               cbShowUUIDheader.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               boolean showUUIDHeader = ((Button)e.getSource()).getSelection();
+                               ((CdmAuthorityTableHeader)table.getHeader()).setUuidHeaderVisible(showUUIDHeader);
+                               refresh();
+                       }
+               });
+               toolkit.adapt(cbShowUUIDheader, true, true);
+               cbShowUUIDheader.setText("show uuid");
+               table = new CompositeTable(this, SWT.NONE);
+               GridData gd_table = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
+               gd_table.widthHint = 650;
                gd_table.heightHint = 400;
                table.setLayoutData(gd_table);
-               new CdmAuthorityTableHeader(table, SWT.NULL); 
+               cdmAuthorityTableHeader = new CdmAuthorityTableHeader(table, SWT.NULL);
                CdmAuthorityRow cdmAuthorityRow = new CdmAuthorityRow(table, SWT.NULL);
                
                table.setRunTime(true);
@@ -100,11 +114,13 @@ public class CdmAuthorityComposite extends Composite {
                                if(currentObjectOffset < viewer.getNewCdmAuthorities().size()) {                        
                                        row.setRowCdmAuthority(viewer, 
                                                        viewer.getNewCdmAuthorities().get(currentObjectOffset), 
-                                                       true);
+                                                       true,
+                                                       cbShowUUIDheader.getSelection());
                                } else {
                                        row.setRowCdmAuthority(viewer, 
                                                        viewer.getCdmAuthorities().get(currentObjectOffset - viewer.getNewCdmAuthorities().size()), 
-                                                       false);
+                                                       false,
+                                                       cbShowUUIDheader.getSelection());
                                }                                                                               
                        }
                });
index cb910b32c9960407c9c3ae5f7c7b6c3c5b05f61a..331b13f348022eeac727bdca9deeec0d7f39f7ea 100644 (file)
@@ -18,6 +18,8 @@ import java.util.Set;
 import org.eclipse.jface.viewers.ContentViewer;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.springframework.security.core.GrantedAuthority;
@@ -41,18 +43,13 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */
 
 
-/**
- * @author cmathew
- * @date Apr 5, 2013
- *
- */
-
 //FIXME:move warning dialogs to the table class
 public class CdmAuthorityCompositeViewer extends ContentViewer {
        
        private IDirtyMarkableSelectionProvider dirtyMarkerEditor;      
        private CdmAuthorityComposite cdmAuthorityComposite;
        private Group group;
+       private boolean isDirty = false;
        /**
         * List which contains already existing authority objects.
         */
@@ -79,7 +76,14 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
                this.group = group;
                newCdmAuthorities = new ArrayList<GrantedAuthorityImpl>();              
                updateAuthorities();
-               this.cdmAuthorityComposite = new CdmAuthorityComposite(composite, SWT.NONE, this);
+               
+               ScrolledComposite sc = new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
+               this.cdmAuthorityComposite = new CdmAuthorityComposite(sc, SWT.H_SCROLL | SWT.V_SCROLL, this);
+               sc.setContent(cdmAuthorityComposite);
+               sc.setExpandHorizontal(true);
+               sc.setExpandVertical(true);
+               sc.setMinWidth(650);
+               sc.setMinHeight(400);
        }
 
        /**
@@ -122,6 +126,9 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
                return cdmAuthorities;
        }
        
+       public boolean isDirty() {
+               return isDirty;
+       }
        /**
         * Adds a new {@link CdmAuthority} to the group attached to this viewer
         * based on the input {@link CdmBase} object.
@@ -134,6 +141,7 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
                defaultOperation.add(CRUD.READ);
                CdmAuthority cdma = new CdmAuthority(cb, defaultOperation, cb.getUuid());
                GrantedAuthorityImpl gai;
+               
                try {
                        // create a granted authrity from a cdm authority 
                        gai = cdma.asNewGrantedAuthority();
@@ -143,11 +151,12 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
                }
                //FIXME : this contains call will allow users to add authorities which differ only in CRUD operation choice.
                //        need to have a comparator which only checks permission class and uuid
-               if(cdmAuthorities.contains(gai)) {
+               if(cdmAuthorities.contains(gai) || newCdmAuthorities.contains(gai)) {
                        StoreUtil.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
                } else {                                                                
                        group.addGrantedAuthority(gai);
-                       newCdmAuthorities.add(gai);                             
+                       newCdmAuthorities.add(gai);
+                       isDirty = true;
                        dirtyMarkerEditor.changed(group);               
                        cdmAuthorityComposite.refresh();
                }
@@ -160,15 +169,19 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
         * @param gai {@link GrantedAuthorityImpl} object to remove
         */
        public void removeCdmAuthority(GrantedAuthorityImpl gai) {
-               if(cdmAuthorities.contains(gai)) {
-                       group.removeGrantedAuthority(gai);
+               
+               if(cdmAuthorities.contains(gai)) {                                      
+                       cdmAuthorities.remove(gai);             
+                       isDirty = true;
+               } else {                                                
                        newCdmAuthorities.remove(gai);
-                       cdmAuthorities.remove(gai);
-                       dirtyMarkerEditor.changed(group);       
-                       cdmAuthorityComposite.refresh();
-               } else {
-                       StoreUtil.warningDialog("Unknown CDM Authority", this, "Chosen CDM Authority does not exist in  current group");
+                       if(newCdmAuthorities.isEmpty() && !isDirty) {
+                               isDirty = false;
+                       }
                }
+               group.removeGrantedAuthority(gai);              
+               dirtyMarkerEditor.changed(group);               
+               cdmAuthorityComposite.refresh();
        }
        
        /**
@@ -189,6 +202,7 @@ public class CdmAuthorityCompositeViewer extends ContentViewer {
                                GrantedAuthorityImpl gai = cdmAuthority.asNewGrantedAuthority();
                                group.addGrantedAuthority(gai);
                                group.removeGrantedAuthority(grantedAuthorityI);
+                               isDirty = true;
                                dirtyMarkerEditor.changed(grantedAuthorityI);
                                return gai;
                        } catch(Exception e) {
index ecd134a573ae9766f8f5221dc9574f81f1ab1098..716ebd067dac80e984fd78c10d9d37b16f6971ca 100644 (file)
@@ -38,7 +38,7 @@ public class CdmAuthorityRow extends Composite {
 
        private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
        private Label lblEntity;
-       private Label lblTarget;
+       private Label lblUuid;
        private CRUDOperationChooser operationChooser;
        private Button btnDelete;
        
@@ -46,6 +46,7 @@ public class CdmAuthorityRow extends Composite {
        private Label lblDirtyFlag;
        
        private CdmAuthorityCompositeViewer cdmaModel;
+       private Label lblType;
        
        /**
         * Create the composite, made up of 5 elements :
@@ -67,7 +68,7 @@ public class CdmAuthorityRow extends Composite {
                });
                toolkit.adapt(this);
                toolkit.paintBordersFor(this);
-               setLayout(new GridLayout(5, false));
+               setLayout(new GridLayout(6, false));
                
 
                
@@ -79,7 +80,16 @@ public class CdmAuthorityRow extends Composite {
                toolkit.adapt(lblDirtyFlag, true, true);
                lblDirtyFlag.setText("*");
                
-               lblEntity = new Label(this, SWT.BORDER);
+               lblType = new Label(this, SWT.BORDER);
+               GridData gd_lblType = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblType.heightHint = 30;
+               gd_lblType.widthHint = 200;
+               lblType.setLayoutData(gd_lblType);
+               lblType.setText("Type");
+               lblType.setAlignment(SWT.CENTER);
+               toolkit.adapt(lblType, true, true);
+               
+               lblEntity = new Label(this, SWT.BORDER | SWT.WRAP | SWT.CENTER);
                GridData gd_lblEntity = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
                gd_lblEntity.heightHint = 30;
                gd_lblEntity.widthHint = 200;
@@ -88,14 +98,6 @@ public class CdmAuthorityRow extends Composite {
                toolkit.adapt(lblEntity, true, true);
                lblEntity.setText("Entity");
                
-               lblTarget = new Label(this, SWT.BORDER + SWT.WRAP);
-               GridData gd_lblTarget = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
-               gd_lblTarget.heightHint = 30;
-               gd_lblTarget.widthHint = 270;
-               lblTarget.setLayoutData(gd_lblTarget);
-               lblTarget.setAlignment(SWT.LEFT);
-               toolkit.adapt(lblTarget, true, true);
-               lblTarget.setText("Uuid");
                
                operationChooser = new CRUDOperationChooser(this, SWT.BORDER);
                operationChooser.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
@@ -139,7 +141,7 @@ public class CdmAuthorityRow extends Composite {
         * @param grantedAuthorityI
         * @param isDirty
         */
-       public void setRowCdmAuthority(CdmAuthorityCompositeViewer cdmaModel, GrantedAuthorityImpl grantedAuthorityI, boolean isDirty) {
+       public void setRowCdmAuthority(CdmAuthorityCompositeViewer cdmaModel, GrantedAuthorityImpl grantedAuthorityI, boolean isDirty, boolean showUuid) {
                this.grantedAuthorityI = grantedAuthorityI;             
                this.cdmaModel = cdmaModel;
                
@@ -149,10 +151,16 @@ public class CdmAuthorityRow extends Composite {
                        setDirty(isDirty);
 
                        String entityStr = (cdmAuthority.getPermissionClass() == null)?"":cdmAuthority.getPermissionClass().toString();
-                       lblEntity.setText(entityStr);
+                       lblType.setText(entityStr);
                        String targetLabelText = GrantedAuthorityLabelTextProvider.getTargetText(cdmAuthority);
-                       lblTarget.setText(targetLabelText);
-
+                       lblEntity.setText(targetLabelText);
+                                               
+                       setUuidCellVisible(showUuid);
+                       if(lblUuid != null) {
+                               String targetUuid = cdmAuthority.getTargetUUID().toString();
+                               lblUuid.setText(targetUuid);
+                       }
+                       
                        operationChooser.setAuthority(cdmaModel, grantedAuthorityI, cdmAuthority);                              
                        
                } catch (Exception e) {
@@ -161,5 +169,31 @@ public class CdmAuthorityRow extends Composite {
                }
 
        }
+       
+       public void setUuidCellVisible(boolean visible) {
+               if(visible) {
+                       if(lblUuid == null) {
+                               createUuidCell();
+                       }
+                       lblUuid.moveAbove(operationChooser);
+                       
+               } else {
+                       if(lblUuid != null) {
+                               lblUuid.dispose();
+                       }
+                       lblUuid = null;
+               }
+               layout();
+       }
+       
+       private void createUuidCell() {
+               lblUuid = new Label(this, SWT.BORDER | SWT.CENTER);
+               GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblUuid.heightHint = 30;
+               gd_lblUuid.widthHint = 270;
+               lblUuid.setLayoutData(gd_lblUuid);
+               toolkit.adapt(lblUuid, true, true);
+               lblUuid.setText("Uuid");
+       }
 
 }
index ee844900a0bd91fa556c4a414674a5d0b9c20a9f..17d11526c35860c3a5f2f3837034e4bc7a90e274 100644 (file)
@@ -1,11 +1,11 @@
 /**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy 
+ * http://www.e-taxonomy.eu
+ 
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
 package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
 
 import org.eclipse.swt.SWT;
@@ -15,9 +15,11 @@ import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.wb.swt.SWTResourceManager;
 
 /**
  * Table header widget for {@link CdmAuthorityComposite}
@@ -29,7 +31,8 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
 public class CdmAuthorityTableHeader extends Composite {
 
        private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
-
+       private CLabel lblUuid;
+       private CLabel lblOperation;
        /**
         * Create the composite, with 5 header fields.
         * 
@@ -45,15 +48,25 @@ public class CdmAuthorityTableHeader extends Composite {
                });
                toolkit.adapt(this);
                toolkit.paintBordersFor(this);
-               setLayout(new GridLayout(4, false));
-               
+               setLayout(new GridLayout(5, false));
+
                Label lblDirtyFlag = new Label(this, SWT.NONE);
                GridData gd_lblDirtyFlag = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
                gd_lblDirtyFlag.widthHint = 15;
                lblDirtyFlag.setLayoutData(gd_lblDirtyFlag);
-               
+
                toolkit.adapt(lblDirtyFlag, true, true);
                
+               CLabel lblType = new CLabel(this, SWT.NONE);
+               GridData gd_lblType = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+               gd_lblType.widthHint = 200;
+               lblType.setLayoutData(gd_lblType);
+               lblType.setText("TYPE");
+               lblType.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE));
+               lblType.setAlignment(SWT.CENTER);
+               toolkit.adapt(lblType);
+               toolkit.paintBordersFor(lblType);
+
                CLabel lblEntity = new CLabel(this, SWT.NONE);
                lblEntity.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
                lblEntity.setAlignment(SWT.CENTER);
@@ -63,18 +76,10 @@ public class CdmAuthorityTableHeader extends Composite {
                toolkit.adapt(lblEntity);
                toolkit.paintBordersFor(lblEntity);
                lblEntity.setText("ENTITY");
+
+               //createUUIDHeader();
                
-               CLabel lblUuid = new CLabel(this, SWT.NONE);
-               lblUuid.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
-               lblUuid.setAlignment(SWT.CENTER);
-               GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
-               gd_lblUuid.widthHint = 270;
-               lblUuid.setLayoutData(gd_lblUuid);
-               toolkit.adapt(lblUuid);
-               toolkit.paintBordersFor(lblUuid);
-               lblUuid.setText("UUID");
-               
-               CLabel lblOperation = new CLabel(this, SWT.NONE);
+               lblOperation = new CLabel(this, SWT.NONE);
                lblOperation.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
                lblOperation.setAlignment(SWT.CENTER);
                GridData gd_lblOperation = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
@@ -86,4 +91,32 @@ public class CdmAuthorityTableHeader extends Composite {
 
        }
 
+
+       public void setUuidHeaderVisible(boolean visible) {
+               if(visible) {
+                       if(lblUuid == null) {
+                               createUUIDHeader();
+                       }
+                       lblUuid.moveAbove(lblOperation);                        
+               } else {
+                       if(lblUuid != null) {
+                               lblUuid.dispose();
+                       }
+                       lblUuid = null;
+               }
+               layout();
+       }
+       
+       private void createUUIDHeader() {
+               lblUuid = new CLabel(this, SWT.NONE);
+               lblUuid.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE));
+               lblUuid.setAlignment(SWT.CENTER);
+               GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+               gd_lblUuid.widthHint = 270;
+               lblUuid.setLayoutData(gd_lblUuid);
+               toolkit.adapt(lblUuid);
+               toolkit.paintBordersFor(lblUuid);
+               lblUuid.setText("UUID");
+       }
+
 }
index 1a828cb19fb054e659840644306709ea9ec9ce7f..a4f0364ba89c74545a4a69c18a597b1ba1561177 100644 (file)
@@ -64,7 +64,7 @@ public class MemberDetailElement extends AbstractEntityCollectionElement<User> {
        public void createControls(ICdmFormElement element, int style) {
                selection_user = formFactory
                                .createSelectionElement(User.class,
-                                               getConversationHolder(), element, "Member", entity,
+                                               getConversationHolder(), element, "", entity,
                                                EntitySelectionElement.EDITABLE, style);
        }
 
index cfd70066a4ffa5c39c7627534276a3ebd5580523..6fc520ea963882ae3f10b200e5e4e4a14a77b411 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import java.util.Arrays;
 
-import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.taxeditor.model.AuthorHelper;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -117,25 +116,22 @@ public class AuthorshipDetailElement extends
                if (eventSource == toggleable_cache) {
                        getEntity().setAuthorshipCache(toggleable_cache.getText(),
                                        toggleable_cache.getState());
-                       if (!isIrrelevant())
+                       if (!isIrrelevant()){
                                setIrrelevant(toggleable_cache.getState(),
                                                Arrays.asList(new Object[] { toggleable_cache }));
+                       }
                } else if (eventSource == selection_combinationAuthorTeam) {
                        getEntity().setCombinationAuthorTeam(
-                                       (INomenclaturalAuthor) selection_combinationAuthorTeam
-                                                       .getSelection());
+                                       selection_combinationAuthorTeam.getSelection());
                } else if (eventSource == selection_exCombinationAuthorTeam) {
                        getEntity().setExCombinationAuthorTeam(
-                                       (INomenclaturalAuthor) selection_exCombinationAuthorTeam
-                                                       .getSelection());
+                                       selection_exCombinationAuthorTeam.getSelection());
                } else if (eventSource == selection_basionymAuthorTeam) {
                        getEntity().setBasionymAuthorTeam(
-                                       (INomenclaturalAuthor) selection_basionymAuthorTeam
-                                                       .getSelection());
+                                       selection_basionymAuthorTeam.getSelection());
                } else if (eventSource == selection_exBasionymAuthorTeam) {
                        getEntity().setExBasionymAuthorTeam(
-                                       (INomenclaturalAuthor) selection_exBasionymAuthorTeam
-                                                       .getSelection());
+                                       selection_exBasionymAuthorTeam.getSelection());
                }
 
 //             if (eventSource != toggleable_cache) {
index b6e5ca65e58550e6c63749de99ae445445121b21..35258c03aed6f6da3c33e87ce350d2ece1dc5d91 100644 (file)
@@ -137,7 +137,7 @@ public class EntitySelectionElement<T extends ICdmBase> extends
                this.isDeletable = (mode & DELETABLE) == DELETABLE;
                boolean isSelectable = (mode & SELECTABLE) == SELECTABLE;
 
-               this.labelString = labelString;
+               this.labelString = (labelString == null || labelString.equals("")) ? "" : labelString + " : ";
 
                this.conversation = conversation;
 
@@ -158,8 +158,8 @@ public class EntitySelectionElement<T extends ICdmBase> extends
        }
 
        private void createControls(Composite parent, int style) {
-
-               label = formFactory.createLabel(getLayoutComposite(), labelString + " : ",
+               
+               label = formFactory.createLabel(getLayoutComposite(), labelString,
                                SWT.NULL);
 
                addControl(label);