Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » File Icons
File Icons [message #439572] Tue, 13 July 2004 14:54 Go to next message
Eclipse UserFriend
Hi,
I was wondering if anyone has an idea of how to (if it's possible)
retrieve icons from files in windows (not from the associated programs).
Thanks in advance,
Tej
Re: File Icons [message #439577 is a reply to message #439572] Tue, 13 July 2004 17:13 Go to previous messageGo to next message
Eclipse UserFriend
Not sure what you are asking. There is the API in
org.eclipse.swt.program.Program:

/**
* Returns the receiver's image data. This is the icon
* that is associated with the reciever in the operating
* system.
*
* @return the image data for the program, may be null
*/
public ImageData getImageData ()

This, for example, will give you an image of the internet explorer icon when
you call Program.findProgram(".html") if you registered IE to be the
application that opens all html files.

"Tej" <swt.10.tej@spamgourmet.com> wrote in message
news:cd1b56$n95$1@eclipse.org...
> Hi,
> I was wondering if anyone has an idea of how to (if it's possible)
> retrieve icons from files in windows (not from the associated programs).
> Thanks in advance,
> Tej
>
Re: File Icons [message #439578 is a reply to message #439577] Tue, 13 July 2004 17:35 Go to previous messageGo to next message
Eclipse UserFriend
Thanks. What I'm looking for though is how to get an icon of a file
without a program associated. For example, if I wanted an icon for the
file "C:\Program Files\Internet Explorer\IEXPLORE.EXE" which I believe
stores the icon in itself. I don't see anything in Program that will help
with this.
-Tej

Veronika Irvine wrote:

> Not sure what you are asking. There is the API in
> org.eclipse.swt.program.Program:

> /**
> * Returns the receiver's image data. This is the icon
> * that is associated with the reciever in the operating
> * system.
> *
> * @return the image data for the program, may be null
> */
> public ImageData getImageData ()

> This, for example, will give you an image of the internet explorer icon when
> you call Program.findProgram(".html") if you registered IE to be the
> application that opens all html files.

> "Tej" <swt.10.tej@spamgourmet.com> wrote in message
> news:cd1b56$n95$1@eclipse.org...
> > Hi,
> > I was wondering if anyone has an idea of how to (if it's possible)
> > retrieve icons from files in windows (not from the associated programs).
> > Thanks in advance,
> > Tej
> >
Re: File Icons [message #439594 is a reply to message #439578] Wed, 14 July 2004 09:14 Go to previous messageGo to next message
Eclipse UserFriend
I suppose you could get all available programs with Program.getPrograms()
and for each program in the resulting array, use getName() to determine if
it is "Internet Explorer" for example.

"Tej" <swt.10.tej@spamgourmet.com> wrote in message
news:cd1kjp$79n$1@eclipse.org...
> Thanks. What I'm looking for though is how to get an icon of a file
> without a program associated. For example, if I wanted an icon for the
> file "C:\Program Files\Internet Explorer\IEXPLORE.EXE" which I believe
> stores the icon in itself. I don't see anything in Program that will help
> with this.
> -Tej
>
> Veronika Irvine wrote:
>
> > Not sure what you are asking. There is the API in
> > org.eclipse.swt.program.Program:
>
> > /**
> > * Returns the receiver's image data. This is the icon
> > * that is associated with the reciever in the operating
> > * system.
> > *
> > * @return the image data for the program, may be null
> > */
> > public ImageData getImageData ()
>
> > This, for example, will give you an image of the internet explorer icon
when
> > you call Program.findProgram(".html") if you registered IE to be the
> > application that opens all html files.
>
> > "Tej" <swt.10.tej@spamgourmet.com> wrote in message
> > news:cd1b56$n95$1@eclipse.org...
> > > Hi,
> > > I was wondering if anyone has an idea of how to (if it's possible)
> > > retrieve icons from files in windows (not from the associated
programs).
> > > Thanks in advance,
> > > Tej
> > >
>
>
Re: File Icons [message #439601 is a reply to message #439578] Wed, 14 July 2004 11:15 Go to previous message
Eclipse UserFriend
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4643

Note that some platforms (Linux) do not store icons as named resources
within the executable so the API could never work there because the concept
doesn't exist.

"Tej" <swt.10.tej@spamgourmet.com> wrote in message
news:cd1kjp$79n$1@eclipse.org...
> Thanks. What I'm looking for though is how to get an icon of a file
> without a program associated. For example, if I wanted an icon for the
> file "C:\Program Files\Internet Explorer\IEXPLORE.EXE" which I believe
> stores the icon in itself. I don't see anything in Program that will help
> with this.
> -Tej
>
> Veronika Irvine wrote:
>
> > Not sure what you are asking. There is the API in
> > org.eclipse.swt.program.Program:
>
> > /**
> > * Returns the receiver's image data. This is the icon
> > * that is associated with the reciever in the operating
> > * system.
> > *
> > * @return the image data for the program, may be null
> > */
> > public ImageData getImageData ()
>
> > This, for example, will give you an image of the internet explorer icon
when
> > you call Program.findProgram(".html") if you registered IE to be the
> > application that opens all html files.
>
> > "Tej" <swt.10.tej@spamgourmet.com> wrote in message
> > news:cd1b56$n95$1@eclipse.org...
> > > Hi,
> > > I was wondering if anyone has an idea of how to (if it's possible)
> > > retrieve icons from files in windows (not from the associated
programs).
> > > Thanks in advance,
> > > Tej
> > >
>
>
Previous Topic:What SWT component replaces the JInternalFrame
Next Topic:accessing the mozilla dom through java
Goto Forum:
  


Current Time: Tue Jul 08 07:16:15 EDT 2025

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

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

Back to the top