Skip to main content
summaryrefslogblamecommitdiffstats
blob: 4d481375245251186d9e26a1f55e1afd78560bf4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10





                                                                                
  


                                                                                 
                                    
 

                                                        


                                                        
                                               

                                                                               

                                                                   
                                                                









                                                                       

                                                                                               
                                                                                                                  







                                                                                                                     
                                                          
                                
                     

    

                                                                                       
                                                               








                                                                                                        
 
/*******************************************************************************
 * Copyright (c) 2010 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ats.column;

import java.util.logging.Level;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.osee.ats.core.task.TaskArtifact;
import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
import org.eclipse.osee.ats.core.type.AtsAttributeTypes;
import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsAttributeValueColumn;
import org.eclipse.osee.ats.world.WorldXViewerFactory;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.swt.SWT;

public class LegacyPcrIdColumn extends XViewerAtsAttributeValueColumn {

   public static LegacyPcrIdColumn instance = new LegacyPcrIdColumn();

   public static LegacyPcrIdColumn getInstance() {
      return instance;
   }

   private LegacyPcrIdColumn() {
      super(AtsAttributeTypes.LegacyPcrId, WorldXViewerFactory.COLUMN_NAMESPACE + ".legacyPcr",
         AtsAttributeTypes.LegacyPcrId.getUnqualifiedName(), 40, SWT.LEFT, false, SortDataType.String, false, "");
   }

   /**
    * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
    * XViewerValueColumn MUST extend this constructor so the correct sub-class is created
    */
   @Override
   public LegacyPcrIdColumn copy() {
      LegacyPcrIdColumn newXCol = new LegacyPcrIdColumn();
      super.copy(this, newXCol);
      return newXCol;
   }

   @Override
   public String getColumnText(Object element, XViewerColumn column, int columnIndex) {
      if (Artifacts.isOfType(element, AtsArtifactTypes.Task)) {
         try {
            return getColumnText(((TaskArtifact) element).getParentTeamWorkflow(), column, columnIndex);
         } catch (OseeCoreException ex) {
            OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
         }
      }
      return super.getColumnText(element, column, columnIndex);
   }

}

Back to the top