Posts

Showing posts with the label JFace

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

Creating Overlay Icons - Table Viewer

Sometimes in table viewer icon decoration is not possible. We can create overlay icons and return them in class ITableLabelProvider method's - public Image getColumnImage(Object element, int columnIndex) will be enough ImageDescriptor desc = Activator.getImageDescriptor(....); // It take String (Image Path) if (desc != null) { DecorationOverlayIcon decoratedImage = new DecorationOverlayIcon(image, desc, IDecoration.BOTTOM_LEFT); if (decoratedImage != null) { return decoratedImage.createImage(); } }