| Extend FileFormat [message #454557] |
Sun, 24 April 2005 10:43  |
Eclipse User |
|
|
|
Is it possible to extend FileFormat to include further image formats? I
wish to add an XPM format at least for my own use. The only problem that
I can see is the way FileFormat calls the appropriate class.
static final String FORMAT_PACKAGE = "org.eclipse.swt.internal.image";
static final String FORMAT_SUFFIX = "FileFormat";
static final String[] FORMATS = {"WinBMP", "WinBMP", "GIF", "WinICO",
"JPEG", "PNG", "TIFF", "OS2BMP"};
......
Class clazz = Class.forName(FORMAT_PACKAGE + '.' + FORMATS[i] +
FORMAT_SUFFIX);
fileFormat = (FileFormat) clazz.newInstance();
As far as I can see this would require that "XPM" be addaed to the
FORMATS String[] in FileFormat itself. I cannot see a way to do this
apart from copying FileFormat into a package of my own along with any
other appropriate protected class such as LEDataInputStream and
modifying it apprpriately.
Simon Meaden
|
|
|
| Re: Extend FileFormat [message #454604 is a reply to message #454557] |
Mon, 25 April 2005 10:35  |
Eclipse User |
|
|
|
https://bugs.eclipse.org/bugs/show_bug.cgi?id=37003
"Simon Meaden" <simonmeaden@blueyonder.co.uk> wrote in message
news:d4gbhr$ti4$1@news.eclipse.org...
> Is it possible to extend FileFormat to include further image formats? I
> wish to add an XPM format at least for my own use. The only problem that
> I can see is the way FileFormat calls the appropriate class.
>
> static final String FORMAT_PACKAGE = "org.eclipse.swt.internal.image";
> static final String FORMAT_SUFFIX = "FileFormat";
> static final String[] FORMATS = {"WinBMP", "WinBMP", "GIF", "WinICO",
> "JPEG", "PNG", "TIFF", "OS2BMP"};
>
> .....
>
> Class clazz = Class.forName(FORMAT_PACKAGE + '.' + FORMATS[i] +
> FORMAT_SUFFIX);
> fileFormat = (FileFormat) clazz.newInstance();
>
> As far as I can see this would require that "XPM" be addaed to the
> FORMATS String[] in FileFormat itself. I cannot see a way to do this
> apart from copying FileFormat into a package of my own along with any
> other appropriate protected class such as LEDataInputStream and
> modifying it apprpriately.
>
> Simon Meaden
|
|
|
Powered by
FUDForum. Page generated in 0.03304 seconds