Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Extend FileFormat
Extend FileFormat [message #454557] Sun, 24 April 2005 14:43 Go to next message
Simon Meaden is currently offline Simon MeadenFriend
Messages: 10
Registered: July 2009
Junior Member
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 14:35 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
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
Previous Topic:OLE / OpenOffice / clientSite.save()
Next Topic:Closing a Shell with ON_TOP style after an ALT->TAB
Goto Forum:
  


Current Time: Thu Mar 04 13:09:55 GMT 2021

Powered by FUDForum. Page generated in 0.01482 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top