org.eclipse.net4j.util.eclipse
Class AbstractPlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.net4j.util.eclipse.AbstractPlugin
All Implemented Interfaces:
ClassLoaderFactory, org.osgi.framework.BundleActivator
Direct Known Subclasses:
AbstractSpringPlugin, ExamplePlugin, Net4jCorePlugin, Net4jEmbeddedPlugin, Net4jUtilPlugin

public abstract class AbstractPlugin
extends org.eclipse.core.runtime.Plugin
implements ClassLoaderFactory

The main plugin class to be used in the desktop.


Field Summary
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
protected AbstractPlugin()
          The constructor.
 
Method Summary
static void cancelOperation()
           
static void checkCanceled(org.eclipse.core.runtime.IProgressMonitor monitor)
          Progress monitor helpers
 void debug(java.lang.String message)
           
protected  void doStart()
           
protected  void doStop()
           
 void error(java.lang.String message)
           
 void error(java.lang.String message, java.lang.Throwable t)
           
 void error(java.lang.Throwable t)
           
 org.osgi.framework.BundleContext getBundleContext()
           
 java.lang.String getBundleLocation()
           
static java.lang.String getBundleLocation(org.osgi.framework.Bundle bundle)
           
 java.lang.ClassLoader getClassLoader()
           
 org.apache.log4j.Logger getLogger()
           
 java.lang.String getPluginId()
           
 java.util.ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
 java.lang.String getResourceString(java.lang.String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
static org.eclipse.core.runtime.IProgressMonitor monitorFor(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void start(org.osgi.framework.BundleContext context)
          This method is called upon plug-in activation
 void stop(org.osgi.framework.BundleContext context)
          This method is called upon plug-in deactivation
static org.eclipse.core.runtime.IProgressMonitor subMonitorFor(org.eclipse.core.runtime.IProgressMonitor monitor, int ticks)
           
static org.eclipse.core.runtime.IProgressMonitor subMonitorFor(org.eclipse.core.runtime.IProgressMonitor monitor, int ticks, int style)
           
 void warn(java.lang.String message)
           
 void warn(java.lang.String message, java.lang.Throwable t)
           
 void warn(java.lang.Throwable t)
           
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPlugin

protected AbstractPlugin()
The constructor.

Method Detail

getPluginId

public java.lang.String getPluginId()

getClassLoader

public java.lang.ClassLoader getClassLoader()
Specified by:
getClassLoader in interface ClassLoaderFactory

getLogger

public org.apache.log4j.Logger getLogger()

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
This method is called upon plug-in activation

Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.core.runtime.Plugin
Throws:
java.lang.Exception

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
This method is called upon plug-in deactivation

Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class org.eclipse.core.runtime.Plugin
Throws:
java.lang.Exception

doStart

protected void doStart()
                throws java.lang.Exception
Throws:
java.lang.Exception

doStop

protected void doStop()
               throws java.lang.Exception
Throws:
java.lang.Exception

getResourceString

public java.lang.String getResourceString(java.lang.String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.


getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Returns the plugin's resource bundle,


getBundleContext

public org.osgi.framework.BundleContext getBundleContext()
Returns:
Returns the bundleContext.

getBundleLocation

public java.lang.String getBundleLocation()
                                   throws java.io.IOException
Throws:
java.io.IOException

checkCanceled

public static void checkCanceled(org.eclipse.core.runtime.IProgressMonitor monitor)
Progress monitor helpers


cancelOperation

public static void cancelOperation()

monitorFor

public static org.eclipse.core.runtime.IProgressMonitor monitorFor(org.eclipse.core.runtime.IProgressMonitor monitor)

subMonitorFor

public static org.eclipse.core.runtime.IProgressMonitor subMonitorFor(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                                      int ticks)

subMonitorFor

public static org.eclipse.core.runtime.IProgressMonitor subMonitorFor(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                                      int ticks,
                                                                      int style)

getBundleLocation

public static java.lang.String getBundleLocation(org.osgi.framework.Bundle bundle)
                                          throws java.io.IOException
Throws:
java.io.IOException

debug

public void debug(java.lang.String message)

warn

public void warn(java.lang.String message)

error

public void error(java.lang.String message)

warn

public void warn(java.lang.Throwable t)

error

public void error(java.lang.Throwable t)

warn

public void warn(java.lang.String message,
                 java.lang.Throwable t)

error

public void error(java.lang.String message,
                  java.lang.Throwable t)

Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
All Rights Reserved.