TreeViewer with JFace and SWT ...help!

Hi Guys;
My question is for those familiar with the eclipse platform developement..
I'm trying to implement a File Explorer under The Eclipse platform using the jface and SWT tools...
when i Run the code below it gives me a run time exception:
NoClassDefFound exception...
it seems that the problem resides at the line:
tv.setInput(new File("C:\\"));
if i remove the argument to File "C:\\" i get a blank view with no files..
here is the Code:
Any helpfull ideas would be very welcomed indeed...
import org.eclipse.jface.window.*;
import org.eclipse.swt.widgets.*;
import java.io.*;
import java.util.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.jface.viewers.*;
import org.eclipse.jface.window.*;
import org.eclipse.swt.*;
class FileTreeContentProvider implements ITreeContentProvider
public Object[] getChildren(Object element)
     Object[] kids = ((File) element).listFiles();
     return kids == null ? new Object[0] : kids;
public Object[] getElements(Object element)
     return getChildren(element);
public boolean hasChildren(Object element)
     return getChildren(element).length > 0;
public Object getParent(Object element)
     return ((File)element).getParent();
public void dispose()
public void inputChanged(Viewer viewer, Object old_input, Object new_input)
class FileTreeLabelProvider extends LabelProvider
public String getText(Object element)
     return ((File) element).getName();
public class Standalone extends ApplicationWindow
public Standalone()
     super(null);
protected Control createContents(Composite parent)
     TreeViewer tv = new TreeViewer(parent);
     tv.setContentProvider(new FileTreeContentProvider());
     tv.setLabelProvider(new FileTreeLabelProvider());
     tv.setInput(new File(" C:\\ "));
     return tv.getTree();
public static void main(String[] args)
     Standalone w = new Standalone();
     w.setBlockOnOpen(true);
     w.open();
     Display.getCurrent().dispose();

This is an old post... but in case anyone wants to know... This tutorial is located at http://www-106.ibm.com/developerworks/opensource/library/os-ecgui1/ and I HIGHLY recommend it for people using Eclipse and wanting to learn how to create a File Explorer with JFace/SWT.
Most likely the error that othmanSilent was getting was the following:
java.lang.NoClassDefFoundError:
org/eclipse/core/internal/boot/DelegatingURLClassLoader
It was pointed out in the eclipse.swt newsgroups quite a few times. The author of the article forgot to also mention that you need to include the following jar file in your Java Build Path: eclipse.core.boot_<eclipse-version>/boot.jar

Similar Messages

  • JFace and SWT -Eclipse

    Hi all,
    I wanted to know the best resources available on net for JFace and SWT learning. As I have no experience in GUI coding, which is best and faster way to learn JFace and SWT. Also I want to know any good forums for Eclipse.
    Please help guys.
    Thanks in advance
    Mithun K

    http://www.eclipse.org/swt/

  • PDF with notes and markup help!

    I have a shiny new iPad
    I have some contracts and bids in PDF format with notes and highlights marked up on them with preview on my Mac book pro.
    The PDF files are saved in my iDisk
    I can open them on any of my Mac computers and the notes remain intact.
    When I open them on the iPad no notes appear.
    I have tried email to iPad
    I have tried iDisk app
    I have tried goodreader
    I have pages but can't figure out if that will work
    This is a real deal buster. I have a walk through with an architect tomorrow to go over contracts and bids and I thought this would be a great way to walk through the project with my notes and not have to carry the laptop.
    is there any way to preserve and read the notes and markup I do in Mac Preview on the iPad?
    I am willing to buy an app but none of them mention this and the ones I have tried so far do not address the issue.
    Please help!

    I have pages but can't figure out if that will work
    Pages is a word processor, not a pdf reader.
    I am willing to buy an app but none of them mention this and the ones I have tried so far do not address the issue.
    I don't see any way to do what you want unless you can find an app for it. Best to list the ones you have already tried so people don't uselessly suggest them to you again, and plan to use your laptop.

  • HT1904 I HAVE SPOKEN WITH APPLE AND THEY HELPED ME AS I HAVE CANCER AND THIS IS MY COMFORT THE VIDEOS HELP TAKE AWAY MY PAIN,NOW THE ID AND PASSWORD ARE NOT BEING ACCEPTED AGAIN IHAVE HAD SAME FOR TWO YRS .

    I am having a problem with loging in to my apps as i have had same id and password for all and for two years . youtube music video's helped get through the pain of cancer and the computer help me conect to my friend then i went to mail and i was recieving nothing my doctors all have same passwords and lawyers ,and it would be hard and i could never remember many password changes as i was fine with   ,now this is second time google caused this problem and said i must change password as i belived again and did with out anyone accepting it .i con not recieve mail, or go to face book,or google search as was my only browser and they will not accept my id as they say it is wrong as does all othe web sites as well as youtube i am at a loss . please help me .   Sincerely Debra Rossi Jones
    <Email Edited by Host>

    We are fellow users here on these public forums, you're not talking to iTunes Support - I've asked the hosts to remove your email addresses and password from your post. If that is your current password that you've posted for everyone to see then you should change it IMMEDIATELY.
    I'm not sure that I understand all of your post. By 'google' do you mean your gmail email accounts ? If you do then how are you trying to access your email, via the Mail app and/or another app on your phone, the Mail program or a browser on your Mac ? If you are using the Mail app on your phone and you've checked your email account's password then you should be able to add that new password on your phone by tapping on the email account in Settings > Mail, Contacts, Calendars, then tap on the 'account' at the top of the next screen, and you should then be able to enter the new password. If you are using the Facebook app on your iPhone, and you've changed the password for logging into Facebook, then you should be able to update it on your phone via Settings > Facebook
    If you are using the Mail app on your Mac, then to change your gmail password in it (assuming that you've changed the password for it) then go into Mail > Preferences (command-comma), select the Accounts tab on the preferences, select the gmail account on the list of accounts, and on the right-hand side of that screen you should be able to update its password.
    If the problems are on your Mac then you might be better off re-posting in one of the other forums (e.g. Safari, and there are forums for various Mac OS X versions), and there is also a Using iPhone forum - this forum is for the iTunes Store e.g. buying, downloading content from iTunes.

  • Airplane help with Webhelp and HTML Help

    Hi. We are generating 2 outputs using Robohelp v.6.0: HTML
    Help and WebHelp. Standalone they both work fine. The context
    sensitive .chm works too. Problems are:
    1.) the primary help (Webhelp) does not appear - there isn't
    any error msg either.
    2.) when an invalid url is used the secondary help file does
    appear (HTML help). But this doesn't happen with the correct url of
    the primary help - Webhelp
    Isn't there supposed to be a reference to the mapping in the
    <head> of each htm file?
    Can anyone help on this topic? many thanks!

    First, move the styles from the form generator to the <head> of your document.  Otherwise there is a possibility browsers could ignore the invalid code.
    Then move your form div inside the banner div and set the attribute float:right; in your CSS for the form div.  Then you should be good to go.

  • Stuck with problems and no help

    hi,
    We are stuck with the following set of problems. Repeated entries to this forum have not fetced any response. If anybody can help us on any of these issues, please reply -
    1. We are not able to define any custom validator. We made our own validator that extends CompareValidor, but when we try to apply this rule to an attribute in the validation tab, we get the error - "no properties defined". Do i need to do something else besides creating a new class that extends CompareValidator and then writing my own code in the vlaidate method.
    2. While deploying our jspApplication on java web server, we are getting the message "error - null". The details are as mentioned in the Topic 'can anyone help!!!' that has been posted by Prabhdeep ().
    3. I have two tables, Customer and address. There is no FK between them (there cannot be because address is shared between many entities). In the address, i have 2 fields, BpType and BpId. BpType will contain 'C' to identity that this address is for a customer and id will have the customer id. In jdev 3.1, i have created entity and view objects for the 2 tables. also, i have made a view link. i need to put the condition Address.bpid = customer.customeid and address.bptype = 'c'. but it is not letting me put the second part of the condition. the chk on id works fine. as soon as i add a chk on type and test the application module, then while insertion of address i get the following error - "set method for BpType cannot be resolved".
    4. I have made a jsp appl based on bc4j. now, i need to put a check on any entity in such a manner that if the check fails, my jsp should ask the user that an exception is occuring and does he want to save even with the exceptional data. if he says yes, i want that the same entity should now save the data without giving an exception. How do i achieve this interaction between my entity and my jsp.
    Thanks a lot for any help,
    Aparna.

    I will answer Question #3:
    I'm not sure if I understand exactly what is
    happening. At first I thought you meant that you couldn't even add the second part of the association clause. But, later it sounds like you were able to add the second part of the clause (namely "address.bptype =
    'c'") and that you are experiencing some runtime error.
    Assuming the latter (that it is a RT problem), I take it this
    "...cannot be resolved" error is the error with code 27020.
    Under normal error conditions, you shouldn't get this error. Something "unusual" (or unforeseen by us) is happening if you are getting this error. Anyway, if you wrote your own client code, you should wrap a try/catch block around it, pick out the detail exception, and see what's going
    on. See the example code below:
    try
    ... make call that causes the exception ...
    catch(oracle.jbo.AttrSetValException ex)
    // Print stack trace for the outer ex
    ex.printStackTrace();
    // Get the inner exception
    Object[] details = ex.getDetails();
    if (details.length > 0)
    Exception innerEx = (Exception) details[0];
    // Now, print the inner exception's
    // stack.
    innerEx.printStackTrace();
    This will help shed some light on the exception and the cause of it.
    John - JDeveloper Team

  • Problem with XML and XSLT, help...

    Okay, I have this XML doc (called stocks.xml):
    <?xml:stylesheet type="text/xsl" href="stocks.xsl" version="1.0" encoding="UTF-8"?>
    <portfolio>
    <stock>
    <symbol> SUNW </symbol>
    <name> Sun Microsystem </name>
    <price> 12.95 </price>
    </stock>
    <stock>
    <symbol> HPW </symbol>
    <name> Hewlet Packard </name>
    <price> 53.50 </price>
    </portfolio>
    And I have this XSLT doc (called stocks.xls):
    ?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xls="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <html>
    <head>
    <title> Stocks </title>
    <body bgcolor="#ffffcc">
    <xsl:apply-template />
    </body>
    </head>
    </html>
    </xsl template>
    <xsl:template match="portfolio">
    <table border="2">
    <tr>
    <th> Stock Symbol </th><th> Company Name </th><th> Price </th>
    </tr>
    <xsl:for-each select="stock">
    <tr>
    <td>
    <i><xsl:value-of select="symbol" /></i>
    </td>
    <td>
    <xsl:value-of select="price" />
    </td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl template>
    </stylesheet>
    When I try to retrieve the stocks.xml document with
    IE, the browser said, there is an error on line 2, can not
    recognize xsl:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Reference to undeclared namespace prefix: 'xsl'. Error processing resource 'http://localhost:8080/examples/jsp/stocks/stocks.xsl'. Line 2, Position 71
    <xsl:stylesheet version="1.0" xmlns:xls="http://www.w3.org/TR/WD-xsl">
    I just follow this from an example of XML tutorial.
    Please help, what is it that I miss? Seems everything
    I have is okay....??
    Thanks,
    Ted.

    Thanks you all!
    You have spotted that mistyped.
    However, turns out Internet Browser that I have does not permit the use of XSL. After I fixed the file, I got this
    message:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Keyword xsl:apply-template may not be used here.
    Oh well...
    Anybody knows, if IE can or can not be used to view the
    XML that reference XSL??
    Thanks,
    Ted.

  • Preview will not let me annotate document with text and save - HELP!

    I have to provide a JPG document to a client that they need to annotate with text in Preview. However, Preview will not allow either of us to save this document once it is annotated, even though I created the JPG through an exported Illustrator File (and therefore have rights to the document).
    I have talked to many other people that have annotated documents with text in Preview & save the document without problems, so I have not been able to receive any helpful information to correct this issue.
    ... Or are there any other suggestions of programs that my client can open the JPG in and annotate with text? She also has a MacBook Pro and would be willing to download a program if it was reasonably priced/free.
    Please help!

    Have you turned on MMS messaging in Settings?

  • Netgear WGR614v6 Problems with Ebay and others-Help!!

    Just put in a Netgear WGR614v6 router and I can connect to the internet thru my 2-wire DSL modem (non-gateway1070-b).
    First issue was that any email I sent out-bound from Mac Mail that had an attachment would just sit in my outbox, I then disabled the SPI firewall on the Netgear router and all worked fine.
    The I went on to do further testing and found out that I can launch into ebay and ebay will only let me do one sign/in and or search then I will get a 'THE CONNECTION WAS RESET" page saying that "The connection to the server was reset while the page was loading."
    Also when I access my SBC/Yahoo email thru the web, I can log onto my account and read my first or any one message, but then when I go to view a second the same thing happens as with ebay.
    Anybody have any ideas as to what is going on.. is this a port 25 thing? All works fine when connected directly to the DSL modem.
    Thanks in adavnace for any help you may have.
    -the Danimal
    G5 Mac OS X (10.4.7)

    Figured it out, had to bridge by DSL modem and use the router as my DHCP server. All is working fine now.

  • Syncing problems with Itunes and Ipod Help?

    Okay..I don't even know what's been happening with the newest Ios 5 update for apple products, but since the update, my ipod hasn't been able to synch with Itunes.
    For example, I manually organize all my music and when I edit the album artist or the album artwork etc, it would show up in Itunes perfectly, but on the Itouch, nothing has been changed. This means that not only does it now show the album artwork that I set up in Itunes, but also all the artists as well. I've seen many people so far having this problem, but through all the solutions people have said, none have worked for me. Another problem is that it also mix and matches all the songs I have downloaded as well. Only the songs I purchase seem to be alright.
    I have tried many things from restoring my Itouch and re-downloading music, manually re-synching my Itouch to see if the artists will show up, but to no avail, it hasn't worked.
    Please help me. It's getting quite frustrating that nothing is synching since the newest ios 5.1.1 update. Thank you

    The ipod touch will only sync to one computer at a time. If you sync to another it will indeed erase the content from the ipod first, then replace with content from the new computer.
    Sign into your account on the computer, make sure it is authorized, then connect the ipod:
    Without syncing, File>Transfer Purchases

  • G4 with OS9 and OSX - HELP!!!

    Hello, I have a G4 Powermac which has been running 10.4.11 for some time now.
    Since this is a dual boot machine, it has been connected to an older drum scanner for several years (this scanner ONLY works in OS9). I haven't had to boot this machine in 9 for about a year, but I had to yesterday and now it will not BOOT UP AT ALL. I tried booting with the shift key to no avail. I booted up from the system disk, ran apple HW test which found no HW issues. at the moment, the machine has a blank blue screen. any ideas??!!

    Hi! Try booting with the option key down and select the OS you want from the icon that come up in the bootloader. It's slow so be patient until it's ready for you to select the correct volume you want to startup from. Alternatively the "x" key down at startup forces an OSX boot if a valid OSX system is found. Tom

  • Huge problems with 9360 - and NO help

    I am attempting to make contact with someone who can assist me with a
    problem I have been having with a  handset (9360) that I got in December
    2011 (on contract).
    I have had to return the phone 3 times and now it is claimed that the phone
    is beyond repair, while I still have to pay the contract - no replacement.
    I have had almost NO use of this phone.
    I will NEVER recommend this handset, and where before I had only good
    things to say about Blackberry; I will NOT go through this THEFT again. I'd
    rather use SAMSUNG or some other stupid phone. I am disgusted. Moreover
    about the fact that I am unable to establish contact with someone that can
    take responsibility for this horrible product. I tried phoning and texting
    the rep from RIM, but he totally ignores me (I have his name and number
    should someone wish to fire him)
    But then maybe RIM knew their products are FAULTY and made sure that they
    cannot be contacted for complaints.
    BAD BAD BLACKBERRY and VERY BAD RIM.

    It is possible that your PB was cut off in the middle of updating the OS. Try this;
    - hold the + and the - levers/buttons AND the On/Off button on the top of your BP down. Yes, all three at the same time until the unit restarts.
    This should reset the PB and go from there. One other thing. You can not be in a hurry to update the OS. It can take as long as 40 minutes. RIM is working on making OS updates faster. The latest OS version is 1.0.7.3312.
    Good luck

  • Navigation? can you work with httm and asp help?

    I have made a sit with fireworks/dreamweaver but now am
    finding out that I need to use Visual Web Basic for both data and
    advanced navigate needs. Can this be done? I can make nav menus in
    VWB but can't get them to work in my mock up html page.

    RAW? No. Compatible formats are JPEG, PNG, PSD and PSDX (PS Touch's own file format).
    Wouldn't be surprised to see some sort of "RAW file syncing" like Adobe just did with Lightroom on mobile, though.
    12 Megapixels is correct...for import, anyway. Oddly enough, I think you can create a 4096 by 4096 pixel project, which is a little bigger than 12 Megas.

  • Uh Oh... Major problem with iPad3 and BitmapData [HELP]

    So.. I have some stageWebView elements that use BitMapData to capture a screenshot of the browser to allow for other elements to animate ontop of the browser ( sharing options, etc ).
    When I capture this on the new iPad ... and add the bitmap to the stage the bitmap is zoomed in twice the size it should be.  Its not capturing the true viewport.  its zoomed in.
    This is what I'm using to capture the bitmap.
         SocialbitmapData = new BitmapData(socialWebView.viewPort.width, socialWebView.viewPort.height);
         socialWebView.drawViewPortToBitmapData(SocialbitmapData);
         socialViewBitmap = new Bitmap(SocialbitmapData);
         addChild(socialViewBitmap);
    Any help is appreciated

    I'll try that
    Just a note as well.   I wrote this solution ...  works perfectly when tested from the IDE ..    copyPixels fails to display anything on iPad2 or iPad3
      bitmapdataBrowser = new BitmapData(stage.stageWidth, stage.stageHeight);
                   bitmapdataBrowser.draw(stage);
                   bitmapDataA = new BitmapData(1024, 664);
                   bitmapDataA.copyPixels(bitmapdataBrowser, new Rectangle(0, 42, 1024, 664), new Point(0, 0));
                   var screenshot = new Bitmap(bitmapDataA);
                   addChild(screenshot);
                   screenshot.x = 0;
                   screenshot.y = 42;

  • I LOST MY TOOLBAR WITH 'VIEW' AND 'PRINT' - HELP!

    my main toolbar that allows me to change things disappeared.
    how do I restore it ?

    If it is the main menu bar, see the [[menu bar is missing]] article for details on restoring it.

Maybe you are looking for

  • Emails sent on iPhone do not show up on my Mac

    I have a few email accounts.  For my Gmail account if I send an email on my iPhone, it does not show up on in sent mail on my Mac (or anywhere else for that matter).  I am using Apple's Mail application and the emails I am sending from iPhone are als

  • Building jars using ant and eclipse

    Note: If this post could be in a more appropriate forum category could someone please tell me which one is better. Vexing issue: I am using ANT so that it will take care of which classes have been modified and therefore which jars need to be updated.

  • INVOIC02 IDOC for vendor invoice

    hi friends.. can we post invoice for vendor in F-02 using this IDOC for posting key 31... plz help..

  • Sr Expert Advise from Forum

    Hi, secnario rfc>soap(Digitally sign and encrypt) error: IAIK REJECTED BY CERTICATE we are trying to test signing and encryption using soap1.1 in pi7.11 system we created test interface ,we checked mapping it is ok i created private certificate and g

  • Refund For Non-Working App

    It seems impossible to get a refund for apps now. I bought an app for my ipad and it's sister app for the iphone. After installation you find out to get them to work as advertised you need to purchase more from within the app. (which is nowhere on th