Tag Archive 'icons'

Feb 04 2009

Eclipse Jobs API – Errata

Published by under Eclipse,IT,Java

My colleague Lukasz Milewski has just spotted a missing piece in a code sample for creating icons presented in previous post. In the screenshot you can see nice icons for currently running Jobs as well as for scheduled Jobs. You need to set two properties in your Job implementation to associate an icon with it.

	setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
	setProperty(IProgressConstants.ICON_PROPERTY, ImageDescriptorFactory
		.createImageDescriptor(ICON_NAME));

3 responses so far

Sep 09 2008

Eclipse RCP tips and tricks

Published by under Eclipse,IT,Java

Recently I had to do couple of tricks Eclipse RCP applications. Basically all of the pieces of code presented below need to be placed in method initialize(IWorkbenchConfigurer configurer). You need to override this method in WorkbenchAdvisor subclass.

  • Displaying icons in Navigator View
    final String ICONS_PATH = "icons/full/";
    final String PATH_OBJECT = ICONS_PATH + "obj16/";
    Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
    declareWorkbenchImage(configurer, ideBundle,
    IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif", true);
    declareWorkbenchImage(configurer, ideBundle,
    IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
    + "cprj_obj.gif", true);
  • Enabling Decoration Context
    DecorationContext dc = (DecorationContext) DecorationContext.DEFAULT_CONTEXT;
    dc.putProperty(IDecoration.ENABLE_REPLACE, Boolean.TRUE);
  • Enabling Jobs Progress Bar
    IWorkbench wb = PlatformUI.getWorkbench();
    wb.getProgressService();

Probably you don’t need any of those when running your plug-ins in Eclipse IDE. The tricky part is running it in a stripped to minimum RCP based applications.

One response so far