Wednesday, August 13, 2014

git pull: Couldn't reserve space for cygwin's heap, Win32 error 0

When I tried to pull the code from git, it took so long and finally it said "Couldn't reserve space for cygwin's heap, Win32 error 0"

There are various discussions which I found over web. But the first thing which i tried was "restarting my windows system" and it worked for me!!

Resources:
http://stackoverflow.com/questions/18502999/git-extensions-win32-error-487-couldnt-reserve-space-for-cygwins-heap-win32

https://cygwin.com/cygwin-ug-net/setup-maxmem.html

http://stackoverflow.com/questions/3144082/difference-between-msysgit-and-cygwin-git/3144417#3144417



Tuesday, August 12, 2014

Opening eclipse editor or view in the dialog programatically

We can open eclipse editor or view in the dialog by using the Eclipse e4 model services. This is also called detaching the editors/views from the eclipse workbench.

For this, you need to have e4 workbench plugin and it provides org.eclipse.e4.ui.workbench.modeling API services.


IWorkbench workbench = ActivatorPlugin.getDefault().getWorkbench();

//get editorpart somehow which you wanted to open it.
EditorPart openEditor = /*IDE.openEditor(workbench.getActiveWorkbenchWindow().getActivePage(), module, MyEditorID, false); */

//get editor site
IWorkbenchPartSite site = openEditor.getSite();

//get model service for editor site
EModelService modelService = (EModelService) site.getService(EModelService.class);
MPartSashContainerElement  mpartService = (MPart) site.getService(MPart.class);

//invoke detach on model service with coordinates.
modelService.detach(mpartService, 100, 100, 700, 700);


For view:

//Get view part
IViewPart view = workbench.getActiveWorkbenchWindow().getActivePage().findView(MyPerspective.ExplorerView_ID);
//get site for view
//invoke detach


Resources:
http://eclipsesource.com/blogs/tutorials/eclipse-4-e4-tutorial-part-7-services/
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-9l.htm
http://mcuoneclipse.com/2012/02/29/go-multiply-and-detach-multiple-screens-with-eclipse/

Saturday, August 2, 2014

Hide toolbar in eclipse programatically


You might want to remove eclipse toolbar completely in your Eclipse RCP product to make use of that space or you might not have any useful toolbar actions which are specific to your product.

This how you can remove programatically.

private void hideCoolbar() {
try {
IHandlerService service = (IHandlerService) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getService(IHandlerService.class);
if (service != null)
service.executeCommand("org.eclipse.ui.ToggleCoolbarAction", null);
} catch (Exception e) {
KEditorPlugin.logError("Unable to hide the eclipse toolbar.",e);
}
}








Hide tool bar in eclipse

In eclipse 3.8 version and earlier, you can find "Hide Toolbar" option on the right click of eclipse toolbar itself. This will hide the complete toolbar.

In Eclipse e4 versions, you can find this option in on the Eclipse toolbar Window menu.
Window -> Hide Toolbar

To enable again,
Window -> Show Toolbar


Thursday, July 31, 2014

git pull failed with file too long issue

Run below command to avoid the issue.

$ git config core.longpaths true