Posts

Showing posts from April, 2016

How to remove QuickAccess field from your Eclipse application

Image
Sometimes we need to remove the QuickAccess widget from Eclipse RCP application. Even after following below steps Ctrl + 3 will work. Add these dependency in your eclipse rcp plugin org.eclipse.e4.ui.model.workbench org.eclipse.e4.ui.workbench org.eclipse.e4.core.contexts In ApplicationWorkbenchWindowAdvisor, in postWindowOpen add these statements at end IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window instanceof WorkbenchWindow) { MWindow mWindow = ((WorkbenchWindow) window).getModel(); EModelService modelService = mWindow.getContext().get(EModelService.class); MToolControl searchField = (MToolControl)modelService.find("SearchField", mWindow); if (searchField != null) { searchField.setToBeRendered(false); } }

Producer - Consumer Problem Java

Producer - Consumer Problem implementation: IntegerBuffer.java public class IntegerBuffer { private int index; private int[] buffer; private final int SIZE = 2; public IntegerBuffer() { this.buffer = new int[SIZE]; } public synchronized void add(int number) { while (index == buffer.length - 1) { try { wait(); System.out.println("IntegerBuffer.add() waiting"); } catch (InterruptedException e) { } } buffer[index++] = number; notifyAll(); } public synchronized int remove() { while (index == 0) { try { wait(); System.out.println("IntegerBuffer.remove() waiting"); } catch (InterruptedException e) { } } in...