Friday, December 28, 2012

retriving user .folder on ubumtu

Ubuntu : I surprised after finding some data in my pen drive on ubuntu. I was copied folder prefixed of dot( "." [e.g] .m2) from my windows 7 laptop. But it was missing when plugged ubuntu. I was very confident with what I have been copied. So, I thought of finding it with google as ".folder in ubuntu".

I found a link,
http://www.cyberciti.biz/faq/explain-linux-unix-dot-files/

"A dot file is nothing but a configuration file usually stored in users home directory."

from the above line I got the nice information that ubuntu storing all the configuration data inside the .file and .folder

E.g to view the .folders

$ ls -a
$ ls -ld .*
$ ls -a | grep '^\.'


But here the point I don’t want to last my folder which is copied already.So I chooses to go with terminal (command prompt). He never pushed me down.

$cd .m2 

Using the above command I able to be inside the .m2 . So the problem solved, with coping the data from the current directory.

$ls 

output:
repository

The $ls command shown me the subdirectories of current path.

$cp -r repository ../

after using the copy command I got the subdirectory outside of the .m2 folder.

Note: I used the -r argument for the copy command because my subdirectory have some more subdirectory inside.

If you not interested with doing all this with terminal, switch with shortcut

On your window click,

ctrl+L (Goto Location)

and type the path of your hidden folder.









Tuesday, December 11, 2012

Linux Error & Hot Fix

If this is your Linux terminal error
-------------------------------------------------------------------------------------------------------------------------------------
Command 'lesspipe' is available in the following places
 * /bin/lesspipe
 * /usr/bin/lesspipe
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
lesspipe: command not found
Command 'dircolors' is available in '/usr/bin/dircolors'
The command could not be located because '/usr/bin' is not included in the PATH environment variable.
dircolors: command not found
Command 'uname' is available in '/bin/uname'
The command could not be located because '/bin' is not included in the PATH environment variable.
uname: command not found
bash: [: =: unary operator expected
Command 'sed' is available in '/bin/sed'
The command could not be located because '/bin' is not included in the PATH environment variable.
sed: command not found
Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found

-------------------------------------------------------------------------------------------------------------------------------------

Hot Fix:
Do the following command in the same error terminal
 -------------------------------------------------------------------------------------------------------------------------------------
  export PATH=/usr/bin:/bin

Saturday, September 22, 2012


Hi all again I coming with the Ubuntu hint. This about java.I got installed java 7 using the ubuntu software center, after successful completion of my installation I unable to execute my javac command.

and I decided to go with the terminal to install the java 6
apt-get install <java package>

it installed and stored on the location of
/usr/lib/jvm/default                        
                      /java-1.6.0-openjdk  
                      /java-7-openjdk-i386
after looking all the installed folder under my JVM folder, I had a confusion, I would decided to check which java version is taking by default. It was abusively the java 6, which Installed as recently.

But every one may look to use the latest version of java as i liked.
so i tried to find echo $JAVA_HOME, but the result empty echo message on terminal. then how the javac executing with out setting any JAVA_HOME/Path. Its terminal will look all command from the location of /usr/bin, there is javac is available by default.
so when you want to change the java version , you have to set the JAVA_HOME using following,


Set JAVA_HOME / PATH for a single user

Login to your account and open .bash_profile file
$ gedit ~/.bash_profile
Set JAVA_HOME as follows using syntax export
JAVA_HOME=<path-to-java>.
If your path is set to
/usr/lib/jvm/java-1.6.0-openjdk, set it as follows:

export JAVA_HOME=/usr/jvm/java-1.6.0-openjdk

Set PATH as follows:
export PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin

Feel free to replace /usr/lib/jvm/java-1.6.0-openjdk as per your setup. Save and close the file. Just logout and login back to see new changes. Alternatively, type the following command to activate the new path settings immediately:

$ source ~/.bash_profile
OR
$ . ~/.bash_profile

Verify new settings:
$ echo $JAVA_HOME
$ echo $PATH
Tip: Use the following command to find out exact path to which java executable under UNIX / Linux:
$ which java

Please note that the file ~/.bashrc is similar, with the exception that ~/.bash_profile runs only for Bash login shells and .bashrc runs for every new Bash shell.
Set JAVA_HOME / PATH for all user

You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:
# gedit /etc/profile
Next setup PATH / JAVA_PATH variables as follows:
export PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin
export PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin

Save and close the file. Once again you need to type the following command to activate the path settings immediately:

# source /etc/profile
OR
# . /etc/profile     
   

Wednesday, September 19, 2012



Authentication using JAAS

What are authentication and authorization?

Authentication can defined as the process to confirm the identity of an user. This can be achieved in a variety of ways, e.g. by entering a password, swiping an ID card, or using a biometrical scanner. The user need not be a human being, but can be a computer process.
Authorization can be defined as the process of deciding whether an authenticated user/system is allowed to access a certain resource or perform a certain action or not. A system may have many logical sections/modules, and not all users might have access to all modules. For example, one would not want an employee of a company to be authorized to get into parts of an application related to the company's appraisal system or other confidential data. This is where authorization comes into play. Though the user might have authenticated himself, he might not have sufficient authorization to access certain particular data items.
Both the above –authentication and authorization– are addressed by JAAS.

What is JAAS?

As the name –Java Authentication and Authorization Services– suggests, it provides a framework and an API for the authentication and authorization of users, whether they're human or automated processes. Both parts provide full-fledged capabilities and can be used in small-sized applications as well as enterprise applications, where security is a major concern. JAAS was inspired by PAM (Pluggable Authentication Module); one might say that JAAS is a Java version of PAM. It was introduced as an optional package for use with JDK 1.3, but has been integrated as part of the standard JDK 1.4.
JAAS uses a service provider approach to its authentication features, meaning that it is possible to configure different login modules for an application without changing any code. The application remains unaware of the underlying authentication logic. It's even possible for an application to contain multiple login modules, somewhat akin to a stack of authentication procedures.
In this article we will discuss the authentication part of JAAS in detail, starting with the various classes and interfaces which are involved, followed by a ready-to-run example.

Classes and interfaces

LoginModule (javax.security.auth.spi.LoginModule)
Login modules are written by implementing this interface; they contain the actual code for authentication. It can use various mechanisms to authenticate user credentials. The code could retrieve a password from a database and compare it to the password supplied to the module. It could also use a flat file, LDAP or any other means of storing user information for that purpose. Generally, in enterprise networks all authentication credentials are stored in one place, which might be accessed through LDAP.
LoginContext (javax.security.auth.login.LoginContext)
The login context is the core of the JAAS framework which kicks off the authentication process by creating a Subject. As the authentication process proceeds, the subject is populated with various principals and credentials for further processing.
Subject (javax.security.auth.Subject)
A subject represents a single user, entity or system –in other words, a client– requesting authentication.
Principal (java.security.Principal)
A principal represents the face of a subject. It encapsulates features or properties of a subject. A subject can contain multiple principals.
Credentials
Credentials are nothing but pieces of information regarding the subject in consideration. They might be account numbers, passwords, certificates etc. As the credential represents some important information, the further interfaces might be useful for creating a proper and secure credential – javax.security.auth.Destroyable and javax.security.auth.Refreshable. Suppose that after the successful authentication of the user you populate the subject with a secret ID (in the form of a credential) with which the subject can execute some critical services, but the credential should be removed after a specific time. In that case, one might want to implement the Destroyable interface. Refreshable might be useful if a credential has only a limited timespan in which it is valid.

The process of authentication

The authentication process starts with creating an instance of the LoginContext. Various constructors are available; the example uses the LoginContext(String, CallbackHandler) variety. The first parameter is the name (which acts as the index to the login module stack configured in the configuration file), and the second parameter is a callback handler used for passing login information to the LoginModule. CallbackHandler has a handle method which transfers the required information to the LoginModule. The example uses a very simple handler which saves the username and password in an instance variable, so that it can be passed on during the invocation of the handle method from the LoginModule. It's also possible to create callbacks that interact with the user to obtain user credentials, and transfer that information to the LoginModule for authentication.
An empty Subject is created before the authentication begins. This is passed to all login modules configured for the application. If the authentication is successful, the subject is populated with various principals and credentials.
The login method in the LoginContext is used to start the login process. After its successful completion, the application can retrieve the Subject from the LoginContext using the getSubject() method.
The login process has two phases. In the first phase, the individual login module's login method is invoked, but at this point the principals and credentials are not attached to the subject. The reason being that if the overall login fails, the principals and credentials attached to the subject are invalid, and have to be removed.
If the login process is successful the commit methods of all login modules are invoked, and the individual login modules take care of attaching the appropriate principals and credentials to the subject. If it fails then the abort method would be invoked; that gives the login modules a chance to perform any necessary cleanup.
The login method of the login module should return true if the authentication is successful, false if this module should be ignored, and it throws a LoginException if the authentication fails.

JAAS configuration in detail

Let's take a look at a sample JAAS configuration file.
RanchLogin { com.javaranch.auth.FirstLoginModule requisite debug=true ; com.javaranch.auth.SecondLoginModule required debug=false email=admin@mydomain.com ; }; With this configuration, two login modules have been configured under the name RanchLogin: FirstLoginModule and SecondLoginModule. Each login module is configured with a flag, which decides its behavior as the authentication proceeds down the authentication stack. Other dynamic information related to specific login modules can be passed using key/value pairs. One parameters is supplied to the first login module (debug, and two to the second (debug and email). These parameter values can be retrieved from within the module. The possible flags are:
1) Required – This module must authenticate the user. But if it fails, the authentication nonetheless continues with the other login modules in the list (if any).
2) Requisite – If the login fails then the control returns back to the application, and no other login modules will execute.
3) Sufficient – If the login succeeds then the overall login succeeds, and control returns to the application. If the login fails then it continues to execute the other login modules in the list.
4) Optional – The authentication process continues down the list of login modules irrespective of the success of this module.

An example

A login configuration file is needed, which specifies the login module to be used. The file name is passed as a JVM parameter via a -Djava.security.auth.login.config="JAAS_CONFIG_FILENAME" switch. The following code shows a simple example.
The code triggering the authentication (com.javaranch.auth.Login)
CallbackHandler handler = new RanchCallbackHandler(userName, password);

try {
    LoginContext loginContext = new LoginContext("RanchLogin", handler);
    // starts the actual login
    loginContext.login();
} catch (LoginException e) {
    // log  error (failed to authenticate the user - do something about it)
    e.printStackTrace();
}
Login configuration file (loginConfig.jaas). It ties the name "RanchLogin" (used in the previous paragraph) to the class RanchLoginModule (shown in the next paragraph).
RanchLogin {
    com.javaranch.auth.RanchLoginModule required;
};
Implementation of LoginModule in the class RanchLoginModule
public boolean login() throws LoginException {
    boolean returnValue = true;
 if (callbackHandler == null){
        throw new LoginException("No callback handler supplied.");
    }

    Callback[] callbacks = new Callback[2];
    callbacks[0] = new NameCallback("Username");
    callbacks[1] = new PasswordCallback("Password", false);

    try {
        callbackHandler.handle(callbacks);
        String userName = ((NameCallback) callbacks[0]).getName();
        char [] passwordCharArray = ((PasswordCallback) callbacks[1]).getPassword();
        String password = new String(passwordCharArray);
        //--> authenticate if username is the same as password (yes, this is a somewhat simplistic approach :-)
        returnValue = userName.equals(password);
    } catch (IOException ioe)  {
        ioe.printStackTrace();
        throw new LoginException("IOException occured: "+ioex.getMessage());
    } catch (UnsupportedCallbackException ucbe) {
        ucbe.printStackTrace();
        throw new LoginException("UnsupportedCallbackException encountered: "+ucbe.getMessage());
    }

    System.out.println("logged in");
    return returnValue;
}

Authentication with a SecurityManager

There's one problem with this code - if a security manager is present (as it is likely to be in applications worth protecting) an exception is thrown. We have to give certain permissions to the code using the policy file:
grant { permission java.util.PropertyPermission "user", "read"; permission java.util.PropertyPermission "pass", "read"; permission java.util.PropertyPermission "java.security.auth.login.config", "read"; permission java.util.PropertyPermission "java.security.policy", "read"; permission javax.security.auth.AuthPermission "createLoginContext.RanchLogin"; }; We have to grant the code AuthPermission with target createLoginContext, so that it is allowed to instantiate a LoginContext object.
To run the code with a security manager we also need to pass a -Djava.security.manager parameter to the JVM, along with the location of login configuration and policy files. Alternatively, it's also possible to modify the default policy file that comes with the JDK directly.

Running the examples

Make sure that jaas.config, policy.config and the jaas-example.jar file are in the same directory. (There are also Ant targets named runCase1, runCase2, runCase3 and runCase4 that will execute these test program with the specified parameters.) The complete, ready-to-run code can be downloaded here.
java -Duser=rahul
     -Dpass=rahul
     -Djava.security.auth.login.config=jaas.config
     -jar jaas-example.jar
Result : Successful, as the username is same as the password.
java -Duser=rahul
     -Dpass=notrahul
     -Djava.security.auth.login.config=jaas.config
     -jar jaas-example.jar
Result : Failed, as the username is not as same as the password.
java -Duser=rahul
     -Dpass=rahul
     -Djava.security.auth.login.config=jaas.config
     -Djava.security.manager
     -jar jaas-example.jar
Same as above, but with a security manager enabled. Result : Failed, as the code doesn't have the required permissions.
java -Duser=rahul
     -Dpass=rahul
     -Djava.security.auth.login.config=jaas.config
     -Djava.security.manager
     -Djava.security.policy=policy.config
     -jar jaas-example.jar
Result : Successful, as the code has been granted all the necessary permissions using the policy.config file.

Source Article written by Rahul Bhattacharjee

Saturday, August 18, 2012

install Eclipse juno (3.7) on Ubuntu 11.04

1) Download Eclipse. eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
2) Extract it
tar xzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
 
Or just be lazy and Right Click > Extract Here 3) Move to /opt/ folder
mv eclipse /opt/
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
4) Create an eclipse executable in your path Change the current directory to cd /opt
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudo nano /usr/bin/eclipse
 
copy this into nano
#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*
 
save the file (^O = Ctrl+o) and exit nano (^X = Ctrl+x) 5) Create a gnome menu item
sudo nano /usr/share/applications/eclipse.desktop
 
copy this into nano
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
 
save and exit nano 6) Launch Eclipse for the first time
/opt/eclipse/eclipse -clean &
 
Source Blog : http://colinrrobinson.com/technology/install-eclipse-ubuntu/ 

Sunday, March 18, 2012

SWT Designer Palette



SWT Designer provides the following palette for creating SWT, JFace and RCP applications.
The palette may be fully configured using the Palette Manager.

  • Composite - Instances of this class are controls which are capable of containing other controls.
  • Group - Instances of this class provide an etched border with an optional title.
  • ScrolledComposite - Instances of this class are controls which are capable of containing other controls within a scrolling frame.
  • SashForm - The SashForm lays out its children in a Row or Column arrangement (as specified by the orientation) and places a Sash between the children.
  • TabFolder - Instances of this class implement the notebook user interface metaphor. It allows the user to select a notebook page from set of pages.
  • TabItem - Instances of this class represent a selectable user interface object corresponding to a tab for a page in a tab folder.
  • CTabFolder - Instances of this class implement the notebook user interface metaphor. It allows the user to select a notebook page from set of pages.
  • CTabItem - Instances of this class represent a selectable user interface object that represent a page in a notebook widget.
  • ViewForm - Instances of this class implement a Composite that lays out three children horizontally and allows programmatic control of layout and border parameters. ViewForm is used in the workbench to implement a view's label/menu/toolbar local bar.
  • CBanner - Instances of this class implement a Composite that lays out its children and allows programmatic control of the layout. It draws a separator between the left and right children which can be dragged to resize the right control. CBanner is used in the workbench to layout the toolbar area and perspective switching toolbar.

  • Absolute (null) Layout - A null layout displays components with specified bounds.
  • FillLayout - FillLayout is the simplest layout class. It lays out controls in a single row or column, forcing them to be the same size.
  • GridLayout - Instances of this class lay out the control children of a Composite in a grid.
  • FormLayout - Instances of this class control the position and size of the children of a composite control by using FormAttachments to optionally configure the left, top, right and bottom edge of each child.
  • RowLayout - Instances of this class determine the size and position of the children of a Composite by placing them either in horizontal rows or vertical columns within the parent Composite.
  • StackLayout - This Layout stacks all the controls one on top of the other and resizes all controls to have the same size and location. The control specified in topControl is visible and all other controls are not visible.
  • GroupLayout - This is an SWT port of the Swing GroupLayout. GroupLayout mixes grid layout and free form layout.
  • FlowLayout - The AWT flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. Flow layouts are typically used to arrange buttons in a panel. It will arrange buttons left to right until no more buttons fit on the same line.
  • BoxLayout - A layout manager that allows multiple components to be laid out either vertically or horizontally. The components will not wrap so, for example, a vertical arrangement of components will stay vertically arranged when the frame is resized.
  • BorderLayout - The AWT border layout lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center.

  • Label - Instances of this class represent a non-selectable user interface object that displays a string or image. When SEPARATOR is specified, displays a single vertical or horizontal line.
  • Text - Instances of this class are selectable user interface objects that allow the user to enter and modify text.
  • Combo - Instances of this class are controls that allow the user to choose an item from a list of items, or optionally enter a new value by typing it into an editable text field.
  • Button - Instances of this class represent a selectable user interface object that issues notification when pressed and released.
  • Check Button - Instances of this class represent a selectable user interface object that issues notification when checked and unchecked.
  • Radio Button - Instances of this class represent a selectable user interface object that issues notification when selected and unselected.
  • Spinner - Instances of this class are selectable user interface objects that allow the user to enter and modify numeric values.
  • DateTime - Instances of this class are selectable user interface objects that allow the user to enter and modify date or time values.
  • Table - Instances of this class implement a selectable user interface object that displays a list of images and strings and issue notification when selected.
  • TableColumn - Instances of this class represent a column in a table widget.
  • TableItem - Instances of this class represent a selectable user interface object that represents an item in a table.
  • TableCursor - A TableCursor provides a way for the user to navigate around a Table using the keyboard. It also provides a mechanism for selecting an individual cell in a table.
  • Tree - Instances of this class provide a selectable user interface object that displays a hierarchy of items and issue notification when an item in the hierarchy is selected.
  • TreeColumn - Instances of this class represent a column in a tree widget.
  • TreeItem - Instances of this class represent a selectable user interface object that represents an item in a tree.
  • List - Instances of this class represent a selectable user interface object that displays a list of strings and issues notification when a string selected. A list may be single or multi select.
  • ToolBar - Instances of this class support the layout of selectable tool bar items.
  • ToolItem - Instances of this class represent a selectable user interface object that represents a button in a tool bar.
  • Check ToolItem - Instances of this class represent a selectable user interface object that represents a button in a tool bar that can be checked and unchecked.
  • Radio ToolItem - Instances of this class represent a selectable user interface object that represents a button in a tool bar such that only one from group can be selected.
  • DropDown ToolItem - Instances of this class represent a selectable user interface object that represents a button in a tool bar that can show drop-down menu when clicked.
  • Separator ToolItem - Instances of this class represent a selectable user interface object that represents a separator in a tool bar.
  • CoolBar - Instances of this class provide an area for dynamically positioning the items they contain.
  • CoolItem - Instances of this class are selectable user interface objects that represent the dynamically positionable areas of a CoolBar.
  • Horizontal Separator - Horizontal separator.
  • Vertical Separator - Vertical separator.
  • ProgressBar - Instances of the receiver represent is an unselectable user interface object that is used to display progress, typically in the form of a bar.
  • Canvas - Instances of this class provide a surface for drawing arbitrary graphics.
  • Scale - Instances of this class are selectable user interface objects that represent a range of positive, numeric values.
  • Slider - Instances of this class are selectable user interface objects that represent a range of positive, numeric values.
  • Browser - A Browser implement the browser user interface metaphor. It allows the user to visualize and navigate through HTML documents (Eclipse 3.0 and above only).
  • Link - Instances of this class represent a selectable user interface object that displays a text with links.
  • ExpandBar - Instances of this class support the layout of selectable expand bar items.
  • ExpandItem - Instances of this class represent a selectable user interface object that represents a expandable item in a expand bar.
  • CLabel - A Label which supports aligned text and/or an image and different border styles.
  • CCombo - The CCombo class represents a selectable user interface object that combines a text field and a list and issues notificiation when an item is selected from the list.
  • StyledText - A StyledText is an editable user interface object that displays lines of text.
  • TableTree - A TableTree is a selectable user interface object that displays a hierarchy of items, and issues notification when an item is selected. As of 3.1 use Tree, TreeItem and TreeColumn.
  • DragSource - DragSource defines the source object for a drag and drop transfer.
  • DropTarget - DropTarget defines the target object for a drag and drop transfer.
  • TrayItem - Constructs a new instance of this class given its parent (which must be a Tray) and a style value describing its behavior and appearance. The item is added to the end of the items maintained by its parent.

  • ComboViewer - A concrete viewer based on a SWT Combo control.
  • ListViewer - A concrete viewer based on an SWT List control.
  • TableViewer - A concrete viewer based on a SWT Table control.
  • TableViewerColumn - ViewerColumn implementation for TableViewer to enable column-specific label providers and editing support.
  • CheckboxTableViewer - Creates a table viewer on a newly-created table control under the given parent. The table control is created using the given SWT style bits, plus the SWT.CHECK style bit. The table shows its contents in a single column, with no header. The viewer has no input, no content provider, a default label provider, no sorter, and no filters.
  • TreeViewer - A concrete viewer based on an SWT Tree control.
  • TreeViewerColumn - ViewerColumn implementation for TreeViewer to enable column-specific label providers and editing support.
  • CheckBoxTreeViewer - A concrete viewer based on a SWT Table control with checkboxes on each node.
  • TableTreeViewer - A concrete viewer based on a SWT TableTree control.
  • Table Composite - Composite with Table that lays out columns using TableColumnLayout.
  • TableViewer Composite - Composite with TableViewer that lays out columns using TableColumnLayout.
  • Tree Composite - Composite with Tree that lays out columns using TreeColumnLayout.
  • TreeViewer Composite - Composite with TreeViewer that lays out columns using TreeColumnLayout.
  • TextViewer - SWT based implementation of ITextViewer and its extension interfaces.
  • ControlDecoration - ControlDecoration renders an image decoration near a control. It allows clients to specify an image and a position for the image relative to the control. A ControlDecoration may be assigned description text, which can optionally be shown when the user hovers over the image. Clients can decorate any kind of control.

  • CDateTime - The CDateTime provides both textual and graphical means for setting the attributes of a java.util.Date class.
  • CalendarCombo - The Calendar Combo Widget is a combo box widget that opens a calendar when dropped down. The calendar is modelled after Microsoft Outlook's calendar widget and acts and behaves exactly the same (and it is also theme based).
  • DateChooser - DateChooser widget presents the monthly view of a calendar for date picking.
  • DateChooserCombo - DateChooserCombo widget is a date field editor that combines a text field and a popup calendar. This widget is based on FormattedText and DateChooser.
  • PGroup - The PGroup widget is a expandable/collapsible composite widget with attractive styling and an extensible design.
  • CollapsibleButtons - The Collapsible Buttons Widget is a customizable collapsible buttons widget modeled after the bottom left buttons widget in Microsoft Outlook. The widget is highly customizable from simple flags for setting things on and off, to extending interfaces for controlling how the buttons should be painted and other more advanced aspects.
  • CollapsibleButton - Drop new collapsible button on CollapsibleButtons widget.
  • Gallery - SWT Widget that displays a picture gallery.
  • GalleryItem - Picture item for Gallery widget.
  • GalleryTreeViewer - A concrete tree viewer based on an Gallery widget.
  • PShelf - The PShelf widget is a composite widget that is similar to a tab folder. It contains items which can be selected to show their client areas.
  • PShelfItem - Item for PShelf widget.
  • CTableTree - The CTableTree widget is a custom TableTree component created with two primary purposes: 1.Allow items to expand and collapse independently of one another 2.Separate the creation and maintenance of Cells from the implementation of the TableTree.
  • CContainerColumn - Column item for CTableTree widget.
  • CTableTreeItem - Row item for CTableTree widget.
  • Grid - The Grid widget is a spreadsheet/table component that offers features not currently found in the base SWT Table. Features include cell selection, column grouping, column spanning, row headers, and more.
  • GridColumn - Instances of this class represent a column in a grid widget.
  • GridColumnGroup - Instances of this class represent a column group in a grid widget.
  • GridItem - Instances of this class represent a selectable user interface object that represents an item in a grid.
  • GanttChart - The GANTT chart is a fully customizable widget for displaying anything from a simple chart to allowing user interaction via drag and drop and resizing and well as dependency interaction.
  • GanttGroup - A GanttGroup is a group of GanttEvents that will all draw on the same horizontal "line" in the GanttChart.
  • GanttEvent - One GanttEvent represents one "active" object int the GANTT chart.
  • GanttCheckpoint - Convenience class for creating a checkpoint instead of using the constructors on GanttEvent.
  • GanttImage - Convenience class for creating an image in the chart instead of using the constructors in GanttEvent.
  • GanttScope - A convenience class for creating a GanttScope instead of using the specific constructors on the GanttEvent.
  • CompositeTable - CompositeTable is a custom SWT grid control that: 1.Gives you control over the layout of your rows. 2.Automatically edits in place using any SWT control Manages CRUD operations simply and automatically. 3.Requests only visible data using a virtual table API for maximum scalability and performance.
  • FormattedText - FormattedText is a decorator component adding input and display mask capabilities on a Text widget. Formatting is based on a public formatter API.
  • GridTableViewer - A concrete table viewer based on an Grid control.
  • GridTreeViewer - A concrete tree viewer based on an Grid control.
  • RadioGroup - SWT Widget that presents a group of radio buttons.
  • RadioItem - Instances of this class represent a selectable user interface object that represents an radio button in a radio group.
  • RadioGroupViewer - A concrete viewer based on a Nebula RadioGroup control.
  • TableCombo - The TableCombo class represents a selectable user interface object that combines a label, textfield, and a table and issues notification when an item is selected from the table.
  • TableComboViewer - A concrete viewer based on a Nebula TableCombo control.

  • ColumnLayout - This layout manager arranges children of the composite parent in vertical columns. All the columns are identical size and children are stretched horizontally to fill the column width. The goal is to give layout some reasonable range of column numbers to allow it to handle various parent widths. That way, column number will drop to the lowest number in the range when width decreases, and grow up to the highest number in the range when allowed by the parent width.
  • TableWrapLayout - This implementation of the layout algorithm attempts to position controls in the composite using a two-pass autolayout HTML table algorithm recommeded by HTML 4.01 W3C specification. The main differences with GridLayout is that it has two passes and that width and height are not calculated in the same pass.
  • Button - Instances of this class represent a selectable user interface object that issues notification when pressed and released.
  • Composite - Instances of this class are controls which are capable of containing other controls.
  • Composite Separator - Creates the composite that can serve as a separator between various parts of a form. Separator height should be controlled by setting the height hint on the layout data for the composite.
  • Label - Instances of this class represent a non-selectable user interface object that displays a string or image. When SEPARATOR is specified, displays a single vertical or horizontal line.
  • Hyperlink - Hyperlink is a concrete implementation of the abstract base class that draws text in the client area. Text can be wrapped and underlined. Hyperlink is typically added to the hyperlink group so that certain properties are managed for all the hyperlinks that belong to it.
  • ImageHyperlink - This class extends hyperlink widget by adding the capability to render an image relative to the text. If no text has been set, only image will be shown. Images for hover and active states can be set in addition to the normal state image.
  • FormText - This class is a read-only text control that is capable of rendering wrapped text. Text can be rendered as-is or by parsing the formatting XML tags. Independently, words that start with http:// can be converted into hyperlinks on the fly.
  • Separator - A horizontal or vertical line used to separate other controls.
  • Table - Instances of this class implement a selectable user interface object that displays a list of images and strings and issue notification when selected.
  • Text - Instances of this class are selectable user interface objects that allow the user to enter and modify text.
  • Tree - Instances of this class provide a selectable user interface object that displays a hierarchy of items and issue notification when an item in the hierarchy is selected.
  • ExpandableComposite - This composite is capable of expanding or collapsing a single client that is its direct child. The composite renders an expansion toggle affordance (according to the chosen style), and a title that also acts as a hyperlink (can be selected and is traversable). The client is layed out below the title when expanded, or hidden when collapsed.
  • Section - A variation of the expandable composite that adds optional description below the title. Section is often used as a basic building block in forms because it provides for logical grouping of information.
  • Form - Form is a custom control that renders a title and an optional background image above the body composite. It can be used alone when part of parents that are scrolled. If scrolling is required, use ScrolledForm instead because it has an instance of Form and adds scrolling capability.
  • ScrolledForm - ScrolledForm is a control that is capable of scrolling an instance of the Form class. It should be created in a parent that will allow it to use all the available area (for example, a shell, a view or an editor).

  • New - Adds new subclass of Action to this form and allows to drop it on design canvas.
  • External - Allows to select some existing Action type (in separate external class) and drop it on design canvas.
  • Separator - A separator is a special kind of contribution item which acts as a visual separator and, optionally, acts as a group marker. Unlike group markers, separators do have a visual representation for menus and toolbars.
  • MenuManager - Creates a new MenuManager to represent a top-level pull down menu or a cascade menu.

  • Menu Bar - Instances of this class represent horizontal menu bar.
  • Popup Menu - Popup menu that can be dropped on any Control.
  • Cascade Menu - Special MenuItem that has cascade sub-menu.
  • MenuItem - Instances of this class represent a selectable user interface object that represents an item in a menu.
  • Radio MenuItem - Instances of this class represent a selectable user interface object that issues notification when checked and unchecked. Only one of them can be checked in same group.
  • Check MenuItem - Instances of this class represent a selectable user interface object that issues notification when checked and unchecked. Any number of them can be checked in same group.
  • Separator MenuItem - Special MenuItem that looks as horizontal separator line.

  • BooleanFieldEditor - A field editor for a boolean type preference.
  • StringFieldEditor - A field editor for a string type preference.
  • IntegerFieldEditor - A field editor for an integer type preference.
  • DoubleFieldEditor - A field editor for an double type preference.
  • ComboFieldEditor - A field editor for a combo box that allows the drop-down selection of one of a list of items.
  • RadioGroupFieldEditor - A field editor for an enumeration type preference. The choices are presented as a list of radio buttons.
  • ColorFieldEditor - A field editor for a color type preference.
  • FontFieldEditor - A field editor for a font type preference.
  • ScaleFieldEditor - A field editor for an integer type preference.
  • PathEditor - A field editor to edit directory paths.
  • DirectoryFieldEditor - A field editor for a directory path type preference. A standard directory dialog appears when the user presses the change button.
  • FileFieldEditor - A field editor for a file path type preference. A standard file dialog appears when the user presses the change button.

Wednesday, March 14, 2012

The above picture what you have seen is not just a report, it showing who is a real game changer.
Android. how he survive and playing massive role in mobile world. 


Saturday, March 10, 2012

Introducing Google Play


[This post is by Kenneth Lui, Android Developer Ecosystem. —Dirk Dougherty]

For more than a year we’ve been focused on expanding the reach, content, and monetization opportunities of Android Market. We started by extending the store to users on the web and then went on to add books, movies, and music. The number of people who have visited, registered, and downloaded from the store has been amazing.

Today we’re launching Google Play, an integrated destination for apps, books, movies, and music, accessible to users on Android devices and to anyone on the Web. As part of this launch, Google Play replaces and extends Android Market — users everywhere can now find their favorite apps and games in Google Play, with other digital content, all in one place.

We believe that with a strong brand, compelling offerings, and a seamless purchasing and consumption experience, Google Play will drive more traffic and revenue to the entire ecosystem.

We’ll be investing in the brand to bring Google Play to as many people as possible, and we’ll also invest in the latest digital content to keep Google Play fresh, relevant, and engaging. Apps and games remain the core of Google Play, so we’ll continue investing in new ways to connect users with their favorite apps, and developers with new customers.



As we grow and promote Google Play around the world, we’ll be marketing your apps and games at the same time. Our policies have not changed and our goal is still the same — to create a great, open marketplace for distributing Android apps.

Google Play is built on the same infrastructure as Android Market, so the transition for users and developers will be seamless. Users can sign into their existing accounts with the same credentials as before and purchase content using the same payment methods. As a developer, there’s no change needed to your published products and you can continue to use the same publishing tools to put your app in front of hundreds of millions of Android users. If your app was in Android Market yesterday, it’s in Google Play today.

We’ll be rolling out Google Play to devices in a phased OTA update, starting today and continuing over the days to come. With the update, the Android Market app will upgrade to the Play Store app and the Music, Videos, and Books apps will upgrade to Play Music, Play Movies, and Play Books. This update is for devices running Android 2.2 or higher, and users on other devices will continue to have the same access to your apps as before.

You can start sending customers to your products in Google Play right away. Check out the updated “Get it on Google Play” badges and look for an email with more details on the transition. In the meantime, you can check out the Google Play web site at the link below and join the discussion on +Android Developers.

Merging two sorted arrays - Big O (n+m) time complexity

 Problem :  Merge the two sorted arrays. Edge case :  Array can empty Arrays can be in different size let getMaxLength = ( input1 , input...