Thursday, July 21, 2016

Eclipse in full screen mode - programmatically

Eclipse 4.4/4.5

 active contribution item identifier:
org.eclipse.ui.cocoa.fullscreenWindow

The active contribution location URI:
menu:window?after=org.eclipse.ui.cocoa.fullscreenWindow

Thursday, July 14, 2016

Recovering staged lost files during git reset --hard

$ git fsck --cache --unreachable $(git for-each-ref --format="%(objectname)")   $(egrep commit all | cut -d ' ' -f 3)
Checking object directories: 100% (256/256), done.
Checking objects: 100% (542/542), done.
unreachable blob 6900c6418b5df26f6471b7d4853822d99fcf2534
unreachable blob 945019391229d1304b47c7d1dc112ff45bbca360
unreachable blob 0ed3acde384de116f4b194bfd226055074a9f52d
unreachable blob c0234fc886423ff40a96b4c3e7ba67a4deb944c0
unreachable blob c9754aed2e981cdf678159ab41f7bfea89c93cbd
unreachable blob 8168f4a5a91997641211ce0d30b01e8bf8920792
unreachable blob 8c9cc9beddbc89a0ef46a1631265f79551a78e8a

unreachable blob 758e9c59bc04d38bd676c3c98e6d092b698defa4


Your file should be one of those unreachable blob from the above list. To verify that, do git show for every blob and see.

$ git show 6900c6418b5df26f6471b7d4853822d99fcf2534



Resources:

Tuesday, May 31, 2016

Eclipse RCP remote debugging

You have two Eclipse applications here

1. Target eclipse  - which you've shipped to client
2. Source eclipse -  source code application


Step 1: Launch target eclipse in debug mode

Note: Here AppceleratorStudio is my Eclipse-based product

Go to your eclipse:
$cd /Applications/Appcelerator Studio/AppceleratorStudio.app/Contents/MacOS

Then run the following command.

$./AppceleratorStudio -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8989

8989 is the port number where you're remote eclipse debug service is running on.

The moment you run the above command, you will get to see "Listening for transport dt_socket at address: 8989" mesasge on the console.



Step# 2: Launch your source eclipse.

  1. Select a project from the project explorer
  2. From toolbar debug menu, go to "Debug configurations..."
  3. Go to 'Remote Java Application'
  4. Right-click 'New'
  5. And provide the configuration something like below.
  6. Click on 'Apply' and 'Debug'







Monday, May 9, 2016

Control decoration example

boolean isInstalled =/**...**/


Button appBtn = new Button(myComp, SWT.CHECK);
appBtn.setText("Upload to Server");
appBtn.setEnabled(isInstalled);

final ControlDecoration dec = new ControlDecoration(appBtn, SWT.TOP | SWT.RIGHT);
dec.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_WARNING));
dec.setDescriptionText("Upload to Server feature is not available on the current plan");
dec.show();