sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/AbstractPiPlugin.java
changeset 2 b9ab3b238396
equal deleted inserted replaced
1:1050670c6980 2:b9ab3b238396
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.carbide.cpp.internal.pi.plugin.model;
       
    19 
       
    20 import org.eclipse.ui.plugin.AbstractUIPlugin;
       
    21 
       
    22 //Every user plug-in has to extend this class
       
    23 
       
    24 public abstract class AbstractPiPlugin extends AbstractUIPlugin
       
    25 {
       
    26 	protected String pluginName;
       
    27 	protected int pluginSystemId;
       
    28 	
       
    29 	private boolean initialised = false;
       
    30 	private boolean pluginSystemIdSet = false;
       
    31 	
       
    32 	public AbstractPiPlugin()
       
    33 	{}
       
    34 
       
    35 	public String getPluginName() 
       
    36 	{
       
    37 		return pluginName;
       
    38 	}
       
    39 
       
    40 	public boolean isInitialised() 
       
    41 	{
       
    42 		return initialised;
       
    43 	}
       
    44 	
       
    45 	public int getPluginSystemId()
       
    46 	{
       
    47 		if (pluginSystemIdSet)
       
    48 			return pluginSystemId;
       
    49 		else
       
    50 			return -1;
       
    51 	}
       
    52 	
       
    53 	//	plugin system id can be set only once for each plugin instances
       
    54 	public void setPluginSystemId(int id)
       
    55 	{
       
    56 		if (pluginSystemIdSet)
       
    57 			return;
       
    58 		this.pluginSystemId = id;
       
    59 		pluginSystemIdSet = true;
       
    60 	}
       
    61 	
       
    62 	public void initialise(String name)
       
    63 	{
       
    64 		this.pluginName = name;
       
    65 		this.initialised = true;
       
    66 	}
       
    67 }