Palladio Workflow Engine/Custom Tab Images

Aus SDQ-Wiki

(since version 1.1) The Workflow Engine provides utilities for image management to add custom icons to your launch configuration tab. If your configuration tab extends the abstract class AbstractLaunchConfigurationTab you are able to overwrite the getImage() method to provide your custom image.

The implementation of the getImage() method is supported by the WorkflowEngine based on the class de.uka.ipd.sdq.workflow.launchconfig.RunConfigImages. To make use of it you should follow the steps below:

  1. Provide your icon in your plugin (e.g., in a subdirectory /icons/ such as /icons/mytabicon.gif)
  2. Add the constants PLUGIN_ID (String representing the id of your custom plugin) and XY_TAB_IMAGE_PATH (string representing the relative path of your icon such as "/icons/mytabicon.gif")
  3. call the RunConfigImages.getTabImage(PLUGIN_ID,XY_TAB_IMAGE_PATH) method in your getImage() implementation

The code might look like:

	
/** The id of this plug-in. */
public static final String PLUGIN_ID = "de.uka.ipd.sdq.workflow.pcm";

/** The path to the image file for the tab icon. */
private static final String FILENAME_TAB_IMAGE_PATH = "icons/filenames_tab.gif";

...

/* (non-Javadoc)
 * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage()
 */
@Override
public Image getImage() {
  return RunConfigImages.getTabImage(PLUGIN_ID,FILENAME_TAB_IMAGE_PATH);
}