Sunday, March 17, 2013

Eclipse Software Configuration Management (SCM) Plug-ins

 Each of SCM  Eclipse plugin. plugins has same basic feature, personally like jazz and perforce plugin for the eclipse.

IBM Jazz and Perforce support agile / collaborative development 

1) SVN :  Update site Location http://download.eclipse.org/technology/subversive/1.0/update-site-1.0.1/



2) CVS : Download Location: http://www.easyeclipse.org/site/plugins/eclipse-cvs.html


3) IBM Jazz : DownLoad Location:  https://jazz.net/ , http://www.easyeclipse.org/site/plugins/eclipse-cvs.html



4) PerForce (P4): Update site for the  Eclipse 3.7, 3.8 and 4.2 Perforce available under Eclipse Market place. p4action  is  Additional plug-in for the p4Force can be download .
   
PerForce  Plugin DownLoad: http://www.perforce.com/product/components/eclipse-plugin



Comparision of revision control software: 

http://en.wikipedia.org/wiki/Comparison_of_revision_control_softwarehttp://en.wikipedia.org/wiki/Comparison_of_revision_control_software


Saturday, March 3, 2012

Five basic concept for Eclipse RCP / IDE / Plug-in 



1) Eclipse IDE  and RCP application -
             The Eclipse Platform is a composition of  software components. 
              The Eclipse Platform contains the functionality required to build an IDE.  

The Eclipse IDE is a collection of specific software components as shown below.




- Eclipse RCP application  is set of independent plug-ins 
       (Standard RCP plug-ins +  Software vendor plug-ins == RCP Application)

- Developing RCP application is developing eclipse plug-ins.

- Eclipse RCP is based on component model.
     - plug-ins are basic building blocks of this model
           - plug-ins are based on OSGi 



- Advantages of Eclipse Rich client platform architecture:
    a) Maintainability
    b)  Extensible - seamless integration of tools
    c)  Re-usability
 
- Differnce between Extensible application Vs RCP application:
     
Example of Extensible is Google browser add-on


3) What is plug-in ?


 - Plug-ins are basic building block/ software component  of eclipse.
 - Each plug-in is an OSGI (Open Service Gateway Interface) bundle
-  An RCP application is set of plug-ins.
         Developing Eclipse RCP App. == Developing Plug-ins
-Plug-ins can provide provide / consume services of other plug-ins.


- Services by
    a)  defining Extension point
    b) contributing to existing extension point
    c) dependencies to other plugin


 - Each Plugin extend  "org.eclipse.core.runtime.Plugin" class,  which provide generic facility of activation / deactivation of plugin.
        - When a plugin is involved in interaction with GUI components, then it must extend         org.eclipse.ui.plugin.AbstractUIPlugin.





 - Plugin Contains declarative and programmatic part,  declarative part read during eclipse start-up  and cached in the plugin registry , which will be accessed by Plugin registry API.


  eg: 
       Plugin pInfo = Platform.getPlugin(pluginID);
              pInfo.isRunning();


-  Follow naming convention for plugin
     com.vendor_name.project_name.plugin-name



3) Eclipse Plug-in architecture -
  - MANIFEST.MF - contain OSGi configuration information, dependency
          http://java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
   - plugin.xml -  contain information about Extension and extension-point
              http://wiki.eclipse.org/FAQ_What_is_the_plug-in_manifest_file_(plugin.xml)%3F






  - Plugin can be created without plugin.xml
       example: wrapping third party Jar as a Plug-in.


4) Extension / Extension Point :
                                                           
        - Extension point is a logical socket available to other Plug-ins.
        - Each plug-in can define 0 or more Extension points
        - It enable other to contribute to your contribution
        - It reduces coupling and increase cohesion
        -  Promote modularity and re-usability
        -






5) Plug-in Life Cycle :-

-It is possible to track plug-in start-up and shutdown event using overriding start(BundleContext)  and 
stop (BundleContext) in  Activator class.
 - BundleContext inreference to underlying OSGi infrastructure.
- Plugin should be loaded only when required (Lazy loading) using Eclipse-Autostart ="true"
- Eclipse Runtime uses OSGi as a low level Framework for the Plugin
- Each plugin is an OSGi Bundle.


For each state detail. Please see 1) Plug-in Life Cycle state 2) OSGi





Reference Material:
http://www.programcreek.com/2011/09/eclipse-plug-in-architecture-extension-processing/
 http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html

Tuesday, February 28, 2012

Listening to part activation:  views and editor extends  viewPart and EditorPart

senario 1:  show  view1 and view 2 on selection of view3
senario 2:  hide the view1 and view 2 on selection of  view3
senario 3:  on selection of editor bring the view2

To listen any par, first need to implement "org.eclipse.ui.IPartListener" of  "org.eclipse.ui.IPartListener2"

step 1: Register the listener to workbench
         getSite().getWorkbenchWindow().getPartService().addPartListener(_partListenerList);

step 2: get the  page - As view and editor is inside the WorkbenchPage
        in view  -:  getViewSite().getPage();
        in Editor - : getEditorSite().getPage();
         using platformUI : -   
          PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()           


step3:  Once you have access to the page,  get the available views reference stored by workbench.
               
        // show all the views using reference
if (iViewReference.getId().equals("<view ID>")) {
try {
part.getSite().getWorkbenchWindow().getActivePage()
.showView( iViewReference.getId() );

} catch (PartInitException e) {
e.printStackTrace();
}
}



example: 



public class viewExample extends viewPart {


public static final String ID = "com.khalid.view.activation.onselection";


private IPartListener _partListenerList = new IPartListener() {


@Override
public void partOpened(IWorkbenchPart part) {
System.out.println("partOpened");
}


@Override
public void partDeactivated(IWorkbenchPart part) {
System.out.println("partDeactivated");
}


@Override
public void partClosed(IWorkbenchPart part) {
System.out.println("partClosed");
}


@Override
public void partBroughtToTop(IWorkbenchPart part) {
System.out.println("partBroughtToTop");
}


@Override
public void partActivated(final IWorkbenchPart part) {


if (part.getSite().getPage().getPerspective() == null) {
return;
}


if (!part.getSite().getPage().getPerspective().getId().equals(
"<Perspective ID>")) {
return;
}
// System.out.println(getViewSite().getPage().getActivePart().getSite().getId());


if (getViewSite().getPage().getActivePart().getSite().getId()
.equals("<view ID-1>")) {
Display.getCurrent().asyncExec(new Runnable() {


@Override
public void run() {
try {
part.getSite().getWorkbenchWindow().getActivePage()
.showView("<view ID-2>");
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}
});
}
}
};


public  viewExample() {

}


@Override
public void createControls(Composite theParent) {
theParent.setLayout(new FillLayout(SWT.HORIZONTAL));
// Create UI control
                  ......


                //Register the part listener
getSite().getWorkbenchWindow().getPartService().addPartListener(
_partListenerList);


}


/**
* Passing the focus request to the viewer's control.
*/
@Override
public void setFocus() {


}


@Override
public void dispose() {
super.dispose();
getSite().getWorkbenchWindow().getPartService().removePartListener(
_partListenerList);
}
}



@NOTE: i will adding the video for this in future.


Saturday, February 18, 2012

Customization of  splash screen of your RCP / IDE application :


In RCP / IDE application splash screen is created by extending "org.eclipse.ui.splashHandlers". this extension allow to contribute custom splash screen during start-up.



 3 type of existing template for splash screen available ( An Interactive Splash, A Browser Splash, An Extensible Splash )

i would prefer using product configuration file.once you select particular customize splash  template , it will extend the extension and create necessary code for the customize splash screen.

For more product customization please refere :
http://eclipse4rcp.blogspot.com/2010/12/product-customization-using.html