If you know the eclipse command and you want to execute that in the programmatical way, you need to use IHandlerService.
Below is the example to perform toggle full-screen command from eclipse.
IHandlerService handlerService =
(IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
if (handlerService == null)
{
return null;
}
try
{
handlerService.executeCommand("org.eclipse.ui.cocoa.fullscreenWindow", null);
}
catch (Exception ex)
{
//log exception
}