Results 1 to 1 of 1
  1. #1
    darie20 is offline Member
    Join Date
    Jan 2010
    Rep Power

    Question TreeViewer Listener

    Hey everybody,

    I'm new to JFace and I have a simple problem which I cannot solve. The funny thing is that I have programmed Java in the last 3 years pretty much, but I noticed that programming with JFace is like learning another programming language, although it's still Java...:(

    Ok, back to my problem: I'm trying to develop an xml text editor plugin for Eclipse. I used the auto-generated code from eclipse, which creates the basic editor and I want to improve it by adding some functionalities.

    I created a multi page editor (for now I have 2 tabs). The first tab is named "Source Code View" - here you can edit an xml file "by hand", the second one is called "Tree View" - here I take the content of the input file and display it as a Tree. [please pay attention to this last sentence, I think here's the problem]

    So far so good. Everything works fine until now. But: what I want is to create a listener for this tree, so that when I manually change the content in the first tab (eg: I delete a row = xml element), the tree should automatically update it's structure. So even if I don't save the input file, the tree should listen to changes made in the first tab (even if unsaved to the file from the workspace).

    Well, I googled around for some time and did not find any concrete answer. JFace is not so good documented (with examples) as I hoped.

    I would be very glad if you could give me some advice, at least what I should look for.

    A listener in pure Java is as simple as "good morning", in Jface (at least for me), it isn't. :(

    Thanks in advance.
    Last edited by darie20; 01-25-2010 at 01:27 PM.

Similar Threads

  1. Images problem in treeviewer
    By Gandolf in forum SWT / JFace
    Replies: 0
    Last Post: 04-03-2009, 03:18 PM
  2. [SOLVED] Attaching a mouseListener to a TreeViewer
    By xcallmejudasx in forum New To Java
    Replies: 1
    Last Post: 11-10-2008, 08:38 PM
  3. SWT treeviewer
    By sushistix in forum SWT / JFace
    Replies: 4
    Last Post: 10-28-2008, 10:25 PM
  4. How do I refresh a TreeViewer object?
    By xcallmejudasx in forum SWT / JFace
    Replies: 0
    Last Post: 10-27-2008, 04:51 PM
  5. TreeViewer Demonstration
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 05:54 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts