Coverage Report - pl.edu.agh.cast.dataview.Activator
 
Classes in this File Line Coverage Branch Coverage Complexity
Activator
0%
0/15
0%
0/4
0
 
 1  
 /*
 2  
  * This file is a part of CAST project.
 3  
  * (c) Copyright 2008, AGH University of Science & Technology
 4  
  * https://caribou.iisg.agh.edu.pl/trac/cast
 5  
  *
 6  
  * Licensed under the Eclipse Public License, Version 1.0 (the "License").
 7  
  * You may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  * http://www.eclipse.org/legal/epl-v10.html
 10  
  */
 11  
 /*
 12  
  * File: Activator.java
 13  
  * Created: 2007-00-00
 14  
  * Author: cast
 15  
  * $Id: Activator.java 3033 2009-07-22 13:02:09Z entrop $
 16  
  */
 17  
 
 18  
 package pl.edu.agh.cast.dataview;
 19  
 
 20  
 import org.apache.log4j.ConsoleAppender;
 21  
 import org.apache.log4j.Level;
 22  
 import org.apache.log4j.Logger;
 23  
 import org.apache.log4j.PatternLayout;
 24  
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 25  
 import org.osgi.framework.BundleContext;
 26  
 
 27  
 /**
 28  
  * The activator class controls the data view plug-in life cycle.
 29  
  *
 30  
  * @author AGH CAST Team
 31  
  */
 32  
 public class Activator extends AbstractUIPlugin {
 33  
 
 34  
         /**
 35  
          * Extension id for column types.
 36  
          */
 37  
         public static final String COLUMN_TYPE_EXTENSION_ID = "pl.edu.agh.cast.dataview.columnType"; //$NON-NLS-1$
 38  
 
 39  
         /**
 40  
          * Column type id.
 41  
          */
 42  
         public static final String COLUMN_TYPE_ID = "id"; //$NON-NLS-1$
 43  
 
 44  
         /**
 45  
          * Column type value comparator class.
 46  
          */
 47  
         public static final String COLUMN_TYPE_VALUE_COMPARATOR = "valueComparator"; //$NON-NLS-1$
 48  
 
 49  
         /**
 50  
          * Column type label provider class.
 51  
          */
 52  
         public static final String COLUMN_TYPE_LABEL_PROVIDER = "labelProvider"; //$NON-NLS-1$
 53  
 
 54  
         /**
 55  
          * Column type filter class.
 56  
          */
 57  
         public static final String COLUMN_FILTER_CLASS = "filterClass"; //$NON-NLS-1$
 58  
 
 59  
         /**
 60  
          * Column type filter name.
 61  
          */
 62  
         public static final String COLUMN_FILTER_NAME = "name"; //$NON-NLS-1$
 63  
 
 64  
         /**
 65  
          * Column type filter description.
 66  
          */
 67  
         public static final String COLUMN_FILTER_DESCRIPTION = "description"; //$NON-NLS-1$
 68  
 
 69  
         /**
 70  
          * Extension id for data view providers.
 71  
          */
 72  
         public static final String DATAVIEW_VIEW_EXTENSION_ID = "pl.edu.agh.cast.dataview.viewProvider"; //$NON-NLS-1$
 73  
 
 74  
         /**
 75  
          * Data view content provider class.
 76  
          */
 77  
         public static final String DATA_VIEW_CONTENT_PROVIDER = "contentProvider"; //$NON-NLS-1$
 78  
 
 79  
         /**
 80  
          * Data view supported model extension id.
 81  
          */
 82  
         public static final String DATA_VIEW_SUPPORTED_MODEL = "supportedModelId"; //$NON-NLS-1$
 83  
 
 84  
         /**
 85  
          * Data view column type id. Expected the same values as defined in {@link Activator#COLUMN_TYPE_ID}.
 86  
          */
 87  
         public static final String DATA_VIEW_COLUMN_TYPE_ID = "columnTypeId"; //$NON-NLS-1$
 88  
 
 89  
         /**
 90  
          * Data view column caption.
 91  
          */
 92  
         public static final String DATA_VIEW_COLUMN_CAPTION = "caption"; //$NON-NLS-1$
 93  
 
 94  
         /**
 95  
          * Data view column value provider class.
 96  
          */
 97  
         public static final String DATA_VIEW_COLUMN_VALUE_PROVIDER = "valueProvider"; //$NON-NLS-1$
 98  
 
 99  
         /**
 100  
          * The shared instance of the data view plug-in.
 101  
          */
 102  
         private static Activator plugin;
 103  
 
 104  
         /**
 105  
          * The shared logger for the data view plug-in.
 106  
          */
 107  0
         private static final Logger LOG = Logger.getLogger(Activator.class);
 108  
 
 109  
         /**
 110  
          * The default constructor.
 111  
          */
 112  0
         public Activator() {
 113  0
         }
 114  
 
 115  
         /**
 116  
          * {@inheritDoc}
 117  
          *
 118  
          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
 119  
          */
 120  
         @Override
 121  
         public void start(BundleContext context) throws Exception {
 122  0
                 super.start(context);
 123  0
                 plugin = this;
 124  0
         }
 125  
 
 126  
         /**
 127  
          * {@inheritDoc}
 128  
          *
 129  
          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
 130  
          */
 131  
         @Override
 132  
         public void stop(BundleContext context) throws Exception {
 133  0
                 plugin = null;
 134  0
                 super.stop(context);
 135  0
         }
 136  
 
 137  
         /**
 138  
          * Returns the shared instance of the data view plug-in.
 139  
          *
 140  
          * @return the shared instance
 141  
          */
 142  
         public static Activator getDefault() {
 143  0
                 return plugin;
 144  
         }
 145  
 
 146  
         /**
 147  
          * Returns the shared logger of the data view plug-in.
 148  
          *
 149  
          * @return the shared logger
 150  
          */
 151  
         public static Logger getLogger() {
 152  0
                 if (LOG != null) {
 153  0
                         if (!LOG.getAllAppenders().hasMoreElements()) {
 154  
                                 // add default console appender
 155  0
                                 LOG.addAppender(new ConsoleAppender(new PatternLayout("%c: %5p [%t] (%F:%L) - %m%n "))); //$NON-NLS-1$
 156  0
                                 LOG.setLevel(Level.INFO);
 157  
                         }
 158  
                 }
 159  0
                 return LOG;
 160  
         }
 161  
 
 162  
 }