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();

Thursday, May 5, 2016

Programatically changing the eclipse perspective

try
{
   PlatformUI.getWorkbench().showPerspective("StudioPerspective", PlatformUI.getWorkbench().getActiveWorkbenchWindow());
}
catch (WorkbenchException e)
{
  e.printStackTrace();

}