# HG changeset patch # User Frank Benoit # Date 1207484158 -7200 # Node ID c884a1ab6db3f6cbc59d5a797e4e7fe466802675 # Parent e10d9c2648bedc90f7ec334eec54251d8347b5c5 resource loading, fix type in image names diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/action/StatusLine.d --- a/dwtx/jface/action/StatusLine.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/action/StatusLine.d Sun Apr 06 14:15:58 2008 +0200 @@ -114,10 +114,10 @@ protected static ImageDescriptor fgStopImage; static this() { + fgStopImage = ImageDescriptor.createFromFile( + import("dwtx.jface.action.images.stop.gif"));//$NON-NLS-1$ JFaceResources.getImageRegistry().put( "dwtx.jface.parts.StatusLine.stopImage", fgStopImage);//$NON-NLS-1$ - fgStopImage = ImageDescriptor - .createFromFile(StatusLine.classinfo, "images/stop.gif");//$NON-NLS-1$ } /** diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/dialogs/PopupDialog.d --- a/dwtx/jface/dialogs/PopupDialog.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/dialogs/PopupDialog.d Sun Apr 06 14:15:58 2008 +0200 @@ -698,10 +698,10 @@ GridDataFactory.fillDefaults().align_(DWT.END, DWT.CENTER).applyTo(toolBar); - menuImage = ImageDescriptor.createFromFile(PopupDialog.classinfo, - "images/popup_menu.gif").createImage();//$NON-NLS-1$ - disabledMenuImage = ImageDescriptor.createFromFile(PopupDialog.classinfo, - "images/popup_menu_disabled.gif").createImage();//$NON-NLS-1$ + menuImage = ImageDescriptor.createFromFile( + import("dwtx.jface.dialogs.images.popup_menu.gif")).createImage();//$NON-NLS-1$ + disabledMenuImage = ImageDescriptor.createFromFile( + import("dwtx.jface.dialogs.images.popup_menu_disabled.gif")).createImage();//$NON-NLS-1$ viewMenuButton.setImage(menuImage); viewMenuButton.setDisabledImage(disabledMenuImage); viewMenuButton.setToolTipText(JFaceResources diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/fieldassist/FieldDecorationRegistry.d --- a/dwtx/jface/fieldassist/FieldDecorationRegistry.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/fieldassist/FieldDecorationRegistry.d Sun Apr 06 14:15:58 2008 +0200 @@ -109,27 +109,22 @@ ImageRegistry imageRegistry = JFaceResources.getImageRegistry(); // Define the images used in the standard decorations. - imageRegistry.put(IMG_DEC_FIELD_CONTENT_PROPOSAL, ImageDescriptor - .createFromFile(FieldDecorationRegistry.classinfo, - "images/contassist_ovr.gif"));//$NON-NLS-1$ + imageRegistry.put(IMG_DEC_FIELD_CONTENT_PROPOSAL, ImageDescriptor.createFromFile( + import("dwtx.jface.fieldassist.images.contassist_ovr.gif")));//$NON-NLS-1$ imageRegistry.put(IMG_DEC_FIELD_ERROR, ImageDescriptor.createFromFile( - FieldDecorationRegistry.classinfo, "images/error_ovr.gif"));//$NON-NLS-1$ + import("dwtx.jface.fieldassist.images.error_ovr.gif")));//$NON-NLS-1$ - imageRegistry.put(IMG_DEC_FIELD_WARNING, ImageDescriptor - .createFromFile(FieldDecorationRegistry.classinfo, - "images/warn_ovr.gif"));//$NON-NLS-1$ + imageRegistry.put(IMG_DEC_FIELD_WARNING, ImageDescriptor.createFromFile( + import("dwtx.jface.fieldassist.images.warn_ovr.gif")));//$NON-NLS-1$ - imageRegistry.put(IMG_DEC_FIELD_REQUIRED, ImageDescriptor - .createFromFile(FieldDecorationRegistry.classinfo, - "images/required_field_cue.gif"));//$NON-NLS-1$ + imageRegistry.put(IMG_DEC_FIELD_REQUIRED, ImageDescriptor.createFromFile( + import("dwtx.jface.fieldassist.images.required_field_cue.gif")));//$NON-NLS-1$ - imageRegistry.put(IMG_DEC_FIELD_ERROR_QUICKFIX, ImageDescriptor - .createFromFile(FieldDecorationRegistry.classinfo, - "images/errorqf_ovr.gif"));//$NON-NLS-1$ + imageRegistry.put(IMG_DEC_FIELD_ERROR_QUICKFIX, ImageDescriptor.createFromFile( + import("dwtx.jface.fieldassist.images.errorqf_ovr.gif")));//$NON-NLS-1$ - imageRegistry.put(IMG_DEC_FIELD_INFO, ImageDescriptor - .createFromFile(FieldDecorationRegistry.classinfo, - "images/info_ovr.gif"));//$NON-NLS-1$ + imageRegistry.put(IMG_DEC_FIELD_INFO, ImageDescriptor.createFromFile( + import("dwtx.jface.fieldassist.images.info_ovr.gif")));//$NON-NLS-1$ // Define the standard decorations. Some do not have standard // descriptions. Use null in these cases. diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/resource/FileImageDescriptor.d --- a/dwtx/jface/resource/FileImageDescriptor.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/resource/FileImageDescriptor.d Sun Apr 06 14:15:58 2008 +0200 @@ -28,6 +28,7 @@ import dwt.dwthelper.InputStream; import dwt.dwthelper.FileInputStream; import dwt.dwthelper.BufferedInputStream; +import dwt.dwthelper.ByteArrayInputStream; /** * An image descriptor that loads its image information @@ -39,12 +40,13 @@ * The class whose resource directory contain the file, * or null if none. */ - private ClassInfo location; +// private ClassInfo location; /** * The name of the file. */ - private String name; +// private String name; + private void[] importdata; /** * Creates a new file image descriptor. @@ -60,9 +62,10 @@ * null * @param filename the name of the file */ - this(ClassInfo clazz, String filename) { - this.location = clazz; - this.name = filename; + this(void[] importdata/+ClassInfo clazz, String filename+/) { +// this.location = clazz; +// this.name = filename; + this.importdata = importdata; } /* (non-Javadoc) @@ -73,16 +76,16 @@ return false; } FileImageDescriptor other = cast(FileImageDescriptor) o; - if (location !is null) { - if ( location.name != other.location.name ) { - return false; - } - } else { - if (other.location !is null) { - return false; - } - } - return name == other.name; +// if (location !is null) { +// if ( location.name != other.location.name ) { +// return false; +// } +// } else { +// if (other.location !is null) { +// return false; +// } +// } + return importdata == other.importdata; } /* (non-Javadoc) @@ -117,16 +120,17 @@ private InputStream getStream() { InputStream is_ = null; - if (location !is null) { - is_ = ClassInfoGetResourceAsStream( location, name); +// if (location !is null) { + is_ = new ByteArrayInputStream(cast(byte[]) importdata); +// is_ = ClassInfoGetResourceAsStream( location, name); - } else { - try { - is_ = new FileInputStream(name); - } catch (/+FileNotFoundException+/ IOException e) { - return null; - } - } +// } else { +// try { +// is_ = new FileInputStream(name); +// } catch (/+FileNotFoundException+/ IOException e) { +// return null; +// } +// } if (is_ is null) { return null; } else { @@ -138,10 +142,10 @@ * Method declared on Object. */ public override hash_t toHash() { - int code = dwt.dwthelper.utils.toHash(name); - if (location !is null) { - code += location.toHash(); - } + int code = dwt.dwthelper.utils.toHash(cast(char[])importdata/+name+/); +// if (location !is null) { +// code += location.toHash(); +// } return code; } @@ -153,6 +157,7 @@ * returns a string representation of this object which is suitable only for debugging. */ public override String toString() { - return "FileImageDescriptor(location=" ~ location.toString() ~ ", name=" ~ name ~ ")";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ +// return "FileImageDescriptor(location=" ~ location.toString() ~ ", name=" ~ name ~ ")";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ + return "FileImageDescriptor()";//$NON-NLS-3$//$NON-NLS-2$//$NON-NLS-1$ } } diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/resource/ImageDescriptor.d --- a/dwtx/jface/resource/ImageDescriptor.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/resource/ImageDescriptor.d Sun Apr 06 14:15:58 2008 +0200 @@ -89,8 +89,8 @@ * @param filename the file name * @return a new image descriptor */ - public static ImageDescriptor createFromFile(ClassInfo location, String filename) { - return new FileImageDescriptor(location, filename); + public static ImageDescriptor createFromFile( void[] importdata/+ClassInfo location, String filename+/) { + return new FileImageDescriptor(importdata/+location, filename+/); } /** diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/resource/JFaceResources.d --- a/dwtx/jface/resource/JFaceResources.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/resource/JFaceResources.d Sun Apr 06 14:15:58 2008 +0200 @@ -441,28 +441,21 @@ // } catch (NoClassDefFoundError exception) { // // Test to see if OSGI is present // } - declareImage(bundle, Wizard.DEFAULT_IMAGE, ICONS_PATH ~ "page.gif", //$NON-NLS-1$ - Wizard.classinfo, "images/page.gif"); //$NON-NLS-1$ - + declareImage(bundle, Wizard.DEFAULT_IMAGE, ICONS_PATH + ~ "page.gif", import( "dwtx.jface.wizard.images.page.gif" )); //$NON-NLS-1$ // register default images for dialogs declareImage(bundle, Dialog.DLG_IMG_MESSAGE_INFO, ICONS_PATH - ~ "message_info.gif", Dialog.classinfo, "images/message_info.gif"); //$NON-NLS-1$ //$NON-NLS-2$ + ~ "message_info.gif", import( "dwtx.jface.dialogs.images.message_info.gif")); //$NON-NLS-1$ //$NON-NLS-2$ declareImage(bundle, Dialog.DLG_IMG_MESSAGE_WARNING, ICONS_PATH - ~ "message_warning.gif", Dialog.classinfo, //$NON-NLS-1$ - "images/message_warning.gif"); //$NON-NLS-1$ + ~ "message_warning.gif", import( "dwtx.jface.dialogs.images.message_warning.gif")); //$NON-NLS-1$ declareImage(bundle, Dialog.DLG_IMG_MESSAGE_ERROR, ICONS_PATH - ~ "message_error.gif", Dialog.classinfo, "images/message_error.gif");//$NON-NLS-1$ //$NON-NLS-2$ + ~ "message_error.gif", import( "dwtx.jface.dialogs.images.message_error.gif"));//$NON-NLS-1$ //$NON-NLS-2$ declareImage(bundle, Dialog.DLG_IMG_HELP, ICONS_PATH - ~ "help.gif", Dialog.classinfo, "images/help.gif");//$NON-NLS-1$ //$NON-NLS-2$ - declareImage( - bundle, - TitleAreaDialog.DLG_IMG_TITLE_BANNER, - ICONS_PATH ~ "title_banner.png", TitleAreaDialog.classinfo, "images/title_banner.gif");//$NON-NLS-1$ //$NON-NLS-2$ - declareImage( - bundle, - PreferenceDialog.PREF_DLG_TITLE_IMG, - ICONS_PATH ~ "pref_dialog_title.gif", PreferenceDialog.classinfo, "images/pref_dialog_title.gif");//$NON-NLS-1$ //$NON-NLS-2$ - + ~ "help.gif", import( "dwtx.jface.dialogs.images.help.gif"));//$NON-NLS-1$ //$NON-NLS-2$ + declareImage(bundle, TitleAreaDialog.DLG_IMG_TITLE_BANNER, ICONS_PATH + ~ "title_banner.png", import( "dwtx.jface.dialogs.images.title_banner.gif"));//$NON-NLS-1$ //$NON-NLS-2$ + declareImage(bundle, PreferenceDialog.PREF_DLG_TITLE_IMG, ICONS_PATH + ~ "pref_dialog_title.gif", import( "dwtx.jface.preference.images.pref_dialog_title.gif"));//$NON-NLS-1$ //$NON-NLS-2$ } /** @@ -486,7 +479,7 @@ * */ private static final void declareImage(Object bundle, String key, - String path, ClassInfo fallback, String fallbackPath) { + String path, void[] importdata/+ClassInfo fallback, String fallbackPath+/) { ImageDescriptor descriptor = null; @@ -500,7 +493,7 @@ // If we failed then load from the backup file if (descriptor is null) - descriptor = ImageDescriptor.createFromFile(fallback, fallbackPath); + descriptor = ImageDescriptor.createFromFile( importdata /+fallback, fallbackPath+/); imageRegistry.put(key, descriptor); } diff -r e10d9c2648be -r c884a1ab6db3 dwtx/jface/viewers/DialogCellEditor.d --- a/dwtx/jface/viewers/DialogCellEditor.d Sun Apr 06 13:21:48 2008 +0200 +++ b/dwtx/jface/viewers/DialogCellEditor.d Sun Apr 06 14:15:58 2008 +0200 @@ -96,7 +96,7 @@ static this() { ImageRegistry reg = JFaceResources.getImageRegistry(); reg.put(CELL_EDITOR_IMG_DOTS_BUTTON, ImageDescriptor.createFromFile( - DialogCellEditor.classinfo, "images/dots_button.gif"));//$NON-NLS-1$ + import("dwtx.jface.images.dots_button.gif")));//$NON-NLS-1$ } /** diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.action.images.stop.gif Binary file res/dwts.jface.action.images.stop.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.help.gif Binary file res/dwts.jface.dialogs.images.help.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.message_error.gif Binary file res/dwts.jface.dialogs.images.message_error.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.message_info.gif Binary file res/dwts.jface.dialogs.images.message_info.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.message_warning.gif Binary file res/dwts.jface.dialogs.images.message_warning.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.popup_menu.gif Binary file res/dwts.jface.dialogs.images.popup_menu.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.popup_menu_disabled.gif Binary file res/dwts.jface.dialogs.images.popup_menu_disabled.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.dialogs.images.title_banner.gif Binary file res/dwts.jface.dialogs.images.title_banner.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.fieldassist.images.contassist_ovr.gif Binary file res/dwts.jface.fieldassist.images.contassist_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.fieldassist.images.error_ovr.gif Binary file res/dwts.jface.fieldassist.images.error_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.fieldassist.images.errorqf_ovr.gif Binary file res/dwts.jface.fieldassist.images.errorqf_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.fieldassist.images.info_ovr.gif Binary file res/dwts.jface.fieldassist.images.info_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.fieldassist.images.required_field_cue.gif Binary file res/dwts.jface.fieldassist.images.required_field_cue.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.fieldassist.images.warn_ovr.gif Binary file res/dwts.jface.fieldassist.images.warn_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.images.dots_button.gif Binary file res/dwts.jface.images.dots_button.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.preference.images.pref_dialog_title.gif Binary file res/dwts.jface.preference.images.pref_dialog_title.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwts.jface.wizard.images.page.gif Binary file res/dwts.jface.wizard.images.page.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.action.images.stop.gif Binary file res/dwtx.jface.action.images.stop.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.help.gif Binary file res/dwtx.jface.dialogs.images.help.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.message_error.gif Binary file res/dwtx.jface.dialogs.images.message_error.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.message_info.gif Binary file res/dwtx.jface.dialogs.images.message_info.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.message_warning.gif Binary file res/dwtx.jface.dialogs.images.message_warning.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.popup_menu.gif Binary file res/dwtx.jface.dialogs.images.popup_menu.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.popup_menu_disabled.gif Binary file res/dwtx.jface.dialogs.images.popup_menu_disabled.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.dialogs.images.title_banner.gif Binary file res/dwtx.jface.dialogs.images.title_banner.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.fieldassist.images.contassist_ovr.gif Binary file res/dwtx.jface.fieldassist.images.contassist_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.fieldassist.images.error_ovr.gif Binary file res/dwtx.jface.fieldassist.images.error_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.fieldassist.images.errorqf_ovr.gif Binary file res/dwtx.jface.fieldassist.images.errorqf_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.fieldassist.images.info_ovr.gif Binary file res/dwtx.jface.fieldassist.images.info_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.fieldassist.images.required_field_cue.gif Binary file res/dwtx.jface.fieldassist.images.required_field_cue.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.fieldassist.images.warn_ovr.gif Binary file res/dwtx.jface.fieldassist.images.warn_ovr.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.images.dots_button.gif Binary file res/dwtx.jface.images.dots_button.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.preference.images.pref_dialog_title.gif Binary file res/dwtx.jface.preference.images.pref_dialog_title.gif has changed diff -r e10d9c2648be -r c884a1ab6db3 res/dwtx.jface.wizard.images.page.gif Binary file res/dwtx.jface.wizard.images.page.gif has changed