Thursday, October 3, 2013

Eclipse Mac OS - Context-sensitive help

 Please find the below link on context sensitive help from Eclipse for various platforms.  Please go through the “Context-sensitive help” section.

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fhelp.htm

 As mentioned in the Eclipse documentation,  “ F1(Shift+F1  Help on the Mac). Alternatively, in dialogs you can achieve the same result by pressing the   help button in the dialog's button bar.”

To make it clear, Eclipse Mac is not providing the context sensitive help the way how windows (using F1) is providing.   You have to use’ help’ key in Mac keyboards or ‘command+shift+?’ in mac pro’s to point to the Help search.

 To use context-sensitive Help on Mac OS, set a keyboard shortcut to the Dynamic Help command. Eclipse ‘Dynamic Help’ option is available for Windows and as well as Mac systems.
This can also be used to get the context sensitive help documentation.

To specify a keyboard shortcut for the Dynamic Help command, do the following:
1.       Select Eclipse > Preferences.
2.       In the tree view, select General > Keys.
3.       Select the Dynamic Help command.
4.       Press the key binding combination that you want to set. For example, to enter Ctrl+Shift+1, press and hold the keys Ctrl and Shift and then press 1. A plus sign (+) between the keys indicates that you must press the keys in succession.

Now, you will be able to get ‘ context sensitive Dynamic help’ doc.  This provides the exact documentation whatever you are getting in windows through Dynamic help (This could be different from what you are getting for ‘F1’ help in windows but this would be same as what you are getting through dynamic help in windows).



Eclipse Mac OS - shortcut keys


Shortcut keys for Mac and Windows users @
http://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts


Eclipse Mac OS- Scrollbar in navigation viewer

Bydefault, scrollbar option is not visible for navigation viewer in Eclipse for Mac OS. Unless you try to drag it, you will not realize that there is a scroll available for it.

To make it available explicitly, check “Always” option under Show Scroll Bars in System Preferences. If you enable that option you will get both horizontal and vertical scroll bars for navigation viewer.

IP address validation

Any IP address has to fall into [0-255].[0-255].[0-255].[0-255] format criteria.

We can achieve this by using following 2 ways.


Using split method of String: The method described above can also be written in a simple way as follows


public boolean validateIPAddress( String ipAddress ) {

String[] tokens = ipAddress.split("\\.");
if (tokens.length != 4) {
return false;
}
for (String str : tokens) {
int i = 0;
try {
  i = Integer.parseInt( s );
  } catch (NumberFormatException e) { //if any character data is entered.
   return false;
  }
if ((i < 0) || (i > 255)) {
return false;
}
}
return true;
}


Using regular expression: The following method with return true is the IP Address is valid, else it returns false.


public boolean validateIPAddress( String ipAddress ){

final Pattern ipAdd= Pattern.compile("b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
+ "{3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)b");
return ipAdd.matcher(ipAddress).matches();
}


If it's is false, we can show error message as "IP Address must be in the in the format of:  [0-255].[0-255].[0-255].[0-255]"


Wednesday, October 2, 2013

Eclipse bundle states

Below diagram explains in which state your eclipse bundle is in.



To understand each state of these, please follow the below link





Tuesday, September 24, 2013

How do I stop the error log view popping up in eclipse

In general will log lot of information and errors into the error during the job execution, if that is a long running job it will keep on posting current execution messages to the error log. While posting the message to the error log view, if the view is not focused job will bring the focus to the view.
Sometimes this would be disgusting, if you are working with other view just next to it, beacause focus will always goes back to the error log view, if any message is posted into it by currently running job. To avoid this kind of issue follow the below approach.

In error log view, you can find the drop down menu (small triangle on the top - right of the view), deselect "Activate on new events".

This will avoid the view popping issue when any error or messages are pushed into error log.