Skip to main content

Posts

Showing posts from 2014

Factory Design Pattern - Java

Factory Design Pattern Factory Design Pattern works as per it's name. As one Factory can generate various types of items but of a specific category. Like, Car Factory ( Nissan Car Factory ) can create cars like, Micra, Sunny, Evalia but it can't create Duster. Because,Duster can be created by Renault Car Factory. So, with the same concept, A company can create a various types of Employees. Like, Developer, Admin , Developer Manager. But, only Developer can be Dev Manager. Here is the Complete example of creating the Company with all the Employee details. Class Company.java /** * Parent Class of all Class. Employee is Base class of all types of Employee. * * @author Hari * */ abstract class Employee { public abstract void getMyDetails(); } /** * Admin is child class of the Employee class. * * @author Hari */ class Admin extends Employee { public void getMyDetails() { System.out.println("I'm admin"); } } /** * Develo

GTK Error in Eclipse RCP

GTK Error in Eclipse RCP Many times while testing eclipse RCP application, you will see following error: ------------------------------------------------------------------------------------------------------------ (eclipse:2960): GLib-GObject-WARNING **: invalid (NULL) pointer instance (eclipse:2960): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE' (instance) failed (eclipse:2960): Gtk-CRITICAL **: IA__gtk_screen_get_display: assertion 'GDK_IS_SCREEN (screen)' failed (eclipse:2960): Gtk-WARNING **: Screen for GtkWindow not set; you must always set a screen for a GtkWindow before using the window (eclipse:2960): Gtk-WARNING **: Screen for GtkWindow not set; you must always set a screen for a GtkWindow before using the window (eclipse:2960): Gdk-CRITICAL **: IA__gdk_screen_get_display: assertion 'GDK_IS_SCREEN (screen)' failed (eclipse:2960): Gdk-CRITICAL **: IA__gdk_display_get_pointer: assertion 'GDK_IS_DI